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 # $RCSfile: Makefile.SH,v $$Revision: 4.0.1.2 $$Date: 91/06/07 10:14:43 $
30 # $Log: Makefile.SH,v $
31 # Revision 4.0.1.2 91/06/07 10:14:43 lwall
32 # patch4: cflags now emits entire cc command except for the filename
33 # patch4: alternate make programs are now semi-supported
34 # patch4: uperl.o no longer tries to link in libraries prematurely
35 # patch4: installperl now installs x2p stuff too
37 # Revision 4.0.1.1 91/04/11 17:30:39 lwall
38 # patch1: C flags are now settable on a per-file basis
40 # Revision 4.0 91/03/20 00:58:54 lwall
48 scriptdir = $scriptdir
49 privlib = $installprivlib
56 mallocsrc = $mallocsrc
57 mallocobj = $mallocobj
60 libs = $libs $cryptlib
62 public = perl taintperl $suidperl
64 # To use an alternate make, set $altmake in config.sh.
65 MAKE = ${altmake-make}
69 cat >>Makefile <<'!NO!SUBS!'
71 CCCMD = `sh cflags $@`
77 manpages = perl.man h2ph.man
81 sh = Makefile.SH makedepend.SH h2ph.SH
83 h1 = EXTERN.h INTERN.h arg.h array.h cmd.h config.h form.h handy.h
84 h2 = hash.h perl.h regcomp.h regexp.h spat.h stab.h str.h util.h
88 c1 = array.c cmd.c cons.c consarg.c doarg.c doio.c dolist.c dump.c
89 c2 = eval.c form.c hash.c $(mallocsrc) perl.c regcomp.c regexec.c
90 c3 = stab.c str.c toke.c util.c usersub.c
94 obj1 = array.o cmd.o cons.o consarg.o doarg.o doio.o dolist.o dump.o
95 obj2 = eval.o form.o hash.o $(mallocobj) perl.o regcomp.o regexec.o
96 obj3 = stab.o str.o toke.o util.o
98 obj = $(obj1) $(obj2) $(obj3)
100 tobj1 = tarray.o tcmd.o tcons.o tconsarg.o tdoarg.o tdoio.o tdolist.o tdump.o
101 tobj2 = teval.o tform.o thash.o $(mallocobj) tregcomp.o tregexec.o
102 tobj3 = tstab.o tstr.o ttoke.o tutil.o
104 tobj = $(tobj1) $(tobj2) $(tobj3)
108 addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
116 all: $(public) $(private) $(util) uperl.o $(scripts)
120 # This is the standard version that contains no "taint" checks and is
121 # used for all scripts that aren't set-id or running under something set-id.
122 # The $& notation is tells Sequent machines that it can do a parallel make,
123 # and is harmless otherwise.
125 perl: $& perly.o $(obj) usersub.o
126 $(CC) $(LARGE) $(CLDFLAGS) $(obj) perly.o usersub.o $(libs) -o perl
128 uperl.o: $& perly.o $(obj)
129 -ld $(LARGE) $(LDFLAGS) -r $(obj) perly.o -o uperl.o
134 # This version, if specified in Configure, does ONLY those scripts which need
135 # set-id emulation. Suidperl must be setuid root. It contains the "taint"
136 # checks as well as the special code to validate that the script in question
137 # has been invoked correctly.
139 suidperl: $& tperly.o sperl.o $(tobj) usersub.o
140 $(CC) $(LARGE) $(CLDFLAGS) sperl.o $(tobj) tperly.o usersub.o $(libs) \
143 # This version interprets scripts that are already set-id either via a wrapper
144 # or through the kernel allowing set-id scripts (bad idea). Taintperl must
145 # NOT be setuid to root or anything else. The only difference between it
146 # and normal perl is the presence of the "taint" checks.
148 taintperl: $& tperly.o tperl.o $(tobj) usersub.o
149 $(CC) $(LARGE) $(CLDFLAGS) tperl.o $(tobj) tperly.o usersub.o $(libs) \
152 # Replicating all this junk is yucky, but I don't see a portable way to fix it.
154 tperly.o: perly.c perly.h $(h)
156 $(SLN) perly.c tperly.c
157 $(CCCMD) -DTAINT tperly.c
160 tperl.o: perl.c perly.h patchlevel.h perl.h $(h)
162 $(SLN) perl.c tperl.c
163 $(CCCMD) -DTAINT tperl.c
166 sperl.o: perl.c perly.h patchlevel.h $(h)
168 $(SLN) perl.c sperl.c
169 $(CCCMD) -DTAINT -DIAMSUID sperl.c
172 tarray.o: array.c $(h)
174 $(SLN) array.c tarray.c
175 $(CCCMD) -DTAINT tarray.c
181 $(CCCMD) -DTAINT tcmd.c
184 tcons.o: cons.c $(h) perly.h
186 $(SLN) cons.c tcons.c
187 $(CCCMD) -DTAINT tcons.c
190 tconsarg.o: consarg.c $(h)
191 /bin/rm -f tconsarg.c
192 $(SLN) consarg.c tconsarg.c
193 $(CCCMD) -DTAINT tconsarg.c
194 /bin/rm -f tconsarg.c
196 tdoarg.o: doarg.c $(h)
198 $(SLN) doarg.c tdoarg.c
199 $(CCCMD) -DTAINT tdoarg.c
204 $(SLN) doio.c tdoio.c
205 $(CCCMD) -DTAINT tdoio.c
208 tdolist.o: dolist.c $(h)
210 $(SLN) dolist.c tdolist.c
211 $(CCCMD) -DTAINT tdolist.c
216 $(SLN) dump.c tdump.c
217 $(CCCMD) -DTAINT tdump.c
222 $(SLN) eval.c teval.c
223 $(CCCMD) -DTAINT teval.c
228 $(SLN) form.c tform.c
229 $(CCCMD) -DTAINT tform.c
234 $(SLN) hash.c thash.c
235 $(CCCMD) -DTAINT thash.c
238 tregcomp.o: regcomp.c $(h)
239 /bin/rm -f tregcomp.c
240 $(SLN) regcomp.c tregcomp.c
241 $(CCCMD) -DTAINT tregcomp.c
242 /bin/rm -f tregcomp.c
244 tregexec.o: regexec.c $(h)
245 /bin/rm -f tregexec.c
246 $(SLN) regexec.c tregexec.c
247 $(CCCMD) -DTAINT tregexec.c
248 /bin/rm -f tregexec.c
252 $(SLN) stab.c tstab.c
253 $(CCCMD) -DTAINT tstab.c
256 tstr.o: str.c $(h) perly.h
259 $(CCCMD) -DTAINT tstr.c
262 ttoke.o: toke.c $(h) perly.h
264 $(SLN) toke.c ttoke.c
265 $(CCCMD) -DTAINT ttoke.c
270 $(SLN) util.c tutil.c
271 $(CCCMD) -DTAINT tutil.c
275 @ echo Dummy dependency for dumb parallel make
278 perly.c: perly.y perly.fixer
279 @ echo 'Expect either' 29 shift/reduce and 59 reduce/reduce conflicts...
280 @ echo ' or' 27 shift/reduce and 61 reduce/reduce conflicts...
282 sh ./perly.fixer y.tab.c perly.c
284 echo 'extern YYSTYPE yylval;' >>perly.h
286 perly.o: perly.c perly.h $(h)
293 rm -f *.o all perl taintperl suidperl
294 cd x2p; $(MAKE) clean
297 cd x2p; $(MAKE) realclean
298 rm -f *.orig */*.orig *~ */*~ core $(addedbyconf) h2ph h2ph.man
299 rm -f perly.c perly.h t/perl Makefile config.h makedepend makedir
300 rm -f makefile x2p/Makefile x2p/makefile cflags x2p/cflags
302 # The following lint has practically everything turned on. Unfortunately,
303 # you have to wade through a lot of mumbo jumbo that can't be suppressed.
304 # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
308 lint $(lintflags) $(defs) perly.c $(c) > perl.fuzz
311 - test -f perly.h || cp /dev/null perly.h
313 - test -s perly.h || /bin/rm -f perly.h
314 cd x2p; $(MAKE) depend
317 - cd t && chmod +x TEST */*.t
318 - cd t && (rm -f perl; $(SLN) ../perl .) && ./perl TEST </dev/tty
321 echo $(c) | tr ' ' '\012' >.clist
324 echo $(h) | tr ' ' '\012' >.hlist
327 echo $(sh) | tr ' ' '\012' >.shlist
329 # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
331 @ echo "You haven't done a "'"make depend" yet!'; exit 1
332 makedepend: makedepend.SH
333 /bin/sh makedepend.SH
339 ln Makefile ../Makefile