3 if test ! -f config.sh; then
5 ln ../../config.sh . || \
6 ln ../../../config.sh . || \
7 (echo "Can't find config.sh."; exit 1)
13 */*) cd `expr X$0 : 'X\(.*\)/'` ;;
17 *) mallocsrc="../$mallocsrc";;
19 echo "Extracting x2p/Makefile (with variable substitutions)"
20 cat >Makefile <<!GROK!THIS!
21 # $Header: Makefile.SH,v 2.0 88/06/05 00:15:31 root Exp $
23 # $Log: Makefile.SH,v $
24 # Revision 2.0 88/06/05 00:15:31 root
25 # Baseline version 2.0.
38 mallocsrc = $mallocsrc
39 mallocobj = $mallocobj
44 cat >>Makefile <<'!NO!SUBS!'
50 manpages = a2p.man s2p.man
54 sh = Makefile.SH makedepend.SH
56 h = EXTERN.h INTERN.h config.h handy.h hash.h a2p.h str.h util.h
58 c = hash.c $(mallocsrc) str.c util.c walk.c
60 obj = hash.o $(mallocobj) str.o util.o walk.o
64 addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
70 $(CC) -c $(CFLAGS) $(LARGE) $*.c
72 all: $(public) $(private) $(util)
76 $(CC) $(LDFLAGS) $(LARGE) $(obj) a2p.o $(libs) -o a2p
79 @ echo Expect 103 shift/reduce errors...
83 a2p.o: a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h ../config.h
84 $(CC) -c $(CFLAGS) $(LARGE) a2p.c
86 # if a .h file depends on another .h file...
92 - mv $(bin)/a2p $(bin)/a2p.old 2>/dev/null
93 - mv $(bin)/s2p $(bin)/s2p.old
94 - if test `pwd` != $(bin); then cp $(public) $(bin); fi
96 for pub in $(public); do \
97 chmod +x `basename $$pub`; \
100 # - ./makedir `filexp $(lib)`
102 #if test `pwd` != `filexp $(lib)`; then \
103 #cp $(private) `filexp $(lib)`; \
105 # cd `filexp $(lib)`; \
106 #for priv in $(private); do \
107 #chmod +x `basename $$priv`; \
109 - if test `pwd` != $(mansrc); then \
110 for page in $(manpages); do \
111 cp $$page $(mansrc)/`basename $$page .man`.$(manext); \
119 rm -f a2p *.orig */*.orig *.o core $(addedbyconf)
121 # The following lint has practically everything turned on. Unfortunately,
122 # you have to wade through a lot of mumbo jumbo that can't be suppressed.
123 # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
127 lint $(lintflags) $(defs) $(c) > a2p.fuzz
129 depend: ../makedepend
133 echo $(c) | tr ' ' '\012' >.clist
136 echo $(h) | tr ' ' '\012' >.hlist
139 echo $(sh) | tr ' ' '\012' >.shlist
141 # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
143 @ echo "You haven't done a "'"make depend" yet!'; exit 1
144 makedepend: makedepend.SH
145 /bin/sh makedepend.SH
151 ln Makefile ../Makefile