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 *define*) sln='ln -s' ;;
22 *define*) suidperl='suidperl' ;;
26 echo "Extracting Makefile (with variable substitutions)"
27 cat >Makefile <<!GROK!THIS!
28 # $Header: Makefile.SH,v 3.0.1.5 90/03/12 16:15:17 lwall Locked $
30 # $Log: Makefile.SH,v $
31 # Revision 3.0.1.5 90/03/12 16:15:17 lwall
32 # patch13: some dependencies missing on perly.h
33 # patch13: some relief for buggy parallel makes
34 # patch13: bison doesn't declare extern YYSTYPE yylval;
36 # Revision 3.0.1.4 90/02/28 16:19:43 lwall
37 # patch9: extraneous $ on suidperl in Makefile
39 # Revision 3.0.1.3 89/12/21 19:09:26 lwall
40 # patch7: Configure now lets you pick between yacc or bison
42 # Revision 3.0.1.2 89/11/11 04:07:30 lwall
43 # patch2: $sockethdr incorporated into $ccflags
44 # patch2: $libs now has most of the -l libraries
46 # Revision 3.0.1.1 89/10/26 23:00:38 lwall
47 # patch1: Makefile.SH needed some more .h dependecies
49 # Revision 3.0 89/10/18 15:06:43 lwall
59 CFLAGS = $ccflags $optimize
63 mallocsrc = $mallocsrc
64 mallocobj = $mallocobj
69 public = perl taintperl $suidperl
73 cat >>Makefile <<'!NO!SUBS!'
82 sh = Makefile.SH makedepend.SH
84 h1 = EXTERN.h INTERN.h arg.h array.h cmd.h config.h form.h handy.h
85 h2 = hash.h perl.h regcomp.h regexp.h spat.h stab.h str.h util.h
89 c1 = array.c cmd.c cons.c consarg.c doarg.c doio.c dolist.c dump.c
90 c2 = eval.c form.c hash.c $(mallocsrc) perly.c regcomp.c regexec.c
91 c3 = stab.c str.c toke.c util.c
95 obj1 = array.o cmd.o cons.o consarg.o doarg.o doio.o dolist.o dump.o
96 obj2 = eval.o form.o hash.o $(mallocobj) perly.o regcomp.o regexec.o
97 obj3 = stab.o str.o toke.o util.o
99 obj = $(obj1) $(obj2) $(obj3)
101 tobj1 = tarray.o tcmd.o tcons.o tconsarg.o tdoarg.o tdoio.o tdolist.o tdump.o
102 tobj2 = teval.o tform.o thash.o $(mallocobj) tregcomp.o tregexec.o
103 tobj3 = tstab.o tstr.o ttoke.o tutil.o
105 tobj = $(tobj1) $(tobj2) $(tobj3)
109 addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
115 $(CC) -c $(CFLAGS) $(LARGE) $*.c
117 all: $(public) $(private) $(util) perl.man
121 # This is the standard version that contains no "taint" checks and is
122 # used for all scripts that aren't set-id or running under something set-id.
125 $(CC) $(LARGE) $(LDFLAGS) $(obj) perl.o $(libs) -o perl
127 # This version, if specified in Configure, does ONLY those scripts which need
128 # set-id emulation. Suidperl must be setuid root. It contains the "taint"
129 # checks as well as the special code to validate that the script in question
130 # has been invoked correctly.
132 suidperl: tperl.o sperly.o $(tobj)
133 $(CC) $(LARGE) $(LDFLAGS) sperly.o $(tobj) tperl.o $(libs) -o suidperl
135 # This version interprets scripts that are already set-id either via a wrapper
136 # or through the kernel allowing set-id scripts (bad idea). Taintperl must
137 # NOT be setuid to root or anything else. The only difference between it
138 # and normal perl is the presence of the "taint" checks.
140 taintperl: tperl.o tperly.o $(tobj)
141 $(CC) $(LARGE) $(LDFLAGS) tperly.o $(tobj) tperl.o $(libs) -o taintperl
143 # Replicating all this junk is yucky, but I don't see a portable way to fix it.
145 tperl.o: perl.c perly.h $(h)
147 $(SLN) perl.c tperl.c
148 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tperl.c
151 tperly.o: perly.c perly.h $(h)
153 $(SLN) perly.c tperly.c
154 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tperly.c
157 sperly.o: perly.c perly.h patchlevel.h $(h)
159 $(SLN) perly.c sperly.c
160 $(CC) -c -DTAINT -DIAMSUID $(CFLAGS) $(LARGE) sperly.c
163 tarray.o: array.c $(h)
165 $(SLN) array.c tarray.c
166 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tarray.c
172 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tcmd.c
175 tcons.o: cons.c $(h) perly.h
177 $(SLN) cons.c tcons.c
178 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tcons.c
181 tconsarg.o: consarg.c $(h)
182 /bin/rm -f tconsarg.c
183 $(SLN) consarg.c tconsarg.c
184 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tconsarg.c
185 /bin/rm -f tconsarg.c
187 tdoarg.o: doarg.c $(h)
189 $(SLN) doarg.c tdoarg.c
190 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdoarg.c
195 $(SLN) doio.c tdoio.c
196 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdoio.c
199 tdolist.o: dolist.c $(h)
201 $(SLN) dolist.c tdolist.c
202 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdolist.c
207 $(SLN) dump.c tdump.c
208 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdump.c
213 $(SLN) eval.c teval.c
214 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) teval.c
219 $(SLN) form.c tform.c
220 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tform.c
225 $(SLN) hash.c thash.c
226 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) thash.c
229 tregcomp.o: regcomp.c $(h)
230 /bin/rm -f tregcomp.c
231 $(SLN) regcomp.c tregcomp.c
232 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tregcomp.c
233 /bin/rm -f tregcomp.c
235 tregexec.o: regexec.c $(h)
236 /bin/rm -f tregexec.c
237 $(SLN) regexec.c tregexec.c
238 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tregexec.c
239 /bin/rm -f tregexec.c
243 $(SLN) stab.c tstab.c
244 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tstab.c
247 tstr.o: str.c $(h) perly.h
250 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tstr.c
253 ttoke.o: toke.c $(h) perly.h
255 $(SLN) toke.c ttoke.c
256 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) ttoke.c
261 $(SLN) util.c tutil.c
262 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tutil.c
266 @ echo Dummy dependency for dumb parallel make
270 @ echo Expect 25 shift/reduce errors...
274 echo 'extern YYSTYPE yylval;' >>perly.h
276 perl.o: perl.c perly.h $(h)
277 $(CC) -c $(CFLAGS) $(LARGE) perl.c
279 perl.man: perl.man.1 perl.man.2 perl.man.3 perl.man.4 patchlevel.h perl
280 ./perl -e '($$r,$$p)=$$]=~/(\d+\.\d+).*\n\D*(\d+)/;' \
281 -e 'print ".ds RP Release $$r Patchlevel $$p\n";' >perl.man
282 cat perl.man.[1-4] >>perl.man
285 # won't work with csh
286 export PATH || exit 1
287 - rm -f $(bin)/perl.old $(bin)/suidperl $(bin)/taintperl
288 - mv $(bin)/perl $(bin)/perl.old 2>/dev/null
289 - if test `pwd` != $(bin); then cp $(public) $(bin); fi
291 for pub in $(public); do \
292 chmod +x `basename $$pub`; \
294 - chmod 755 $(bin)/taintperl 2>/dev/null
299 cat >>Makefile <<'!NO!SUBS!'
300 - chmod 4711 $(bin)/suidperl 2>/dev/null
305 cat >>Makefile <<'!NO!SUBS!'
306 - test $(bin) = /usr/bin || rm -f /usr/bin/perl
307 - test $(bin) = /usr/bin || $(SLN) $(bin)/perl /usr/bin || cp $(bin)/perl /usr/bin
308 - sh ./makedir $(privlib)
310 if test `pwd` != $(privlib); then \
311 cp $(private) lib/*.pl $(privlib); \
314 #for priv in $(private); do \
315 #chmod +x `basename $$priv`; \
317 - if test `pwd` != $(mansrc); then \
318 for page in $(manpages); do \
319 cp $$page $(mansrc)/`basename $$page .man`.$(manext); \
322 cd x2p; $(MAKE) install
325 rm -f *.o all perl taintperl suidperl perl.man
326 cd x2p; $(MAKE) clean
329 cd x2p; $(MAKE) realclean
330 rm -f perl *.orig */*.orig *~ */*~ *.o core $(addedbyconf) perl.man
331 rm -f perl.c perly.h t/perl Makefile config.h makedepend makedir
334 # The following lint has practically everything turned on. Unfortunately,
335 # you have to wade through a lot of mumbo jumbo that can't be suppressed.
336 # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
340 lint $(lintflags) $(defs) perl.c $(c) > perl.fuzz
343 - test -f perly.h || cp /dev/null perly.h
345 - test -s perly.h || /bin/rm -f perly.h
346 cd x2p; $(MAKE) depend
349 - chmod +x t/TEST t/base.* t/comp.* t/cmd.* t/io.* t/op.*; \
350 cd t && (rm -f perl; $(SLN) ../perl .) && ./perl TEST
353 echo $(c) | tr ' ' '\012' >.clist
356 echo $(h) | tr ' ' '\012' >.hlist
359 echo $(sh) | tr ' ' '\012' >.shlist
361 # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
363 @ echo "You haven't done a "'"make depend" yet!'; exit 1
364 makedepend: makedepend.SH
365 /bin/sh makedepend.SH
371 ln Makefile ../Makefile