This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl 3.0 patch #4 Patch #2 continued
[perl5.git] / x2p / Makefile.SH
CommitLineData
a687059c
LW
1case "$0" in
2*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
3esac
8d063cd8
LW
4case $CONFIG in
5'')
6 if test ! -f config.sh; then
7 ln ../config.sh . || \
8 ln ../../config.sh . || \
9 ln ../../../config.sh . || \
10 (echo "Can't find config.sh."; exit 1)
11 fi
378cc40b 12 . ./config.sh
8d063cd8
LW
13 ;;
14esac
a1cc2bdc
AR
15case "$mallocsrc" in
16'') ;;
17*) mallocsrc="../$mallocsrc";;
18esac
8d063cd8
LW
19echo "Extracting x2p/Makefile (with variable substitutions)"
20cat >Makefile <<!GROK!THIS!
03a14243 21# $Header: Makefile.SH,v 3.0.1.1 89/10/26 23:29:11 lwall Locked $
8d063cd8
LW
22#
23# $Log: Makefile.SH,v $
03a14243
LW
24# Revision 3.0.1.1 89/10/26 23:29:11 lwall
25# patch1: in x2p/Makefile.SH, added dependency on ../config.sh
26#
a687059c
LW
27# Revision 3.0 89/10/18 15:33:52 lwall
28# 3.0 baseline
29#
30# Revision 2.0.1.2 88/09/07 17:13:30 lwall
31# patch14: added redirection of stderr to /dev/null
32#
33# Revision 2.0.1.1 88/07/11 23:13:39 root
34# patch2: now expects more shift/reduce errors
35#
378cc40b
LW
36# Revision 2.0 88/06/05 00:15:31 root
37# Baseline version 2.0.
8d063cd8
LW
38#
39#
40
41CC = $cc
42bin = $bin
43lib = $lib
44mansrc = $mansrc
45manext = $manext
a687059c 46CFLAGS = $ccflags $optimize
8d063cd8
LW
47LDFLAGS = $ldflags
48SMALL = $small
49LARGE = $large $split
a1cc2bdc
AR
50mallocsrc = $mallocsrc
51mallocobj = $mallocobj
8d063cd8 52
a687059c 53libs = $libnm -lm $libs
8d063cd8
LW
54!GROK!THIS!
55
56cat >>Makefile <<'!NO!SUBS!'
57
58public = a2p s2p
59
60private =
61
62manpages = a2p.man s2p.man
63
64util =
65
66sh = Makefile.SH makedepend.SH
67
68h = EXTERN.h INTERN.h config.h handy.h hash.h a2p.h str.h util.h
69
a1cc2bdc 70c = hash.c $(mallocsrc) str.c util.c walk.c
8d063cd8 71
a1cc2bdc 72obj = hash.o $(mallocobj) str.o util.o walk.o
8d063cd8
LW
73
74lintflags = -phbvxac
75
76addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
77
78# grrr
79SHELL = /bin/sh
80
81.c.o:
82 $(CC) -c $(CFLAGS) $(LARGE) $*.c
83
84all: $(public) $(private) $(util)
85 touch all
86
87a2p: $(obj) a2p.o
a687059c 88 $(CC) $(LARGE) $(LDFLAGS) $(obj) a2p.o $(libs) -o a2p
8d063cd8
LW
89
90a2p.c: a2p.y
a687059c 91 @ echo Expect 208 shift/reduce conflicts...
8d063cd8
LW
92 yacc a2p.y
93 mv y.tab.c a2p.c
94
378cc40b 95a2p.o: a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h ../config.h
8d063cd8
LW
96 $(CC) -c $(CFLAGS) $(LARGE) a2p.c
97
8d063cd8
LW
98install: a2p s2p
99# won't work with csh
100 export PATH || exit 1
378cc40b 101 - mv $(bin)/a2p $(bin)/a2p.old 2>/dev/null
a687059c 102 - mv $(bin)/s2p $(bin)/s2p.old 2>/dev/null
8d063cd8
LW
103 - if test `pwd` != $(bin); then cp $(public) $(bin); fi
104 cd $(bin); \
105for pub in $(public); do \
378cc40b 106chmod +x `basename $$pub`; \
8d063cd8 107done
378cc40b
LW
108# chmod +x makedir
109# - ./makedir `filexp $(lib)`
8d063cd8
LW
110# - \
111#if test `pwd` != `filexp $(lib)`; then \
112#cp $(private) `filexp $(lib)`; \
113#fi
114# cd `filexp $(lib)`; \
115#for priv in $(private); do \
378cc40b 116#chmod +x `basename $$priv`; \
8d063cd8
LW
117#done
118 - if test `pwd` != $(mansrc); then \
119for page in $(manpages); do \
120cp $$page $(mansrc)/`basename $$page .man`.$(manext); \
121done; \
122fi
123
124clean:
125 rm -f *.o
126
127realclean:
128 rm -f a2p *.orig */*.orig *.o core $(addedbyconf)
129
130# The following lint has practically everything turned on. Unfortunately,
131# you have to wade through a lot of mumbo jumbo that can't be suppressed.
132# If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
133# for that spot.
134
135lint:
136 lint $(lintflags) $(defs) $(c) > a2p.fuzz
137
138depend: ../makedepend
139 ../makedepend
140
141clist:
142 echo $(c) | tr ' ' '\012' >.clist
143
144hlist:
145 echo $(h) | tr ' ' '\012' >.hlist
146
147shlist:
148 echo $(sh) | tr ' ' '\012' >.shlist
149
03a14243
LW
150config.sh: ../config.sh
151 rm -f config.sh
152 ln ../config.sh .
153
8d063cd8
LW
154# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
155$(obj):
156 @ echo "You haven't done a "'"make depend" yet!'; exit 1
157makedepend: makedepend.SH
158 /bin/sh makedepend.SH
159!NO!SUBS!
160$eunicefix Makefile
161case `pwd` in
162*SH)
163 $rm -f ../Makefile
164 ln Makefile ../Makefile
165 ;;
166esac