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)"
28 cat >Makefile <<!GROK!THIS!
29 # $RCSfile: Makefile.SH,v $$Revision: 4.0.1.4 $$Date: 92/06/08 11:40:43 $
31 # $Log: Makefile.SH,v $
32 # Revision 4.0.1.4 92/06/08 11:40:43 lwall
33 # patch20: cray didn't give enough memory to /bin/sh
34 # patch20: various and sundry fixes
36 # Revision 4.0.1.3 91/11/05 15:48:11 lwall
37 # patch11: saberized perl
38 # patch11: added support for dbz
40 # Revision 4.0.1.2 91/06/07 10:14:43 lwall
41 # patch4: cflags now emits entire cc command except for the filename
42 # patch4: alternate make programs are now semi-supported
43 # patch4: uperl.o no longer tries to link in libraries prematurely
44 # patch4: installperl now installs x2p stuff too
46 # Revision 4.0.1.1 91/04/11 17:30:39 lwall
47 # patch1: C flags are now settable on a per-file basis
49 # Revision 4.0 91/03/20 00:58:54 lwall
57 scriptdir = $scriptdir
58 privlib = $installprivlib
65 mallocsrc = $mallocsrc
66 mallocobj = $mallocobj
70 libs = $libs $cryptlib
72 public = perl taintperl $suidperl
74 shellflags = $shellflags
76 # To use an alternate make, set $altmake in config.sh.
77 MAKE = ${altmake-make}
81 cat >>Makefile <<'!NO!SUBS!'
83 CCCMD = `sh $(shellflags) cflags $@`
89 manpages = perl.man h2ph.man
93 sh = Makefile.SH makedepend.SH h2ph.SH
95 h1 = EXTERN.h INTERN.h arg.h array.h cmd.h config.h form.h handy.h
96 h2 = hash.h perl.h regcomp.h regexp.h spat.h stab.h str.h util.h
100 c1 = array.c cmd.c cons.c consarg.c doarg.c doio.c dolist.c dump.c
101 c2 = eval.c form.c hash.c $(mallocsrc) perl.c regcomp.c regexec.c
102 c3 = stab.c str.c toke.c util.c usersub.c
104 c = $(c1) $(c2) $(c3)
106 s1 = array.c cmd.c cons.c consarg.c doarg.c doio.c dolist.c dump.c
107 s2 = eval.c form.c hash.c perl.c regcomp.c regexec.c
108 s3 = stab.c str.c toke.c util.c usersub.c perly.c
110 saber = $(s1) $(s2) $(s3)
112 obj1 = array.o cmd.o cons.o consarg.o doarg.o doio.o dolist.o dump.o
113 obj2 = eval.o form.o $(mallocobj) perl.o regcomp.o regexec.o
114 obj3 = stab.o str.o toke.o util.o
116 obj = $(obj1) $(obj2) $(obj3)
118 tobj1 = tarray.o tcmd.o tcons.o tconsarg.o tdoarg.o tdoio.o tdolist.o tdump.o
119 tobj2 = teval.o tform.o thash.o $(mallocobj) tregcomp.o tregexec.o
120 tobj3 = tstab.o tstr.o ttoke.o tutil.o
122 tobj = $(tobj1) $(tobj2) $(tobj3)
126 addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
134 all: $(public) $(private) $(util) uperl.o $(scripts)
138 # This is the standard version that contains no "taint" checks and is
139 # used for all scripts that aren't set-id or running under something set-id.
140 # The $& notation is tells Sequent machines that it can do a parallel make,
141 # and is harmless otherwise.
143 perl: $& perly.o $(obj) hash.o usersub.o
144 $(CC) $(LARGE) $(CLDFLAGS) $(obj) hash.o perly.o usersub.o $(libs) -o perl
146 # This command assumes that /usr/include/dbz.h and /usr/lib/dbz.o exist.
148 dbzperl: $& perly.o $(obj) zhash.o usersub.o
149 $(CC) $(LARGE) $(CLDFLAGS) $(obj) zhash.o /usr/lib/dbz.o perly.o usersub.o $(libs) -o dbzperl
153 $(SLN) hash.c zhash.c
154 $(CCCMD) -DWANT_DBZ zhash.c
157 uperl.o: $& perly.o $(obj) hash.o
158 -ld $(LARGE) $(LDFLAGS) -r $(obj) hash.o perly.o -o uperl.o
164 # This version, if specified in Configure, does ONLY those scripts which need
165 # set-id emulation. Suidperl must be setuid root. It contains the "taint"
166 # checks as well as the special code to validate that the script in question
167 # has been invoked correctly.
169 suidperl: $& tperly.o sperl.o $(tobj) usersub.o
170 $(CC) $(LARGE) $(CLDFLAGS) sperl.o $(tobj) tperly.o usersub.o $(libs) \
173 # This version interprets scripts that are already set-id either via a wrapper
174 # or through the kernel allowing set-id scripts (bad idea). Taintperl must
175 # NOT be setuid to root or anything else. The only difference between it
176 # and normal perl is the presence of the "taint" checks.
178 taintperl: $& tperly.o tperl.o $(tobj) usersub.o
179 $(CC) $(LARGE) $(CLDFLAGS) tperl.o $(tobj) tperly.o usersub.o $(libs) \
182 # Replicating all this junk is yucky, but I don't see a portable way to fix it.
184 tperly.o: perly.c perly.h $(h)
186 $(SLN) perly.c tperly.c
187 $(CCCMD) -DTAINT tperly.c
190 tperl.o: perl.c perly.h patchlevel.h perl.h $(h)
192 $(SLN) perl.c tperl.c
193 $(CCCMD) -DTAINT tperl.c
196 sperl.o: perl.c perly.h patchlevel.h $(h)
198 $(SLN) perl.c sperl.c
199 $(CCCMD) -DTAINT -DIAMSUID sperl.c
202 tarray.o: array.c $(h)
204 $(SLN) array.c tarray.c
205 $(CCCMD) -DTAINT tarray.c
211 $(CCCMD) -DTAINT tcmd.c
214 tcons.o: cons.c $(h) perly.h
216 $(SLN) cons.c tcons.c
217 $(CCCMD) -DTAINT tcons.c
220 tconsarg.o: consarg.c $(h)
222 $(SLN) consarg.c tconsarg.c
223 $(CCCMD) -DTAINT tconsarg.c
226 tdoarg.o: doarg.c $(h)
228 $(SLN) doarg.c tdoarg.c
229 $(CCCMD) -DTAINT tdoarg.c
234 $(SLN) doio.c tdoio.c
235 $(CCCMD) -DTAINT tdoio.c
238 tdolist.o: dolist.c $(h)
240 $(SLN) dolist.c tdolist.c
241 $(CCCMD) -DTAINT tdolist.c
246 $(SLN) dump.c tdump.c
247 $(CCCMD) -DTAINT tdump.c
252 $(SLN) eval.c teval.c
253 $(CCCMD) -DTAINT teval.c
258 $(SLN) form.c tform.c
259 $(CCCMD) -DTAINT tform.c
264 $(SLN) hash.c thash.c
265 $(CCCMD) -DTAINT thash.c
268 tregcomp.o: regcomp.c $(h)
270 $(SLN) regcomp.c tregcomp.c
271 $(CCCMD) -DTAINT tregcomp.c
274 tregexec.o: regexec.c $(h)
276 $(SLN) regexec.c tregexec.c
277 $(CCCMD) -DTAINT tregexec.c
282 $(SLN) stab.c tstab.c
283 $(CCCMD) -DTAINT tstab.c
286 tstr.o: str.c $(h) perly.h
289 $(CCCMD) -DTAINT tstr.c
292 ttoke.o: toke.c $(h) perly.h
294 $(SLN) toke.c ttoke.c
295 $(CCCMD) -DTAINT ttoke.c
300 $(SLN) util.c tutil.c
301 $(CCCMD) -DTAINT tutil.c
305 @ echo Dummy dependency for dumb parallel make
308 perly.c: perly.y perly.fixer
311 *bison*) echo 'Expect' 25 shift/reduce and 59 reduce/reduce conflicts;; \
312 *) echo 'Expect' 27 shift/reduce and 57 reduce/reduce conflicts;; \
315 sh $(shellflags) ./perly.fixer y.tab.c perly.c
317 echo 'extern YYSTYPE yylval;' >>perly.h
319 perly.o: perly.c perly.h $(h)
326 rm -f *.o all perl taintperl suidperl perly.c
327 cd x2p; $(MAKE) clean
330 cd x2p; $(MAKE) realclean
331 rm -f *.orig */*.orig *~ */*~ core $(addedbyconf) h2ph h2ph.man
332 rm -f perly.c perly.h t/perl Makefile config.h makedepend makedir
333 rm -f makefile x2p/Makefile x2p/makefile cflags x2p/cflags
336 # The following lint has practically everything turned on. Unfortunately,
337 # you have to wade through a lot of mumbo jumbo that can't be suppressed.
338 # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
342 lint $(lintflags) $(defs) perly.c $(c) > perl.fuzz
345 - test -f perly.h || cp /dev/null perly.h
347 - test -s perly.h || /bin/rm -f perly.h
348 cd x2p; $(MAKE) depend
351 - cd t && chmod +x TEST */*.t
352 - cd t && (rm -f perl; $(SLN) ../perl perl) && ./perl TEST </dev/tty
355 echo $(c) | tr ' ' '\012' >.clist
358 echo $(h) | tr ' ' '\012' >.hlist
361 echo $(sh) | tr ' ' '\012' >.shlist
363 # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
365 @ echo "You haven't done a "'"make depend" yet!'; exit 1
366 makedepend: makedepend.SH
367 /bin/sh $(shellflags) makedepend.SH
373 ln Makefile ../Makefile