2 */*) cd `expr X$0 : 'X\(.*\)/'` ;;
6 if test ! -f config.sh; then
8 ln ../../config.sh . || \
9 ln ../../../config.sh . || \
10 (echo "Can't find config.sh."; exit 1)
17 *) mallocsrc="../$mallocsrc";;
19 echo "Extracting x2p/Makefile (with variable substitutions)"
20 cat >Makefile <<!GROK!THIS!
21 # $Header: Makefile.SH,v 3.0.1.1 89/10/26 23:29:11 lwall Locked $
23 # $Log: Makefile.SH,v $
24 # Revision 3.0.1.1 89/10/26 23:29:11 lwall
25 # patch1: in x2p/Makefile.SH, added dependency on ../config.sh
27 # Revision 3.0 89/10/18 15:33:52 lwall
30 # Revision 2.0.1.2 88/09/07 17:13:30 lwall
31 # patch14: added redirection of stderr to /dev/null
33 # Revision 2.0.1.1 88/07/11 23:13:39 root
34 # patch2: now expects more shift/reduce errors
36 # Revision 2.0 88/06/05 00:15:31 root
37 # Baseline version 2.0.
46 CFLAGS = $ccflags $optimize
50 mallocsrc = $mallocsrc
51 mallocobj = $mallocobj
53 libs = $libnm -lm $libs
56 cat >>Makefile <<'!NO!SUBS!'
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
82 $(CC) -c $(CFLAGS) $(LARGE) $*.c
84 all: $(public) $(private) $(util)
88 $(CC) $(LARGE) $(LDFLAGS) $(obj) a2p.o $(libs) -o a2p
91 @ echo Expect 208 shift/reduce conflicts...
95 a2p.o: a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h ../config.h
96 $(CC) -c $(CFLAGS) $(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`; \
109 # - ./makedir `filexp $(lib)`
111 #if test `pwd` != `filexp $(lib)`; then \
112 #cp $(private) `filexp $(lib)`; \
114 # cd `filexp $(lib)`; \
115 #for priv in $(private); do \
116 #chmod +x `basename $$priv`; \
118 - if test `pwd` != $(mansrc); then \
119 for page in $(manpages); do \
120 cp $$page $(mansrc)/`basename $$page .man`.$(manext); \
128 rm -f a2p *.orig */*.orig *.o core $(addedbyconf)
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
136 lint $(lintflags) $(defs) $(c) > a2p.fuzz
138 depend: ../makedepend
142 echo $(c) | tr ' ' '\012' >.clist
145 echo $(h) | tr ' ' '\012' >.hlist
148 echo $(sh) | tr ' ' '\012' >.shlist
150 config.sh: ../config.sh
154 # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
156 @ echo "You haven't done a "'"make depend" yet!'; exit 1
157 makedepend: makedepend.SH
158 /bin/sh makedepend.SH
164 ln Makefile ../Makefile