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.4 90/02/28 16:19:43 lwall Locked $
30 # $Log: Makefile.SH,v $
31 # Revision 3.0.1.4 90/02/28 16:19:43 lwall
32 # patch9: extraneous $ on suidperl in Makefile
34 # Revision 3.0.1.3 89/12/21 19:09:26 lwall
35 # patch7: Configure now lets you pick between yacc or bison
37 # Revision 3.0.1.2 89/11/11 04:07:30 lwall
38 # patch2: $sockethdr incorporated into $ccflags
39 # patch2: $libs now has most of the -l libraries
41 # Revision 3.0.1.1 89/10/26 23:00:38 lwall
42 # patch1: Makefile.SH needed some more .h dependecies
44 # Revision 3.0 89/10/18 15:06:43 lwall
54 CFLAGS = $ccflags $optimize
58 mallocsrc = $mallocsrc
59 mallocobj = $mallocobj
64 public = perl taintperl $suidperl
68 cat >>Makefile <<'!NO!SUBS!'
77 sh = Makefile.SH makedepend.SH
79 h1 = EXTERN.h INTERN.h arg.h array.h cmd.h config.h form.h handy.h
80 h2 = hash.h perl.h regcomp.h regexp.h spat.h stab.h str.h util.h
84 c1 = array.c cmd.c cons.c consarg.c doarg.c doio.c dolist.c dump.c
85 c2 = eval.c form.c hash.c $(mallocsrc) perly.c regcomp.c regexec.c
86 c3 = stab.c str.c toke.c util.c
90 obj1 = array.o cmd.o cons.o consarg.o doarg.o doio.o dolist.o dump.o
91 obj2 = eval.o form.o hash.o $(mallocobj) perly.o regcomp.o regexec.o
92 obj3 = stab.o str.o toke.o util.o
94 obj = $(obj1) $(obj2) $(obj3)
96 tobj1 = tarray.o tcmd.o tcons.o tconsarg.o tdoarg.o tdoio.o tdolist.o tdump.o
97 tobj2 = teval.o tform.o thash.o $(mallocobj) tregcomp.o tregexec.o
98 tobj3 = tstab.o tstr.o ttoke.o tutil.o
100 tobj = $(tobj1) $(tobj2) $(tobj3)
104 addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
110 $(CC) -c $(CFLAGS) $(LARGE) $*.c
112 all: $(public) $(private) $(util) perl.man
116 # This is the standard version that contains no "taint" checks and is
117 # used for all scripts that aren't set-id or running under something set-id.
120 $(CC) $(LARGE) $(LDFLAGS) $(obj) perl.o $(libs) -o perl
122 # This version, if specified in Configure, does ONLY those scripts which need
123 # set-id emulation. Suidperl must be setuid root. It contains the "taint"
124 # checks as well as the special code to validate that the script in question
125 # has been invoked correctly.
127 suidperl: tperl.o sperly.o $(tobj)
128 $(CC) $(LARGE) $(LDFLAGS) sperly.o $(tobj) tperl.o $(libs) -o suidperl
130 # This version interprets scripts that are already set-id either via a wrapper
131 # or through the kernel allowing set-id scripts (bad idea). Taintperl must
132 # NOT be setuid to root or anything else. The only difference between it
133 # and normal perl is the presence of the "taint" checks.
135 taintperl: tperl.o tperly.o $(tobj)
136 $(CC) $(LARGE) $(LDFLAGS) tperly.o $(tobj) tperl.o $(libs) -o taintperl
138 # Replicating all this junk is yucky, but I don't see a portable way to fix it.
140 tperl.o: perl.c perly.h $(h)
142 $(SLN) perl.c tperl.c
143 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tperl.c
146 tperly.o: perly.c perly.h $(h)
148 $(SLN) perly.c tperly.c
149 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tperly.c
152 sperly.o: perly.c perly.h patchlevel.h $(h)
154 $(SLN) perly.c sperly.c
155 $(CC) -c -DTAINT -DIAMSUID $(CFLAGS) $(LARGE) sperly.c
158 tarray.o: array.c $(h)
160 $(SLN) array.c tarray.c
161 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tarray.c
167 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tcmd.c
172 $(SLN) cons.c tcons.c
173 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tcons.c
176 tconsarg.o: consarg.c $(h)
177 /bin/rm -f tconsarg.c
178 $(SLN) consarg.c tconsarg.c
179 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tconsarg.c
180 /bin/rm -f tconsarg.c
182 tdoarg.o: doarg.c $(h)
184 $(SLN) doarg.c tdoarg.c
185 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdoarg.c
190 $(SLN) doio.c tdoio.c
191 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdoio.c
194 tdolist.o: dolist.c $(h)
196 $(SLN) dolist.c tdolist.c
197 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdolist.c
202 $(SLN) dump.c tdump.c
203 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdump.c
208 $(SLN) eval.c teval.c
209 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) teval.c
214 $(SLN) form.c tform.c
215 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tform.c
220 $(SLN) hash.c thash.c
221 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) thash.c
224 tregcomp.o: regcomp.c $(h)
225 /bin/rm -f tregcomp.c
226 $(SLN) regcomp.c tregcomp.c
227 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tregcomp.c
228 /bin/rm -f tregcomp.c
230 tregexec.o: regexec.c $(h)
231 /bin/rm -f tregexec.c
232 $(SLN) regexec.c tregexec.c
233 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tregexec.c
234 /bin/rm -f tregexec.c
238 $(SLN) stab.c tstab.c
239 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tstab.c
245 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tstr.c
250 $(SLN) toke.c ttoke.c
251 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) ttoke.c
256 $(SLN) util.c tutil.c
257 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tutil.c
260 perl.c perly.h: perl.y
261 @ echo Expect 25 shift/reduce errors...
266 perl.o: perl.c perly.h $(h)
267 $(CC) -c $(CFLAGS) $(LARGE) perl.c
269 perl.man: perl.man.1 perl.man.2 perl.man.3 perl.man.4 patchlevel.h perl
270 ./perl -e '($$r,$$p)=$$]=~/(\d+\.\d+).*\n\D*(\d+)/;' \
271 -e 'print ".ds RP Release $$r Patchlevel $$p\n";' >perl.man
272 cat perl.man.[1-4] >>perl.man
275 # won't work with csh
276 export PATH || exit 1
277 - rm -f $(bin)/perl.old $(bin)/suidperl $(bin)/taintperl
278 - mv $(bin)/perl $(bin)/perl.old 2>/dev/null
279 - if test `pwd` != $(bin); then cp $(public) $(bin); fi
281 for pub in $(public); do \
282 chmod +x `basename $$pub`; \
284 - chmod 755 $(bin)/taintperl 2>/dev/null
289 cat >>Makefile <<'!NO!SUBS!'
290 - chmod 4711 $(bin)/suidperl 2>/dev/null
295 cat >>Makefile <<'!NO!SUBS!'
296 - test $(bin) = /usr/bin || rm -f /usr/bin/perl
297 - test $(bin) = /usr/bin || $(SLN) $(bin)/perl /usr/bin || cp $(bin)/perl /usr/bin
298 - sh ./makedir $(privlib)
300 if test `pwd` != $(privlib); then \
301 cp $(private) lib/*.pl $(privlib); \
304 #for priv in $(private); do \
305 #chmod +x `basename $$priv`; \
307 - if test `pwd` != $(mansrc); then \
308 for page in $(manpages); do \
309 cp $$page $(mansrc)/`basename $$page .man`.$(manext); \
312 cd x2p; $(MAKE) install
315 rm -f *.o all perl taintperl suidperl perl.man
316 cd x2p; $(MAKE) clean
319 cd x2p; $(MAKE) realclean
320 rm -f perl *.orig */*.orig *~ */*~ *.o core $(addedbyconf) perl.man
321 rm -f perl.c perly.h t/perl Makefile config.h makedepend makedir
324 # The following lint has practically everything turned on. Unfortunately,
325 # you have to wade through a lot of mumbo jumbo that can't be suppressed.
326 # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
330 lint $(lintflags) $(defs) perl.c $(c) > perl.fuzz
333 - test -f perly.h || cp /dev/null perly.h
335 - test -s perly.h || /bin/rm -f perly.h
336 cd x2p; $(MAKE) depend
339 - chmod +x t/TEST t/base.* t/comp.* t/cmd.* t/io.* t/op.*; \
340 cd t && (rm -f perl; $(SLN) ../perl .) && ./perl TEST
343 echo $(c) | tr ' ' '\012' >.clist
346 echo $(h) | tr ' ' '\012' >.hlist
349 echo $(sh) | tr ' ' '\012' >.shlist
351 # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
353 @ echo "You haven't done a "'"make depend" yet!'; exit 1
354 makedepend: makedepend.SH
355 /bin/sh makedepend.SH
361 ln Makefile ../Makefile