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)
18 *) mallocsrc="../$mallocsrc";;
20 echo "Extracting x2p/Makefile (with variable substitutions)"
21 cat >Makefile <<!GROK!THIS!
22 # $Header: Makefile.SH,v 4.0 91/03/20 01:57:03 lwall Locked $
24 # $Log: Makefile.SH,v $
25 # Revision 4.0 91/03/20 01:57:03 lwall
36 CFLAGS = $ccflags $optimize
40 mallocsrc = $mallocsrc
41 mallocobj = $mallocobj
46 cat >>Makefile <<'!NO!SUBS!'
48 public = a2p s2p find2perl
52 manpages = a2p.man s2p.man
56 sh = Makefile.SH makedepend.SH
58 h = EXTERN.h INTERN.h config.h handy.h hash.h a2p.h str.h util.h
60 c = hash.c $(mallocsrc) str.c util.c walk.c
62 obj = hash.o $(mallocobj) str.o util.o walk.o
66 addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
72 $(CC) -c $(CFLAGS) $(LARGE) $*.c
74 all: $(public) $(private) $(util)
78 $(CC) $(LARGE) $(LDFLAGS) $(obj) a2p.o $(libs) -o a2p
81 @ echo Expect 226 shift/reduce conflicts...
85 a2p.o: a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h ../config.h str.h hash.h
86 $(CC) -c $(CFLAGS) $(LARGE) a2p.c
91 - mv $(bin)/a2p $(bin)/a2p.old 2>/dev/null
92 - mv $(bin)/s2p $(bin)/s2p.old 2>/dev/null
93 - if test `pwd` != $(bin); then cp $(public) $(bin); fi
95 for pub in $(public); do \
96 chmod +x `basename $$pub`; \
99 # - ./makedir `filexp $(lib)`
101 #if test `pwd` != `filexp $(lib)`; then \
102 #cp $(private) `filexp $(lib)`; \
104 # cd `filexp $(lib)`; \
105 #for priv in $(private); do \
106 #chmod +x `basename $$priv`; \
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 all
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: ../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 # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
146 @ echo "You haven't done a "'"make depend" yet!'; exit 1
147 makedepend: makedepend.SH
148 /bin/sh makedepend.SH
154 ln Makefile ../Makefile