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.7 90/08/09 02:19:56 lwall Locked $
30 # $Log: Makefile.SH,v $
31 # Revision 3.0.1.7 90/08/09 02:19:56 lwall
32 # patch19: Configure now asks where you want to put scripts
33 # patch19: Added support for linked-in C subroutines
35 # Revision 3.0.1.6 90/03/27 15:27:15 lwall
36 # patch16: MSDOS support
38 # Revision 3.0.1.5 90/03/12 16:15:17 lwall
39 # patch13: some dependencies missing on perly.h
40 # patch13: some relief for buggy parallel makes
41 # patch13: bison doesn't declare extern YYSTYPE yylval;
43 # Revision 3.0.1.4 90/02/28 16:19:43 lwall
44 # patch9: extraneous $ on suidperl in Makefile
46 # Revision 3.0.1.3 89/12/21 19:09:26 lwall
47 # patch7: Configure now lets you pick between yacc or bison
49 # Revision 3.0.1.2 89/11/11 04:07:30 lwall
50 # patch2: $sockethdr incorporated into $ccflags
51 # patch2: $libs now has most of the -l libraries
53 # Revision 3.0.1.1 89/10/26 23:00:38 lwall
54 # patch1: Makefile.SH needed some more .h dependecies
56 # Revision 3.0 89/10/18 15:06:43 lwall
63 scriptdir = $scriptdir
67 CFLAGS = $ccflags $optimize
71 mallocsrc = $mallocsrc
72 mallocobj = $mallocobj
77 public = perl taintperl $suidperl
81 cat >>Makefile <<'!NO!SUBS!'
88 manpages = perl.man h2ph.man
92 sh = Makefile.SH makedepend.SH h2ph.SH
94 h1 = EXTERN.h INTERN.h arg.h array.h cmd.h config.h form.h handy.h
95 h2 = hash.h perl.h regcomp.h regexp.h spat.h stab.h str.h util.h
99 c1 = array.c cmd.c cons.c consarg.c doarg.c doio.c dolist.c dump.c
100 c2 = eval.c form.c hash.c $(mallocsrc) perly.c regcomp.c regexec.c
101 c3 = stab.c str.c toke.c util.c
103 c = $(c1) $(c2) $(c3)
105 obj1 = array.o cmd.o cons.o consarg.o doarg.o doio.o dolist.o dump.o
106 obj2 = eval.o form.o hash.o $(mallocobj) perly.o regcomp.o regexec.o
107 obj3 = stab.o str.o toke.o util.o
109 obj = $(obj1) $(obj2) $(obj3)
111 tobj1 = tarray.o tcmd.o tcons.o tconsarg.o tdoarg.o tdoio.o tdolist.o tdump.o
112 tobj2 = teval.o tform.o thash.o $(mallocobj) tregcomp.o tregexec.o
113 tobj3 = tstab.o tstr.o ttoke.o tutil.o
115 tobj = $(tobj1) $(tobj2) $(tobj3)
119 addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
125 $(CC) -c $(CFLAGS) $(LARGE) $*.c
127 all: $(public) $(private) $(util) perl.man uperl.o $(scripts)
131 # This is the standard version that contains no "taint" checks and is
132 # used for all scripts that aren't set-id or running under something set-id.
134 perl: perl.o $(obj) usersub.o
135 $(CC) $(LARGE) $(LDFLAGS) $(obj) perl.o usersub.o $(libs) -o perl
137 uperl.o: perl.o $(obj)
138 ld $(LARGE) $(LDFLAGS) -r $(obj) perl.o $(libs) -o uperl.o
143 # This version, if specified in Configure, does ONLY those scripts which need
144 # set-id emulation. Suidperl must be setuid root. It contains the "taint"
145 # checks as well as the special code to validate that the script in question
146 # has been invoked correctly.
148 suidperl: tperl.o sperly.o $(tobj) usersub.o
149 $(CC) $(LARGE) $(LDFLAGS) sperly.o $(tobj) tperl.o usersub.o $(libs) \
152 # This version interprets scripts that are already set-id either via a wrapper
153 # or through the kernel allowing set-id scripts (bad idea). Taintperl must
154 # NOT be setuid to root or anything else. The only difference between it
155 # and normal perl is the presence of the "taint" checks.
157 taintperl: tperl.o tperly.o $(tobj) usersub.o
158 $(CC) $(LARGE) $(LDFLAGS) tperly.o $(tobj) tperl.o usersub.o $(libs) \
161 # Replicating all this junk is yucky, but I don't see a portable way to fix it.
163 tperl.o: perl.c perly.h $(h)
165 $(SLN) perl.c tperl.c
166 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tperl.c
169 tperly.o: perly.c perly.h $(h)
171 $(SLN) perly.c tperly.c
172 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tperly.c
175 sperly.o: perly.c perly.h patchlevel.h $(h)
177 $(SLN) perly.c sperly.c
178 $(CC) -c -DTAINT -DIAMSUID $(CFLAGS) $(LARGE) sperly.c
181 tarray.o: array.c $(h)
183 $(SLN) array.c tarray.c
184 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tarray.c
190 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tcmd.c
193 tcons.o: cons.c $(h) perly.h
195 $(SLN) cons.c tcons.c
196 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tcons.c
199 tconsarg.o: consarg.c $(h)
200 /bin/rm -f tconsarg.c
201 $(SLN) consarg.c tconsarg.c
202 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tconsarg.c
203 /bin/rm -f tconsarg.c
205 tdoarg.o: doarg.c $(h)
207 $(SLN) doarg.c tdoarg.c
208 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdoarg.c
213 $(SLN) doio.c tdoio.c
214 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdoio.c
217 tdolist.o: dolist.c $(h)
219 $(SLN) dolist.c tdolist.c
220 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdolist.c
225 $(SLN) dump.c tdump.c
226 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdump.c
231 $(SLN) eval.c teval.c
232 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) teval.c
237 $(SLN) form.c tform.c
238 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tform.c
243 $(SLN) hash.c thash.c
244 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) thash.c
247 tregcomp.o: regcomp.c $(h)
248 /bin/rm -f tregcomp.c
249 $(SLN) regcomp.c tregcomp.c
250 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tregcomp.c
251 /bin/rm -f tregcomp.c
253 tregexec.o: regexec.c $(h)
254 /bin/rm -f tregexec.c
255 $(SLN) regexec.c tregexec.c
256 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tregexec.c
257 /bin/rm -f tregexec.c
261 $(SLN) stab.c tstab.c
262 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tstab.c
265 tstr.o: str.c $(h) perly.h
268 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tstr.c
271 ttoke.o: toke.c $(h) perly.h
273 $(SLN) toke.c ttoke.c
274 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) ttoke.c
279 $(SLN) util.c tutil.c
280 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tutil.c
284 @ echo Dummy dependency for dumb parallel make
288 @ echo Expect 29 shift/reduce and 59 reduce/reduce conflicts...
292 echo 'extern YYSTYPE yylval;' >>perly.h
294 perl.o: perl.c perly.h $(h)
295 $(CC) -c $(CFLAGS) $(LARGE) perl.c
297 perl.man: perl_man.1 perl_man.2 perl_man.3 perl_man.4 patchlevel.h perl
298 ./perl -e '($$r,$$p)=$$]=~/(\d+\.\d+).*\n\D*(\d+)/;' \
299 -e 'print ".ds RP Release $$r Patchlevel $$p\n";' >perl.man
300 cat perl_man.[1-4] >>perl.man
303 # won't work with csh
304 export PATH || exit 1
305 - rm -f $(bin)/perl.old $(bin)/suidperl $(bin)/taintperl
306 - mv $(bin)/perl $(bin)/perl.old 2>/dev/null
307 - if test `pwd` != $(bin); then cp $(public) $(bin); fi
309 for pub in $(public); do \
310 chmod +x `basename $$pub`; \
312 - chmod 755 $(bin)/taintperl 2>/dev/null
317 cat >>Makefile <<'!NO!SUBS!'
318 - chmod 4711 $(bin)/suidperl 2>/dev/null
323 cat >>Makefile <<'!NO!SUBS!'
324 - test $(bin) = /usr/bin || rm -f /usr/bin/perl
325 - test $(bin) = /usr/bin || $(SLN) $(bin)/perl /usr/bin || cp $(bin)/perl /usr/bin
326 - chmod +x $(scripts)
327 - cp $(scripts) $(scriptdir)
328 - sh ./makedir $(privlib)
330 if test `pwd` != $(privlib); then \
331 cp $(private) lib/*.pl $(privlib); \
334 #for priv in $(private); do \
335 #chmod +x `basename $$priv`; \
337 - if test `pwd` != $(mansrc); then \
338 for page in $(manpages); do \
339 cp $$page $(mansrc)/`basename $$page .man`.$(manext); \
342 cd x2p; $(MAKE) install
345 rm -f *.o all perl taintperl suidperl perl.man
346 cd x2p; $(MAKE) clean
349 cd x2p; $(MAKE) realclean
350 rm -f perl *.orig */*.orig *~ */*~ *.o core $(addedbyconf) perl.man
351 rm -f perl.c perly.h t/perl Makefile config.h makedepend makedir
354 # The following lint has practically everything turned on. Unfortunately,
355 # you have to wade through a lot of mumbo jumbo that can't be suppressed.
356 # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
360 lint $(lintflags) $(defs) perl.c $(c) > perl.fuzz
363 - test -f perly.h || cp /dev/null perly.h
365 - test -s perly.h || /bin/rm -f perly.h
366 cd x2p; $(MAKE) depend
369 - chmod +x t/TEST t/base.* t/comp.* t/cmd.* t/io.* t/op.*; \
370 cd t && (rm -f perl; $(SLN) ../perl .) && ./perl TEST
373 echo $(c) | tr ' ' '\012' >.clist
376 echo $(h) | tr ' ' '\012' >.hlist
379 echo $(sh) | tr ' ' '\012' >.shlist
381 # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
383 @ echo "You haven't done a "'"make depend" yet!'; exit 1
384 makedepend: makedepend.SH
385 /bin/sh makedepend.SH
391 ln Makefile ../Makefile