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.1 $$Date: 91/04/11 17:30:39 $
30 # $Log: Makefile.SH,v $
31 # Revision 4.0.1.1 91/04/11 17:30:39 lwall
32 # patch1: C flags are now settable on a per-file basis
34 # Revision 4.0 91/03/20 00:58:54 lwall
42 scriptdir = $scriptdir
43 privlib = $installprivlib
50 mallocsrc = $mallocsrc
51 mallocobj = $mallocobj
54 libs = $libs $cryptlib
56 public = perl taintperl $suidperl
60 cat >>Makefile <<'!NO!SUBS!'
62 CFLAGS = `sh cflags.SH $@`
70 manpages = perl.man h2ph.man
74 sh = Makefile.SH makedepend.SH h2ph.SH
76 h1 = EXTERN.h INTERN.h arg.h array.h cmd.h config.h form.h handy.h
77 h2 = hash.h perl.h regcomp.h regexp.h spat.h stab.h str.h util.h
81 c1 = array.c cmd.c cons.c consarg.c doarg.c doio.c dolist.c dump.c
82 c2 = eval.c form.c hash.c $(mallocsrc) perl.c regcomp.c regexec.c
83 c3 = stab.c str.c toke.c util.c usersub.c
87 obj1 = array.o cmd.o cons.o consarg.o doarg.o doio.o dolist.o dump.o
88 obj2 = eval.o form.o hash.o $(mallocobj) perl.o regcomp.o regexec.o
89 obj3 = stab.o str.o toke.o util.o
91 obj = $(obj1) $(obj2) $(obj3)
93 tobj1 = tarray.o tcmd.o tcons.o tconsarg.o tdoarg.o tdoio.o tdolist.o tdump.o
94 tobj2 = teval.o tform.o thash.o $(mallocobj) tregcomp.o tregexec.o
95 tobj3 = tstab.o tstr.o ttoke.o tutil.o
97 tobj = $(tobj1) $(tobj2) $(tobj3)
101 addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
107 $(CC) -c $(CFLAGS) $*.c
109 all: $(public) $(private) $(util) uperl.o $(scripts)
113 # This is the standard version that contains no "taint" checks and is
114 # used for all scripts that aren't set-id or running under something set-id.
115 # The $& notation is tells Sequent machines that it can do a parallel make,
116 # and is harmless otherwise.
118 perl: $& perly.o $(obj) usersub.o
119 $(CC) $(LARGE) $(CLDFLAGS) $(obj) perly.o usersub.o $(libs) -o perl
121 uperl.o: $& perly.o $(obj)
122 -ld $(LARGE) $(LDFLAGS) -r $(obj) perly.o $(libs) -o uperl.o
127 # This version, if specified in Configure, does ONLY those scripts which need
128 # set-id emulation. Suidperl must be setuid root. It contains the "taint"
129 # checks as well as the special code to validate that the script in question
130 # has been invoked correctly.
132 suidperl: $& tperly.o sperl.o $(tobj) usersub.o
133 $(CC) $(LARGE) $(CLDFLAGS) sperl.o $(tobj) tperly.o usersub.o $(libs) \
136 # This version interprets scripts that are already set-id either via a wrapper
137 # or through the kernel allowing set-id scripts (bad idea). Taintperl must
138 # NOT be setuid to root or anything else. The only difference between it
139 # and normal perl is the presence of the "taint" checks.
141 taintperl: $& tperly.o tperl.o $(tobj) usersub.o
142 $(CC) $(LARGE) $(CLDFLAGS) tperl.o $(tobj) tperly.o usersub.o $(libs) \
145 # Replicating all this junk is yucky, but I don't see a portable way to fix it.
147 tperly.o: perly.c perly.h $(h)
149 $(SLN) perly.c tperly.c
150 $(CC) -c -DTAINT $(CFLAGS) tperly.c
153 tperl.o: perl.c perly.h patchlevel.h perl.h $(h)
155 $(SLN) perl.c tperl.c
156 $(CC) -c -DTAINT $(CFLAGS) tperl.c
159 sperl.o: perl.c perly.h patchlevel.h $(h)
161 $(SLN) perl.c sperl.c
162 $(CC) -c -DTAINT -DIAMSUID $(CFLAGS) sperl.c
165 tarray.o: array.c $(h)
167 $(SLN) array.c tarray.c
168 $(CC) -c -DTAINT $(CFLAGS) tarray.c
174 $(CC) -c -DTAINT $(CFLAGS) tcmd.c
177 tcons.o: cons.c $(h) perly.h
179 $(SLN) cons.c tcons.c
180 $(CC) -c -DTAINT $(CFLAGS) tcons.c
183 tconsarg.o: consarg.c $(h)
184 /bin/rm -f tconsarg.c
185 $(SLN) consarg.c tconsarg.c
186 $(CC) -c -DTAINT $(CFLAGS) tconsarg.c
187 /bin/rm -f tconsarg.c
189 tdoarg.o: doarg.c $(h)
191 $(SLN) doarg.c tdoarg.c
192 $(CC) -c -DTAINT $(CFLAGS) tdoarg.c
197 $(SLN) doio.c tdoio.c
198 $(CC) -c -DTAINT $(CFLAGS) tdoio.c
201 tdolist.o: dolist.c $(h)
203 $(SLN) dolist.c tdolist.c
204 $(CC) -c -DTAINT $(CFLAGS) tdolist.c
209 $(SLN) dump.c tdump.c
210 $(CC) -c -DTAINT $(CFLAGS) tdump.c
215 $(SLN) eval.c teval.c
216 $(CC) -c -DTAINT $(CFLAGS) teval.c
221 $(SLN) form.c tform.c
222 $(CC) -c -DTAINT $(CFLAGS) tform.c
227 $(SLN) hash.c thash.c
228 $(CC) -c -DTAINT $(CFLAGS) thash.c
231 tregcomp.o: regcomp.c $(h)
232 /bin/rm -f tregcomp.c
233 $(SLN) regcomp.c tregcomp.c
234 $(CC) -c -DTAINT $(CFLAGS) tregcomp.c
235 /bin/rm -f tregcomp.c
237 tregexec.o: regexec.c $(h)
238 /bin/rm -f tregexec.c
239 $(SLN) regexec.c tregexec.c
240 $(CC) -c -DTAINT $(CFLAGS) tregexec.c
241 /bin/rm -f tregexec.c
245 $(SLN) stab.c tstab.c
246 $(CC) -c -DTAINT $(CFLAGS) tstab.c
249 tstr.o: str.c $(h) perly.h
252 $(CC) -c -DTAINT $(CFLAGS) tstr.c
255 ttoke.o: toke.c $(h) perly.h
257 $(SLN) toke.c ttoke.c
258 $(CC) -c -DTAINT $(CFLAGS) ttoke.c
263 $(SLN) util.c tutil.c
264 $(CC) -c -DTAINT $(CFLAGS) tutil.c
268 @ echo Dummy dependency for dumb parallel make
272 @ echo 'Expect either' 29 shift/reduce and 59 reduce/reduce conflicts...
273 @ echo ' or' 27 shift/reduce and 61 reduce/reduce conflicts...
275 sh perly.fixer y.tab.c perly.c
277 echo 'extern YYSTYPE yylval;' >>perly.h
279 perly.o: perly.c perly.h $(h)
280 $(CC) -c $(CFLAGS) perly.c
284 cd x2p; $(MAKE) install
287 rm -f *.o all perl taintperl suidperl
288 cd x2p; $(MAKE) clean
291 cd x2p; $(MAKE) realclean
292 rm -f *.orig */*.orig *~ */*~ core $(addedbyconf) h2ph h2ph.man
293 rm -f perly.c perly.h t/perl Makefile config.h makedepend makedir
296 # The following lint has practically everything turned on. Unfortunately,
297 # you have to wade through a lot of mumbo jumbo that can't be suppressed.
298 # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
302 lint $(lintflags) $(defs) perly.c $(c) > perl.fuzz
305 - test -f perly.h || cp /dev/null perly.h
307 - test -s perly.h || /bin/rm -f perly.h
308 cd x2p; $(MAKE) depend
311 - cd t && chmod +x TEST */*.t
312 - cd t && (rm -f perl; $(SLN) ../perl .) && ./perl TEST </dev/tty
315 echo $(c) | tr ' ' '\012' >.clist
318 echo $(h) | tr ' ' '\012' >.hlist
321 echo $(sh) | tr ' ' '\012' >.shlist
323 # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
325 @ echo "You haven't done a "'"make depend" yet!'; exit 1
326 makedepend: makedepend.SH
327 /bin/sh makedepend.SH
333 ln Makefile ../Makefile