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 1.0.1.1 88/01/26 14:15:24 root Exp $
23 # $Log: Makefile.SH,v $
24 # Revision 1.0.1.1 88/01/26 14:15:24 root
25 # Added mallocsrc stuff.
27 # Revision 1.0 87/12/18 17:50:17 root
41 mallocsrc = $mallocsrc
42 mallocobj = $mallocobj
47 cat >>Makefile <<'!NO!SUBS!'
53 manpages = a2p.man s2p.man
57 sh = Makefile.SH makedepend.SH
59 h = EXTERN.h INTERN.h config.h handy.h hash.h a2p.h str.h util.h
61 c = hash.c $(mallocsrc) str.c util.c walk.c
63 obj = hash.o $(mallocobj) str.o util.o walk.o
67 addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
73 $(CC) -c $(CFLAGS) $(LARGE) $*.c
75 all: $(public) $(private) $(util)
79 $(CC) $(LDFLAGS) $(LARGE) $(obj) a2p.o $(libs) -o a2p
82 @ echo Expect 107 shift/reduce errors...
86 a2p.o: a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h
87 $(CC) -c $(CFLAGS) $(LARGE) a2p.c
89 # if a .h file depends on another .h file...
95 - mv $(bin)/a2p $(bin)/a2p.old
96 - mv $(bin)/s2p $(bin)/s2p.old
97 - if test `pwd` != $(bin); then cp $(public) $(bin); fi
99 for pub in $(public); do \
100 chmod 755 `basename $$pub`; \
102 - test $(bin) = /bin || rm -f /bin/a2p
104 # - makedir `filexp $(lib)`
106 #if test `pwd` != `filexp $(lib)`; then \
107 #cp $(private) `filexp $(lib)`; \
109 # cd `filexp $(lib)`; \
110 #for priv in $(private); do \
111 #chmod 755 `basename $$priv`; \
113 - if test `pwd` != $(mansrc); then \
114 for page in $(manpages); do \
115 cp $$page $(mansrc)/`basename $$page .man`.$(manext); \
123 rm -f a2p *.orig */*.orig *.o core $(addedbyconf)
125 # The following lint has practically everything turned on. Unfortunately,
126 # you have to wade through a lot of mumbo jumbo that can't be suppressed.
127 # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
131 lint $(lintflags) $(defs) $(c) > a2p.fuzz
133 depend: ../makedepend
137 echo $(c) | tr ' ' '\012' >.clist
140 echo $(h) | tr ' ' '\012' >.hlist
143 echo $(sh) | tr ' ' '\012' >.shlist
145 # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
147 @ echo "You haven't done a "'"make depend" yet!'; exit 1
148 makedepend: makedepend.SH
149 /bin/sh makedepend.SH
155 ln Makefile ../Makefile