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.0.1.3 $$Date: 92/06/08 16:11:32 $
21 # $Log: Makefile.SH,v $
22 # Revision 4.0.1.3 92/06/08 16:11:32 lwall
23 # patch20: SH files didn't work well with symbolic links
24 # patch20: cray didn't give enough memory to /bin/sh
25 # patch20: makefiles now display new shift/reduce expectations
27 # Revision 4.0.1.2 91/11/05 19:19:04 lwall
28 # patch11: random cleanup
30 # Revision 4.0.1.1 91/06/07 12:12:14 lwall
31 # patch4: cflags now emits entire cc command except for the filename
33 # Revision 4.0 91/03/20 01:57:03 lwall
47 mallocsrc = $mallocsrc
48 mallocobj = $mallocobj
49 shellflags = $shellflags
54 cat >>Makefile <<'!NO!SUBS!'
56 CCCMD = `sh $(shellflags) cflags $@`
58 public = a2p s2p find2perl
62 manpages = a2p.man s2p.man
66 sh = Makefile.SH makedepend.SH
68 h = EXTERN.h INTERN.h ../config.h handy.h hash.h a2p.h str.h util.h
70 c = hash.c $(mallocsrc) str.c util.c walk.c
72 obj = hash.o $(mallocobj) str.o util.o walk.o
76 addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
84 all: $(public) $(private) $(util)
88 $(CC) $(LDFLAGS) $(obj) a2p.o $(libs) -o a2p
91 @ echo Expect 231 shift/reduce conflicts...
95 a2p.o: a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h ../config.h str.h hash.h
96 $(CCCMD) $(LARGE) a2p.c
100 export PATH || exit 1
101 - mv $(bin)/a2p $(bin)/a2p.old 2>/dev/null
102 - mv $(bin)/s2p $(bin)/s2p.old 2>/dev/null
103 - if test `pwd` != $(bin); then cp $(public) $(bin); fi
105 for pub in $(public); do \
106 chmod +x `basename $$pub`; \
108 - if test `pwd` != $(mansrc); then \
109 for page in $(manpages); do \
110 cp $$page $(mansrc)/`basename $$page .man`.$(manext); \
118 rm -f *.orig */*.orig core $(addedbyconf) a2p.c s2p find2perl all cflags
120 # The following lint has practically everything turned on. Unfortunately,
121 # you have to wade through a lot of mumbo jumbo that can't be suppressed.
122 # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
126 lint $(lintflags) $(defs) $(c) > a2p.fuzz
128 depend: $(mallocsrc) ../makedepend
132 echo $(c) | tr ' ' '\012' >.clist
135 echo $(h) | tr ' ' '\012' >.hlist
138 echo $(sh) | tr ' ' '\012' >.shlist
140 config.sh: ../config.sh
144 malloc.c: ../malloc.c
145 sed 's/"perl.h"/"..\/perl.h"/' ../malloc.c >malloc.c
147 # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
149 @ echo "You haven't done a "'"make depend" yet!'; exit 1
150 makedepend: makedepend.SH
151 /bin/sh $(shellflags) makedepend.SH
157 ln Makefile ../Makefile