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 4.0 91/03/20 00:58:54 lwall Locked $
30 # $Log: Makefile.SH,v $
31 # Revision 4.0 91/03/20 00:58:54 lwall
39 scriptdir = $scriptdir
40 privlib = $installprivlib
43 CFLAGS = $ccflags $optimize
48 mallocsrc = $mallocsrc
49 mallocobj = $mallocobj
52 libs = $libs $cryptlib
54 public = perl taintperl $suidperl
58 cat >>Makefile <<'!NO!SUBS!'
65 manpages = perl.man h2ph.man
69 sh = Makefile.SH makedepend.SH h2ph.SH
71 h1 = EXTERN.h INTERN.h arg.h array.h cmd.h config.h form.h handy.h
72 h2 = hash.h perl.h regcomp.h regexp.h spat.h stab.h str.h util.h
76 c1 = array.c cmd.c cons.c consarg.c doarg.c doio.c dolist.c dump.c
77 c2 = eval.c form.c hash.c $(mallocsrc) perl.c regcomp.c regexec.c
78 c3 = stab.c str.c toke.c util.c usersub.c
82 obj1 = array.o cmd.o cons.o consarg.o doarg.o doio.o dolist.o dump.o
83 obj2 = eval.o form.o hash.o $(mallocobj) perl.o regcomp.o regexec.o
84 obj3 = stab.o str.o toke.o util.o
86 obj = $(obj1) $(obj2) $(obj3)
88 tobj1 = tarray.o tcmd.o tcons.o tconsarg.o tdoarg.o tdoio.o tdolist.o tdump.o
89 tobj2 = teval.o tform.o thash.o $(mallocobj) tregcomp.o tregexec.o
90 tobj3 = tstab.o tstr.o ttoke.o tutil.o
92 tobj = $(tobj1) $(tobj2) $(tobj3)
96 addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
102 $(CC) -c $(CFLAGS) $(LARGE) $*.c
104 all: $(public) $(private) $(util) uperl.o $(scripts)
108 # This is the standard version that contains no "taint" checks and is
109 # used for all scripts that aren't set-id or running under something set-id.
111 perl: $& perly.o $(obj) usersub.o
112 $(CC) $(LARGE) $(CLDFLAGS) $(obj) perly.o usersub.o $(libs) -o perl
114 uperl.o: $& perly.o $(obj)
115 -ld $(LARGE) $(LDFLAGS) -r $(obj) perly.o $(libs) -o uperl.o
120 # This version, if specified in Configure, does ONLY those scripts which need
121 # set-id emulation. Suidperl must be setuid root. It contains the "taint"
122 # checks as well as the special code to validate that the script in question
123 # has been invoked correctly.
125 suidperl: $& tperly.o sperl.o $(tobj) usersub.o
126 $(CC) $(LARGE) $(CLDFLAGS) sperl.o $(tobj) tperly.o usersub.o $(libs) \
129 # This version interprets scripts that are already set-id either via a wrapper
130 # or through the kernel allowing set-id scripts (bad idea). Taintperl must
131 # NOT be setuid to root or anything else. The only difference between it
132 # and normal perl is the presence of the "taint" checks.
134 taintperl: $& tperly.o tperl.o $(tobj) usersub.o
135 $(CC) $(LARGE) $(CLDFLAGS) tperl.o $(tobj) tperly.o usersub.o $(libs) \
138 # Replicating all this junk is yucky, but I don't see a portable way to fix it.
140 tperly.o: perly.c perly.h $(h)
142 $(SLN) perly.c tperly.c
143 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tperly.c
146 tperl.o: perl.c perly.h patchlevel.h perl.h $(h)
148 $(SLN) perl.c tperl.c
149 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tperl.c
152 sperl.o: perl.c perly.h patchlevel.h $(h)
154 $(SLN) perl.c sperl.c
155 $(CC) -c -DTAINT -DIAMSUID $(CFLAGS) $(LARGE) sperl.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
170 tcons.o: cons.c $(h) perly.h
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
242 tstr.o: str.c $(h) perly.h
245 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tstr.c
248 ttoke.o: toke.c $(h) perly.h
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
261 @ echo Dummy dependency for dumb parallel make
265 @ echo 'Expect either' 29 shift/reduce and 59 reduce/reduce conflicts...
266 @ echo ' or' 27 shift/reduce and 61 reduce/reduce conflicts...
268 sh perly.fixer y.tab.c perly.c
270 echo 'extern YYSTYPE yylval;' >>perly.h
272 perly.o: perly.c perly.h $(h)
273 $(CC) -c $(CFLAGS) $(LARGE) perly.c
277 cd x2p; $(MAKE) install
280 rm -f *.o all perl taintperl suidperl
281 cd x2p; $(MAKE) clean
284 cd x2p; $(MAKE) realclean
285 rm -f *.orig */*.orig *~ */*~ core $(addedbyconf) h2ph h2ph.man
286 rm -f perly.c perly.h t/perl Makefile config.h makedepend makedir
289 # The following lint has practically everything turned on. Unfortunately,
290 # you have to wade through a lot of mumbo jumbo that can't be suppressed.
291 # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
295 lint $(lintflags) $(defs) perly.c $(c) > perl.fuzz
298 - test -f perly.h || cp /dev/null perly.h
300 - test -s perly.h || /bin/rm -f perly.h
301 cd x2p; $(MAKE) depend
304 - cd t && chmod +x TEST */*.t
305 - cd t && (rm -f perl; $(SLN) ../perl .) && ./perl TEST </dev/tty
308 echo $(c) | tr ' ' '\012' >.clist
311 echo $(h) | tr ' ' '\012' >.hlist
314 echo $(sh) | tr ' ' '\012' >.shlist
316 # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
318 @ echo "You haven't done a "'"make depend" yet!'; exit 1
319 makedepend: makedepend.SH
320 /bin/sh makedepend.SH
326 ln Makefile ../Makefile