Commit | Line | Data |
---|---|---|
8d063cd8 | 1 | case $CONFIG in |
2 | '') | |
3 | if test ! -f config.sh; then | |
4 | ln ../config.sh . || \ | |
5 | ln ../../config.sh . || \ | |
6 | ln ../../../config.sh . || \ | |
7 | (echo "Can't find config.sh."; exit 1) | |
fe14fcc3 | 8 | fi 2>/dev/null |
378cc40b | 9 | . ./config.sh |
8d063cd8 | 10 | ;; |
11 | esac | |
12 | case "$0" in | |
13 | */*) cd `expr X$0 : 'X\(.*\)/'` ;; | |
14 | esac | |
2e1b3b7e | 15 | |
16 | case "$d_symlink" in | |
17 | *define*) sln='ln -s' ;; | |
18 | *) sln='ln';; | |
19 | esac | |
20 | ||
13281fa4 | 21 | case "$d_dosuid" in |
22 | *define*) suidperl='suidperl' ;; | |
23 | *) suidperl='';; | |
24 | esac | |
25 | ||
8d063cd8 | 26 | echo "Extracting Makefile (with variable substitutions)" |
27 | cat >Makefile <<!GROK!THIS! | |
fe14fcc3 | 28 | # $Header: Makefile.SH,v 4.0 91/03/20 00:58:54 lwall Locked $ |
8d063cd8 | 29 | # |
30 | # $Log: Makefile.SH,v $ | |
fe14fcc3 | 31 | # Revision 4.0 91/03/20 00:58:54 lwall |
32 | # 4.0 baseline. | |
7e1cf235 | 33 | # |
8d063cd8 | 34 | # |
8d063cd8 | 35 | |
36 | CC = $cc | |
d8f2e4cc | 37 | YACC = $yacc |
fe14fcc3 | 38 | bin = $installbin |
79220ce3 | 39 | scriptdir = $scriptdir |
fe14fcc3 | 40 | privlib = $installprivlib |
8d063cd8 | 41 | mansrc = $mansrc |
42 | manext = $manext | |
91407755 | 43 | CFLAGS = $ccflags $optimize |
8d063cd8 | 44 | LDFLAGS = $ldflags |
b6ccd89c | 45 | CLDFLAGS = $ldflags |
8d063cd8 | 46 | SMALL = $small |
47 | LARGE = $large $split | |
a1cc2bdc | 48 | mallocsrc = $mallocsrc |
49 | mallocobj = $mallocobj | |
2e1b3b7e | 50 | SLN = $sln |
8d063cd8 | 51 | |
e5d73d77 | 52 | libs = $libs $cryptlib |
8d063cd8 | 53 | |
a687059c | 54 | public = perl taintperl $suidperl |
8d063cd8 | 55 | |
13281fa4 | 56 | !GROK!THIS! |
8d063cd8 | 57 | |
13281fa4 | 58 | cat >>Makefile <<'!NO!SUBS!' |
8d063cd8 | 59 | private = |
60 | ||
79220ce3 | 61 | scripts = h2ph |
62 | ||
a687059c | 63 | MAKE = make |
64 | ||
79220ce3 | 65 | manpages = perl.man h2ph.man |
8d063cd8 | 66 | |
67 | util = | |
68 | ||
79220ce3 | 69 | sh = Makefile.SH makedepend.SH h2ph.SH |
8d063cd8 | 70 | |
71 | h1 = EXTERN.h INTERN.h arg.h array.h cmd.h config.h form.h handy.h | |
a687059c | 72 | h2 = hash.h perl.h regcomp.h regexp.h spat.h stab.h str.h util.h |
8d063cd8 | 73 | |
74 | h = $(h1) $(h2) | |
75 | ||
a687059c | 76 | c1 = array.c cmd.c cons.c consarg.c doarg.c doio.c dolist.c dump.c |
fe14fcc3 | 77 | c2 = eval.c form.c hash.c $(mallocsrc) perl.c regcomp.c regexec.c |
b6ccd89c | 78 | c3 = stab.c str.c toke.c util.c usersub.c |
a687059c | 79 | |
80 | c = $(c1) $(c2) $(c3) | |
81 | ||
82 | obj1 = array.o cmd.o cons.o consarg.o doarg.o doio.o dolist.o dump.o | |
fe14fcc3 | 83 | obj2 = eval.o form.o hash.o $(mallocobj) perl.o regcomp.o regexec.o |
a687059c | 84 | obj3 = stab.o str.o toke.o util.o |
8d063cd8 | 85 | |
a687059c | 86 | obj = $(obj1) $(obj2) $(obj3) |
8d063cd8 | 87 | |
a687059c | 88 | tobj1 = tarray.o tcmd.o tcons.o tconsarg.o tdoarg.o tdoio.o tdolist.o tdump.o |
89 | tobj2 = teval.o tform.o thash.o $(mallocobj) tregcomp.o tregexec.o | |
90 | tobj3 = tstab.o tstr.o ttoke.o tutil.o | |
8d063cd8 | 91 | |
a687059c | 92 | tobj = $(tobj1) $(tobj2) $(tobj3) |
8d063cd8 | 93 | |
a687059c | 94 | lintflags = -hbvxac |
8d063cd8 | 95 | |
96 | addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7 | |
97 | ||
98 | # grrr | |
99 | SHELL = /bin/sh | |
100 | ||
101 | .c.o: | |
102 | $(CC) -c $(CFLAGS) $(LARGE) $*.c | |
103 | ||
fe14fcc3 | 104 | all: $(public) $(private) $(util) uperl.o $(scripts) |
a687059c | 105 | cd x2p; $(MAKE) all |
d8f2e4cc | 106 | touch all |
13281fa4 | 107 | |
a687059c | 108 | # This is the standard version that contains no "taint" checks and is |
109 | # used for all scripts that aren't set-id or running under something set-id. | |
13281fa4 | 110 | |
fe14fcc3 | 111 | perl: $& perly.o $(obj) usersub.o |
112 | $(CC) $(LARGE) $(CLDFLAGS) $(obj) perly.o usersub.o $(libs) -o perl | |
79220ce3 | 113 | |
fe14fcc3 | 114 | uperl.o: $& perly.o $(obj) |
115 | -ld $(LARGE) $(LDFLAGS) -r $(obj) perly.o $(libs) -o uperl.o | |
79220ce3 | 116 | |
fe14fcc3 | 117 | saber: perly.c |
118 | # load $(c) perly.c | |
a687059c | 119 | |
120 | # This version, if specified in Configure, does ONLY those scripts which need | |
121 | # set-id emulation. Suidperl must be setuid root. It contains the "taint" | |
122 | # checks as well as the special code to validate that the script in question | |
123 | # has been invoked correctly. | |
13281fa4 | 124 | |
fe14fcc3 | 125 | suidperl: $& tperly.o sperl.o $(tobj) usersub.o |
126 | $(CC) $(LARGE) $(CLDFLAGS) sperl.o $(tobj) tperly.o usersub.o $(libs) \ | |
79220ce3 | 127 | -o suidperl |
13281fa4 | 128 | |
a687059c | 129 | # This version interprets scripts that are already set-id either via a wrapper |
130 | # or through the kernel allowing set-id scripts (bad idea). Taintperl must | |
131 | # NOT be setuid to root or anything else. The only difference between it | |
132 | # and normal perl is the presence of the "taint" checks. | |
133 | ||
fe14fcc3 | 134 | taintperl: $& tperly.o tperl.o $(tobj) usersub.o |
135 | $(CC) $(LARGE) $(CLDFLAGS) tperl.o $(tobj) tperly.o usersub.o $(libs) \ | |
79220ce3 | 136 | -o taintperl |
a687059c | 137 | |
138 | # Replicating all this junk is yucky, but I don't see a portable way to fix it. | |
139 | ||
03a14243 | 140 | tperly.o: perly.c perly.h $(h) |
a687059c | 141 | /bin/rm -f tperly.c |
142 | $(SLN) perly.c tperly.c | |
143 | $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tperly.c | |
144 | /bin/rm -f tperly.c | |
145 | ||
fe14fcc3 | 146 | tperl.o: perl.c perly.h patchlevel.h perl.h $(h) |
147 | /bin/rm -f tperl.c | |
148 | $(SLN) perl.c tperl.c | |
149 | $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tperl.c | |
150 | /bin/rm -f tperl.c | |
151 | ||
152 | sperl.o: perl.c perly.h patchlevel.h $(h) | |
153 | /bin/rm -f sperl.c | |
154 | $(SLN) perl.c sperl.c | |
155 | $(CC) -c -DTAINT -DIAMSUID $(CFLAGS) $(LARGE) sperl.c | |
156 | /bin/rm -f sperl.c | |
13281fa4 | 157 | |
03a14243 | 158 | tarray.o: array.c $(h) |
a687059c | 159 | /bin/rm -f tarray.c |
160 | $(SLN) array.c tarray.c | |
161 | $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tarray.c | |
162 | /bin/rm -f tarray.c | |
163 | ||
03a14243 | 164 | tcmd.o: cmd.c $(h) |
a687059c | 165 | /bin/rm -f tcmd.c |
166 | $(SLN) cmd.c tcmd.c | |
167 | $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tcmd.c | |
168 | /bin/rm -f tcmd.c | |
169 | ||
ff2452de | 170 | tcons.o: cons.c $(h) perly.h |
a687059c | 171 | /bin/rm -f tcons.c |
172 | $(SLN) cons.c tcons.c | |
173 | $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tcons.c | |
174 | /bin/rm -f tcons.c | |
175 | ||
03a14243 | 176 | tconsarg.o: consarg.c $(h) |
a687059c | 177 | /bin/rm -f tconsarg.c |
178 | $(SLN) consarg.c tconsarg.c | |
179 | $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tconsarg.c | |
180 | /bin/rm -f tconsarg.c | |
181 | ||
03a14243 | 182 | tdoarg.o: doarg.c $(h) |
a687059c | 183 | /bin/rm -f tdoarg.c |
184 | $(SLN) doarg.c tdoarg.c | |
185 | $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdoarg.c | |
186 | /bin/rm -f tdoarg.c | |
187 | ||
03a14243 | 188 | tdoio.o: doio.c $(h) |
a687059c | 189 | /bin/rm -f tdoio.c |
190 | $(SLN) doio.c tdoio.c | |
191 | $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdoio.c | |
192 | /bin/rm -f tdoio.c | |
193 | ||
03a14243 | 194 | tdolist.o: dolist.c $(h) |
a687059c | 195 | /bin/rm -f tdolist.c |
196 | $(SLN) dolist.c tdolist.c | |
197 | $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdolist.c | |
198 | /bin/rm -f tdolist.c | |
199 | ||
03a14243 | 200 | tdump.o: dump.c $(h) |
a687059c | 201 | /bin/rm -f tdump.c |
202 | $(SLN) dump.c tdump.c | |
203 | $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdump.c | |
204 | /bin/rm -f tdump.c | |
205 | ||
03a14243 | 206 | teval.o: eval.c $(h) |
a687059c | 207 | /bin/rm -f teval.c |
208 | $(SLN) eval.c teval.c | |
209 | $(CC) -c -DTAINT $(CFLAGS) $(LARGE) teval.c | |
210 | /bin/rm -f teval.c | |
211 | ||
03a14243 | 212 | tform.o: form.c $(h) |
a687059c | 213 | /bin/rm -f tform.c |
214 | $(SLN) form.c tform.c | |
215 | $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tform.c | |
216 | /bin/rm -f tform.c | |
217 | ||
03a14243 | 218 | thash.o: hash.c $(h) |
a687059c | 219 | /bin/rm -f thash.c |
220 | $(SLN) hash.c thash.c | |
221 | $(CC) -c -DTAINT $(CFLAGS) $(LARGE) thash.c | |
222 | /bin/rm -f thash.c | |
223 | ||
03a14243 | 224 | tregcomp.o: regcomp.c $(h) |
a687059c | 225 | /bin/rm -f tregcomp.c |
226 | $(SLN) regcomp.c tregcomp.c | |
227 | $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tregcomp.c | |
228 | /bin/rm -f tregcomp.c | |
229 | ||
03a14243 | 230 | tregexec.o: regexec.c $(h) |
a687059c | 231 | /bin/rm -f tregexec.c |
232 | $(SLN) regexec.c tregexec.c | |
233 | $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tregexec.c | |
234 | /bin/rm -f tregexec.c | |
235 | ||
03a14243 | 236 | tstab.o: stab.c $(h) |
a687059c | 237 | /bin/rm -f tstab.c |
238 | $(SLN) stab.c tstab.c | |
239 | $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tstab.c | |
240 | /bin/rm -f tstab.c | |
241 | ||
ff2452de | 242 | tstr.o: str.c $(h) perly.h |
a687059c | 243 | /bin/rm -f tstr.c |
244 | $(SLN) str.c tstr.c | |
245 | $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tstr.c | |
246 | /bin/rm -f tstr.c | |
247 | ||
ff2452de | 248 | ttoke.o: toke.c $(h) perly.h |
a687059c | 249 | /bin/rm -f ttoke.c |
250 | $(SLN) toke.c ttoke.c | |
251 | $(CC) -c -DTAINT $(CFLAGS) $(LARGE) ttoke.c | |
252 | /bin/rm -f ttoke.c | |
253 | ||
03a14243 | 254 | tutil.o: util.c $(h) |
a687059c | 255 | /bin/rm -f tutil.c |
256 | $(SLN) util.c tutil.c | |
257 | $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tutil.c | |
258 | /bin/rm -f tutil.c | |
8d063cd8 | 259 | |
fe14fcc3 | 260 | perly.h: perly.c |
ff2452de | 261 | @ echo Dummy dependency for dumb parallel make |
262 | touch perly.h | |
263 | ||
fe14fcc3 | 264 | perly.c: perly.y |
6eb13c3b | 265 | @ echo 'Expect either' 29 shift/reduce and 59 reduce/reduce conflicts... |
266 | @ echo ' or' 27 shift/reduce and 61 reduce/reduce conflicts... | |
fe14fcc3 | 267 | $(YACC) -d perly.y |
268 | sh perly.fixer y.tab.c perly.c | |
378cc40b | 269 | mv y.tab.h perly.h |
ff2452de | 270 | echo 'extern YYSTYPE yylval;' >>perly.h |
8d063cd8 | 271 | |
fe14fcc3 | 272 | perly.o: perly.c perly.h $(h) |
273 | $(CC) -c $(CFLAGS) $(LARGE) perly.c | |
8d063cd8 | 274 | |
a687059c | 275 | install: all |
7e1cf235 | 276 | ./perl installperl |
a687059c | 277 | cd x2p; $(MAKE) install |
8d063cd8 | 278 | |
279 | clean: | |
fe14fcc3 | 280 | rm -f *.o all perl taintperl suidperl |
a687059c | 281 | cd x2p; $(MAKE) clean |
8d063cd8 | 282 | |
b6ccd89c | 283 | realclean: clean |
a687059c | 284 | cd x2p; $(MAKE) realclean |
b6ccd89c | 285 | rm -f *.orig */*.orig *~ */*~ core $(addedbyconf) h2ph h2ph.man |
fe14fcc3 | 286 | rm -f perly.c perly.h t/perl Makefile config.h makedepend makedir |
a687059c | 287 | rm -f x2p/Makefile |
8d063cd8 | 288 | |
289 | # The following lint has practically everything turned on. Unfortunately, | |
290 | # you have to wade through a lot of mumbo jumbo that can't be suppressed. | |
291 | # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message | |
292 | # for that spot. | |
293 | ||
fe14fcc3 | 294 | lint: perly.c $(c) |
295 | lint $(lintflags) $(defs) perly.c $(c) > perl.fuzz | |
8d063cd8 | 296 | |
297 | depend: makedepend | |
378cc40b | 298 | - test -f perly.h || cp /dev/null perly.h |
fdf95cbb | 299 | ./makedepend |
378cc40b | 300 | - test -s perly.h || /bin/rm -f perly.h |
a687059c | 301 | cd x2p; $(MAKE) depend |
8d063cd8 | 302 | |
303 | test: perl | |
fe14fcc3 | 304 | - cd t && chmod +x TEST */*.t |
305 | - cd t && (rm -f perl; $(SLN) ../perl .) && ./perl TEST </dev/tty | |
8d063cd8 | 306 | |
307 | clist: | |
308 | echo $(c) | tr ' ' '\012' >.clist | |
309 | ||
310 | hlist: | |
311 | echo $(h) | tr ' ' '\012' >.hlist | |
312 | ||
313 | shlist: | |
314 | echo $(sh) | tr ' ' '\012' >.shlist | |
315 | ||
316 | # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE | |
d8f2e4cc | 317 | $(obj): |
8d063cd8 | 318 | @ echo "You haven't done a "'"make depend" yet!'; exit 1 |
319 | makedepend: makedepend.SH | |
320 | /bin/sh makedepend.SH | |
321 | !NO!SUBS! | |
322 | $eunicefix Makefile | |
323 | case `pwd` in | |
324 | *SH) | |
325 | $rm -f ../Makefile | |
326 | ln Makefile ../Makefile | |
327 | ;; | |
328 | esac |