2 */*) cd `expr X$0 : 'X\(.*\)/'` ;;
6 if test ! -f config.sh; then
8 ln -s ../config.sh . || \
9 ln ../../config.sh . || \
10 ln ../../../config.sh . || \
11 (echo "Can't find config.sh."; exit 1)
16 echo "Extracting x2p/Makefile (with variable substitutions)"
18 cat >Makefile <<!GROK!THIS!
19 # $RCSfile: Makefile.SH,v $$Revision: 4.1 $$Date: 92/08/07 18:29:07 $
21 # $Log: Makefile.SH,v $
22 # Revision 4.1 92/08/07 18:29:07 lwall
24 # Revision 4.0.1.3 92/06/08 16:11:32 lwall
25 # patch20: SH files didn't work well with symbolic links
26 # patch20: cray didn't give enough memory to /bin/sh
27 # patch20: makefiles now display new shift/reduce expectations
29 # Revision 4.0.1.2 91/11/05 19:19:04 lwall
30 # patch11: random cleanup
32 # Revision 4.0.1.1 91/06/07 12:12:14 lwall
33 # patch4: cflags now emits entire cc command except for the filename
35 # Revision 4.0 91/03/20 01:57:03 lwall
49 mallocsrc = $mallocsrc
50 mallocobj = $mallocobj
51 shellflags = $shellflags
56 cat >>Makefile <<'!NO!SUBS!'
58 CCCMD = `sh $(shellflags) cflags $@`
60 public = a2p s2p find2perl
64 manpages = a2p.man s2p.man
68 sh = Makefile.SH makedepend.SH
70 h = EXTERN.h INTERN.h ../config.h handy.h hash.h a2p.h str.h util.h
72 c = hash.c $(mallocsrc) str.c util.c walk.c
74 obj = hash.o $(mallocobj) str.o util.o walk.o
78 addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
86 all: $(public) $(private) $(util)
90 $(CC) $(LDFLAGS) $(obj) a2p.o $(libs) -o a2p
93 @ echo Expect 231 shift/reduce conflicts...
97 a2p.o: a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h ../config.h str.h hash.h
98 $(CCCMD) $(LARGE) a2p.c
101 # won't work with csh
102 export PATH || exit 1
103 - mv $(bin)/a2p $(bin)/a2p.old 2>/dev/null
104 - mv $(bin)/s2p $(bin)/s2p.old 2>/dev/null
105 - if test `pwd` != $(bin); then cp $(public) $(bin); fi
107 for pub in $(public); do \
108 chmod +x `basename $$pub`; \
110 - if test `pwd` != $(mansrc); then \
111 for page in $(manpages); do \
112 cp $$page $(mansrc)/`basename $$page .man`.$(manext); \
120 rm -f *.orig */*.orig core $(addedbyconf) a2p.c s2p find2perl all cflags
122 # The following lint has practically everything turned on. Unfortunately,
123 # you have to wade through a lot of mumbo jumbo that can't be suppressed.
124 # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
128 lint $(lintflags) $(defs) $(c) > a2p.fuzz
130 depend: $(mallocsrc) ../makedepend
134 echo $(c) | tr ' ' '\012' >.clist
137 echo $(h) | tr ' ' '\012' >.hlist
140 echo $(sh) | tr ' ' '\012' >.shlist
142 config.sh: ../config.sh
146 malloc.c: ../malloc.c
147 sed <../malloc.c >malloc.c \
148 -e 's/"perl.h"/"..\/perl.h"/' \
151 # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
153 @ echo "You haven't done a "'"make depend" yet!'; exit 1
154 makedepend: makedepend.SH
155 /bin/sh $(shellflags) makedepend.SH
161 ln Makefile ../Makefile