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.12 91/01/11 17:05:17 lwall Locked $
30 # $Log: Makefile.SH,v $
31 # Revision 3.0.1.12 91/01/11 17:05:17 lwall
32 # patch42: added installperl script
34 # Revision 3.0.1.11 90/11/10 01:25:51 lwall
35 # patch38: new arbitrary precision libraries from Mark Biggar
37 # Revision 3.0.1.10 90/10/20 01:59:21 lwall
38 # patch37: added cryptlib support to Makefile
40 # Revision 3.0.1.9 90/10/15 14:41:34 lwall
41 # patch29: various portability fixes
43 # Revision 3.0.1.8 90/08/13 21:50:49 lwall
44 # patch28: not all yaccs are the same
46 # Revision 3.0.1.7 90/08/09 02:19:56 lwall
47 # patch19: Configure now asks where you want to put scripts
48 # patch19: Added support for linked-in C subroutines
50 # Revision 3.0.1.6 90/03/27 15:27:15 lwall
51 # patch16: MSDOS support
53 # Revision 3.0.1.5 90/03/12 16:15:17 lwall
54 # patch13: some dependencies missing on perly.h
55 # patch13: some relief for buggy parallel makes
56 # patch13: bison doesn't declare extern YYSTYPE yylval;
58 # Revision 3.0.1.4 90/02/28 16:19:43 lwall
59 # patch9: extraneous $ on suidperl in Makefile
61 # Revision 3.0.1.3 89/12/21 19:09:26 lwall
62 # patch7: Configure now lets you pick between yacc or bison
64 # Revision 3.0.1.2 89/11/11 04:07:30 lwall
65 # patch2: $sockethdr incorporated into $ccflags
66 # patch2: $libs now has most of the -l libraries
68 # Revision 3.0.1.1 89/10/26 23:00:38 lwall
69 # patch1: Makefile.SH needed some more .h dependecies
71 # Revision 3.0 89/10/18 15:06:43 lwall
78 scriptdir = $scriptdir
82 CFLAGS = $ccflags $optimize
87 mallocsrc = $mallocsrc
88 mallocobj = $mallocobj
91 libs = $libs $cryptlib
93 public = perl taintperl $suidperl
97 cat >>Makefile <<'!NO!SUBS!'
104 manpages = perl.man h2ph.man
108 sh = Makefile.SH makedepend.SH h2ph.SH
110 h1 = EXTERN.h INTERN.h arg.h array.h cmd.h config.h form.h handy.h
111 h2 = hash.h perl.h regcomp.h regexp.h spat.h stab.h str.h util.h
115 c1 = array.c cmd.c cons.c consarg.c doarg.c doio.c dolist.c dump.c
116 c2 = eval.c form.c hash.c $(mallocsrc) perly.c regcomp.c regexec.c
117 c3 = stab.c str.c toke.c util.c usersub.c
119 c = $(c1) $(c2) $(c3)
121 obj1 = array.o cmd.o cons.o consarg.o doarg.o doio.o dolist.o dump.o
122 obj2 = eval.o form.o hash.o $(mallocobj) perly.o regcomp.o regexec.o
123 obj3 = stab.o str.o toke.o util.o
125 obj = $(obj1) $(obj2) $(obj3)
127 tobj1 = tarray.o tcmd.o tcons.o tconsarg.o tdoarg.o tdoio.o tdolist.o tdump.o
128 tobj2 = teval.o tform.o thash.o $(mallocobj) tregcomp.o tregexec.o
129 tobj3 = tstab.o tstr.o ttoke.o tutil.o
131 tobj = $(tobj1) $(tobj2) $(tobj3)
135 addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
141 $(CC) -c $(CFLAGS) $(LARGE) $*.c
143 all: $(public) $(private) $(util) perl.man uperl.o $(scripts)
147 # This is the standard version that contains no "taint" checks and is
148 # used for all scripts that aren't set-id or running under something set-id.
150 perl: perl.o $(obj) usersub.o
151 $(CC) $(LARGE) $(CLDFLAGS) $(obj) perl.o usersub.o $(libs) -o perl
153 uperl.o: perl.o $(obj)
154 -ld $(LARGE) $(LDFLAGS) -r $(obj) perl.o $(libs) -o uperl.o
159 # This version, if specified in Configure, does ONLY those scripts which need
160 # set-id emulation. Suidperl must be setuid root. It contains the "taint"
161 # checks as well as the special code to validate that the script in question
162 # has been invoked correctly.
164 suidperl: tperl.o sperly.o $(tobj) usersub.o
165 $(CC) $(LARGE) $(CLDFLAGS) sperly.o $(tobj) tperl.o usersub.o $(libs) \
168 # This version interprets scripts that are already set-id either via a wrapper
169 # or through the kernel allowing set-id scripts (bad idea). Taintperl must
170 # NOT be setuid to root or anything else. The only difference between it
171 # and normal perl is the presence of the "taint" checks.
173 taintperl: tperl.o tperly.o $(tobj) usersub.o
174 $(CC) $(LARGE) $(CLDFLAGS) tperly.o $(tobj) tperl.o usersub.o $(libs) \
177 # Replicating all this junk is yucky, but I don't see a portable way to fix it.
179 tperl.o: perl.c perly.h $(h)
181 $(SLN) perl.c tperl.c
182 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tperl.c
185 tperly.o: perly.c perly.h $(h)
187 $(SLN) perly.c tperly.c
188 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tperly.c
191 sperly.o: perly.c perly.h patchlevel.h $(h)
193 $(SLN) perly.c sperly.c
194 $(CC) -c -DTAINT -DIAMSUID $(CFLAGS) $(LARGE) sperly.c
197 tarray.o: array.c $(h)
199 $(SLN) array.c tarray.c
200 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tarray.c
206 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tcmd.c
209 tcons.o: cons.c $(h) perly.h
211 $(SLN) cons.c tcons.c
212 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tcons.c
215 tconsarg.o: consarg.c $(h)
216 /bin/rm -f tconsarg.c
217 $(SLN) consarg.c tconsarg.c
218 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tconsarg.c
219 /bin/rm -f tconsarg.c
221 tdoarg.o: doarg.c $(h)
223 $(SLN) doarg.c tdoarg.c
224 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdoarg.c
229 $(SLN) doio.c tdoio.c
230 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdoio.c
233 tdolist.o: dolist.c $(h)
235 $(SLN) dolist.c tdolist.c
236 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdolist.c
241 $(SLN) dump.c tdump.c
242 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdump.c
247 $(SLN) eval.c teval.c
248 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) teval.c
253 $(SLN) form.c tform.c
254 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tform.c
259 $(SLN) hash.c thash.c
260 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) thash.c
263 tregcomp.o: regcomp.c $(h)
264 /bin/rm -f tregcomp.c
265 $(SLN) regcomp.c tregcomp.c
266 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tregcomp.c
267 /bin/rm -f tregcomp.c
269 tregexec.o: regexec.c $(h)
270 /bin/rm -f tregexec.c
271 $(SLN) regexec.c tregexec.c
272 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tregexec.c
273 /bin/rm -f tregexec.c
277 $(SLN) stab.c tstab.c
278 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tstab.c
281 tstr.o: str.c $(h) perly.h
284 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tstr.c
287 ttoke.o: toke.c $(h) perly.h
289 $(SLN) toke.c ttoke.c
290 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) ttoke.c
295 $(SLN) util.c tutil.c
296 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tutil.c
300 @ echo Dummy dependency for dumb parallel make
304 @ echo 'Expect either' 29 shift/reduce and 59 reduce/reduce conflicts...
305 @ echo ' or' 27 shift/reduce and 61 reduce/reduce conflicts...
309 echo 'extern YYSTYPE yylval;' >>perly.h
311 perl.o: perl.c perly.h $(h)
312 $(CC) -c $(CFLAGS) $(LARGE) perl.c
314 perl.man: perl_man.1 perl_man.2 perl_man.3 perl_man.4 patchlevel.h perl
315 ./perl -e '($$r,$$p)=$$]=~/(\d+\.\d+).*\n\D*(\d+)/;' \
316 -e 'print ".ds RP Release $$r Patchlevel $$p\n";' >perl.man
317 cat perl_man.[1-4] >>perl.man
321 cd x2p; $(MAKE) install
324 rm -f *.o all perl taintperl suidperl perl.man
325 cd x2p; $(MAKE) clean
328 cd x2p; $(MAKE) realclean
329 rm -f *.orig */*.orig *~ */*~ core $(addedbyconf) h2ph h2ph.man
330 rm -f perl.c perly.h t/perl Makefile config.h makedepend makedir
333 # The following lint has practically everything turned on. Unfortunately,
334 # you have to wade through a lot of mumbo jumbo that can't be suppressed.
335 # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
339 lint $(lintflags) $(defs) perl.c $(c) > perl.fuzz
342 - test -f perly.h || cp /dev/null perly.h
344 - test -s perly.h || /bin/rm -f perly.h
345 cd x2p; $(MAKE) depend
348 - chmod +x t/TEST t/base.* t/comp.* t/cmd.* t/io.* t/op.* t/lib.*; \
349 cd t && (rm -f perl; $(SLN) ../perl .) && ./perl TEST
352 echo $(c) | tr ' ' '\012' >.clist
355 echo $(h) | tr ' ' '\012' >.hlist
358 echo $(sh) | tr ' ' '\012' >.shlist
360 # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
362 @ echo "You haven't done a "'"make depend" yet!'; exit 1
363 makedepend: makedepend.SH
364 /bin/sh makedepend.SH
370 ln Makefile ../Makefile