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.6 90/03/27 15:27:15 lwall Locked $
30 # $Log: Makefile.SH,v $
31 # Revision 3.0.1.6 90/03/27 15:27:15 lwall
32 # patch16: MSDOS support
34 # Revision 3.0.1.5 90/03/12 16:15:17 lwall
35 # patch13: some dependencies missing on perly.h
36 # patch13: some relief for buggy parallel makes
37 # patch13: bison doesn't declare extern YYSTYPE yylval;
39 # Revision 3.0.1.4 90/02/28 16:19:43 lwall
40 # patch9: extraneous $ on suidperl in Makefile
42 # Revision 3.0.1.3 89/12/21 19:09:26 lwall
43 # patch7: Configure now lets you pick between yacc or bison
45 # Revision 3.0.1.2 89/11/11 04:07:30 lwall
46 # patch2: $sockethdr incorporated into $ccflags
47 # patch2: $libs now has most of the -l libraries
49 # Revision 3.0.1.1 89/10/26 23:00:38 lwall
50 # patch1: Makefile.SH needed some more .h dependecies
52 # Revision 3.0 89/10/18 15:06:43 lwall
62 CFLAGS = $ccflags $optimize
66 mallocsrc = $mallocsrc
67 mallocobj = $mallocobj
72 public = perl taintperl $suidperl
76 cat >>Makefile <<'!NO!SUBS!'
85 sh = Makefile.SH makedepend.SH
87 h1 = EXTERN.h INTERN.h arg.h array.h cmd.h config.h form.h handy.h
88 h2 = hash.h perl.h regcomp.h regexp.h spat.h stab.h str.h util.h
92 c1 = array.c cmd.c cons.c consarg.c doarg.c doio.c dolist.c dump.c
93 c2 = eval.c form.c hash.c $(mallocsrc) perly.c regcomp.c regexec.c
94 c3 = stab.c str.c toke.c util.c
98 obj1 = array.o cmd.o cons.o consarg.o doarg.o doio.o dolist.o dump.o
99 obj2 = eval.o form.o hash.o $(mallocobj) perly.o regcomp.o regexec.o
100 obj3 = stab.o str.o toke.o util.o
102 obj = $(obj1) $(obj2) $(obj3)
104 tobj1 = tarray.o tcmd.o tcons.o tconsarg.o tdoarg.o tdoio.o tdolist.o tdump.o
105 tobj2 = teval.o tform.o thash.o $(mallocobj) tregcomp.o tregexec.o
106 tobj3 = tstab.o tstr.o ttoke.o tutil.o
108 tobj = $(tobj1) $(tobj2) $(tobj3)
112 addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
118 $(CC) -c $(CFLAGS) $(LARGE) $*.c
120 all: $(public) $(private) $(util) perl.man
124 # This is the standard version that contains no "taint" checks and is
125 # used for all scripts that aren't set-id or running under something set-id.
128 $(CC) $(LARGE) $(LDFLAGS) $(obj) perl.o $(libs) -o perl
130 # This version, if specified in Configure, does ONLY those scripts which need
131 # set-id emulation. Suidperl must be setuid root. It contains the "taint"
132 # checks as well as the special code to validate that the script in question
133 # has been invoked correctly.
135 suidperl: tperl.o sperly.o $(tobj)
136 $(CC) $(LARGE) $(LDFLAGS) sperly.o $(tobj) tperl.o $(libs) -o suidperl
138 # This version interprets scripts that are already set-id either via a wrapper
139 # or through the kernel allowing set-id scripts (bad idea). Taintperl must
140 # NOT be setuid to root or anything else. The only difference between it
141 # and normal perl is the presence of the "taint" checks.
143 taintperl: tperl.o tperly.o $(tobj)
144 $(CC) $(LARGE) $(LDFLAGS) tperly.o $(tobj) tperl.o $(libs) -o taintperl
146 # Replicating all this junk is yucky, but I don't see a portable way to fix it.
148 tperl.o: perl.c perly.h $(h)
150 $(SLN) perl.c tperl.c
151 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tperl.c
154 tperly.o: perly.c perly.h $(h)
156 $(SLN) perly.c tperly.c
157 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tperly.c
160 sperly.o: perly.c perly.h patchlevel.h $(h)
162 $(SLN) perly.c sperly.c
163 $(CC) -c -DTAINT -DIAMSUID $(CFLAGS) $(LARGE) sperly.c
166 tarray.o: array.c $(h)
168 $(SLN) array.c tarray.c
169 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tarray.c
175 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tcmd.c
178 tcons.o: cons.c $(h) perly.h
180 $(SLN) cons.c tcons.c
181 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tcons.c
184 tconsarg.o: consarg.c $(h)
185 /bin/rm -f tconsarg.c
186 $(SLN) consarg.c tconsarg.c
187 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tconsarg.c
188 /bin/rm -f tconsarg.c
190 tdoarg.o: doarg.c $(h)
192 $(SLN) doarg.c tdoarg.c
193 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdoarg.c
198 $(SLN) doio.c tdoio.c
199 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdoio.c
202 tdolist.o: dolist.c $(h)
204 $(SLN) dolist.c tdolist.c
205 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdolist.c
210 $(SLN) dump.c tdump.c
211 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdump.c
216 $(SLN) eval.c teval.c
217 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) teval.c
222 $(SLN) form.c tform.c
223 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tform.c
228 $(SLN) hash.c thash.c
229 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) thash.c
232 tregcomp.o: regcomp.c $(h)
233 /bin/rm -f tregcomp.c
234 $(SLN) regcomp.c tregcomp.c
235 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tregcomp.c
236 /bin/rm -f tregcomp.c
238 tregexec.o: regexec.c $(h)
239 /bin/rm -f tregexec.c
240 $(SLN) regexec.c tregexec.c
241 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tregexec.c
242 /bin/rm -f tregexec.c
246 $(SLN) stab.c tstab.c
247 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tstab.c
250 tstr.o: str.c $(h) perly.h
253 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tstr.c
256 ttoke.o: toke.c $(h) perly.h
258 $(SLN) toke.c ttoke.c
259 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) ttoke.c
264 $(SLN) util.c tutil.c
265 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tutil.c
269 @ echo Dummy dependency for dumb parallel make
273 @ echo Expect 25 shift/reduce errors...
277 echo 'extern YYSTYPE yylval;' >>perly.h
279 perl.o: perl.c perly.h $(h)
280 $(CC) -c $(CFLAGS) $(LARGE) perl.c
282 perl.man: perl_man.1 perl_man.2 perl_man.3 perl_man.4 patchlevel.h perl
283 ./perl -e '($$r,$$p)=$$]=~/(\d+\.\d+).*\n\D*(\d+)/;' \
284 -e 'print ".ds RP Release $$r Patchlevel $$p\n";' >perl.man
285 cat perl_man.[1-4] >>perl.man
288 # won't work with csh
289 export PATH || exit 1
290 - rm -f $(bin)/perl.old $(bin)/suidperl $(bin)/taintperl
291 - mv $(bin)/perl $(bin)/perl.old 2>/dev/null
292 - if test `pwd` != $(bin); then cp $(public) $(bin); fi
294 for pub in $(public); do \
295 chmod +x `basename $$pub`; \
297 - chmod 755 $(bin)/taintperl 2>/dev/null
302 cat >>Makefile <<'!NO!SUBS!'
303 - chmod 4711 $(bin)/suidperl 2>/dev/null
308 cat >>Makefile <<'!NO!SUBS!'
309 - test $(bin) = /usr/bin || rm -f /usr/bin/perl
310 - test $(bin) = /usr/bin || $(SLN) $(bin)/perl /usr/bin || cp $(bin)/perl /usr/bin
311 - sh ./makedir $(privlib)
313 if test `pwd` != $(privlib); then \
314 cp $(private) lib/*.pl $(privlib); \
317 #for priv in $(private); do \
318 #chmod +x `basename $$priv`; \
320 - if test `pwd` != $(mansrc); then \
321 for page in $(manpages); do \
322 cp $$page $(mansrc)/`basename $$page .man`.$(manext); \
325 cd x2p; $(MAKE) install
328 rm -f *.o all perl taintperl suidperl perl.man
329 cd x2p; $(MAKE) clean
332 cd x2p; $(MAKE) realclean
333 rm -f perl *.orig */*.orig *~ */*~ *.o core $(addedbyconf) perl.man
334 rm -f perl.c perly.h t/perl Makefile config.h makedepend makedir
337 # The following lint has practically everything turned on. Unfortunately,
338 # you have to wade through a lot of mumbo jumbo that can't be suppressed.
339 # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
343 lint $(lintflags) $(defs) perl.c $(c) > perl.fuzz
346 - test -f perly.h || cp /dev/null perly.h
348 - test -s perly.h || /bin/rm -f perly.h
349 cd x2p; $(MAKE) depend
352 - chmod +x t/TEST t/base.* t/comp.* t/cmd.* t/io.* t/op.*; \
353 cd t && (rm -f perl; $(SLN) ../perl .) && ./perl TEST
356 echo $(c) | tr ' ' '\012' >.clist
359 echo $(h) | tr ' ' '\012' >.hlist
362 echo $(sh) | tr ' ' '\012' >.shlist
364 # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
366 @ echo "You haven't done a "'"make depend" yet!'; exit 1
367 makedepend: makedepend.SH
368 /bin/sh makedepend.SH
374 ln Makefile ../Makefile