perl 5.0 alpha 3
[p5sagit/p5-mst-13.2.git] / Makefile
CommitLineData
79072805 1# : Makefile.SH,v 15738Revision: 4.1 15738Date: 92/08/07 17:18:08 $
8d063cd8 2#
3# $Log: Makefile.SH,v $
79072805 4# Revision 4.1 92/08/07 17:18:08 lwall
5# Stage 6 Snapshot
6#
b3634b01 7# Revision 4.0.1.4 92/06/08 11:40:43 lwall
8# patch20: cray didn't give enough memory to /bin/sh
9# patch20: various and sundry fixes
10#
f1ca563b 11# Revision 4.0.1.3 91/11/05 15:48:11 lwall
12# patch11: saberized perl
13# patch11: added support for dbz
14#
132b68a5 15# Revision 4.0.1.2 91/06/07 10:14:43 lwall
16# patch4: cflags now emits entire cc command except for the filename
17# patch4: alternate make programs are now semi-supported
18# patch4: uperl.o no longer tries to link in libraries prematurely
19# patch4: installperl now installs x2p stuff too
20#
1c3d792e 21# Revision 4.0.1.1 91/04/11 17:30:39 lwall
22# patch1: C flags are now settable on a per-file basis
23#
fe14fcc3 24# Revision 4.0 91/03/20 00:58:54 lwall
25# 4.0 baseline.
7e1cf235 26#
8d063cd8 27#
8d063cd8 28
79072805 29CC = cc
30YACC = /bin/yacc
31bin = /usr/local/bin
32scriptdir = /usr/local/bin
33privlib = /usr/local/lib/perl
34mansrc = /usr/man/manl
35manext = l
36LDFLAGS =
37CLDFLAGS =
38SMALL =
39LARGE =
40mallocsrc = malloc.c
41mallocobj = malloc.o
42SLN = ln -s
f1ca563b 43RMS = rm -f
8d063cd8 44
79072805 45libs = -ldbm -lm -lposix
8d063cd8 46
79072805 47public = perl
b3634b01 48
79072805 49shellflags =
132b68a5 50
79072805 51# To use an alternate make, set in config.sh.
52MAKE = make
8d063cd8 53
1c3d792e 54
b3634b01 55CCCMD = `sh $(shellflags) cflags $@`
1c3d792e 56
8d063cd8 57private =
58
79220ce3 59scripts = h2ph
60
79220ce3 61manpages = perl.man h2ph.man
8d063cd8 62
63util =
64
79220ce3 65sh = Makefile.SH makedepend.SH h2ph.SH
8d063cd8 66
79072805 67h1 = EXTERN.h INTERN.h av.h cop.h config.h embed.h form.h handy.h
68h2 = hv.h op.h opcode.h perl.h regcomp.h regexp.h gv.h sv.h util.h
8d063cd8 69
70h = $(h1) $(h2)
71
79072805 72c1 = av.c cop.c cons.c consop.c doop.c doio.c dolist.c
73c2 = eval.c hv.c main.c $(mallocsrc) perl.c pp.c regcomp.c regexec.c
74c3 = gv.c sv.c toke.c util.c usersub.c
a687059c 75
76c = $(c1) $(c2) $(c3)
77
79072805 78s1 = av.c cop.c cons.c consop.c doop.c doio.c dolist.c
79s2 = eval.c hv.c main.c perl.c pp.c regcomp.c regexec.c
80s3 = gv.c sv.c toke.c util.c usersub.c perly.c
f1ca563b 81
82saber = $(s1) $(s2) $(s3)
83
79072805 84obj1 = av.o scope.o op.o doop.o doio.o dolist.o dump.o
85obj2 = $(mallocobj) mg.o pp.o regcomp.o regexec.o
86obj3 = gv.o sv.o toke.o util.o deb.o run.o
8d063cd8 87
a687059c 88obj = $(obj1) $(obj2) $(obj3)
8d063cd8 89
79072805 90tobj1 = tav.o tcop.o tcons.o tconsop.o tdoop.o tdoio.o tdolist.o tdump.o
91tobj2 = teval.o thv.o $(mallocobj) tpp.o tregcomp.o tregexec.o
92tobj3 = tgv.o tsv.o ttoke.o tutil.o
8d063cd8 93
a687059c 94tobj = $(tobj1) $(tobj2) $(tobj3)
8d063cd8 95
a687059c 96lintflags = -hbvxac
8d063cd8 97
98addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
99
100# grrr
101SHELL = /bin/sh
102
103.c.o:
132b68a5 104 $(CCCMD) $*.c
8d063cd8 105
79072805 106
107all: perl
108
109#all: $(public) $(private) $(util) uperl.o $(scripts)
110# cd x2p; $(MAKE) all
111# touch all
13281fa4 112
a687059c 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.
1c3d792e 115# The $& notation is tells Sequent machines that it can do a parallel make,
116# and is harmless otherwise.
13281fa4 117
79072805 118perl: $& main.o perly.o perl.o $(obj) hv.o usersub.o
119 $(CC) -Bstatic $(LARGE) $(CLDFLAGS) main.o perly.o perl.o $(obj) hv.o usersub.o $(libs) -o perl
120 echo "\a"
f1ca563b 121
79072805 122libperl.rlb: libperl.a
123 ranlib libperl.a
124 touch libperl.rlb
79220ce3 125
79072805 126libperl.a: $& perly.o perl.o $(obj) hv.o usersub.o
127 ar rcuv libperl.a $(obj) hv.o perly.o usersub.o
a687059c 128
129# This version, if specified in Configure, does ONLY those scripts which need
130# set-id emulation. Suidperl must be setuid root. It contains the "taint"
131# checks as well as the special code to validate that the script in question
132# has been invoked correctly.
13281fa4 133
79072805 134suidperl: $& sperl.o tmain.o libtperl.rlb
135 $(CC) $(LARGE) $(CLDFLAGS) sperl.o tmain.o libtperl.a $(libs) -o suidperl
13281fa4 136
a687059c 137# This version interprets scripts that are already set-id either via a wrapper
138# or through the kernel allowing set-id scripts (bad idea). Taintperl must
139# NOT be setuid to root or anything else. The only difference between it
140# and normal perl is the presence of the "taint" checks.
141
79072805 142taintperl: $& tmain.o libtperl.rlb
143 $(CC) $(LARGE) $(CLDFLAGS) tmain.o libtperl.a $(libs) -o taintperl
144
145libtperl.rlb: libtperl.a
146 ranlib libtperl.a
147 touch libtperl.rlb
148
149libtperl.a: $& tperly.o tperl.o $(tobj) thv.o usersub.o
150 ar rcuv libtperl.a $(tobj) thv.o tperly.o usersub.o tperl.o
151
152# This command assumes that /usr/include/dbz.h and /usr/lib/dbz.o exist.
153
154dbzperl: $& main.o zhv.o libperl.rlb
155 $(CC) $(LARGE) $(CLDFLAGS) main.o zhv.o /usr/lib/dbz.o libperl.a $(libs) -o dbzperl
156
157zhv.o: hv.c $(h)
158 $(RMS) zhv.c
159 $(SLN) hv.c zhv.c
160 $(CCCMD) -DWANT_DBZ zhv.c
161 $(RMS) zhv.c
162
163uperl.o: $& $(obj) main.o hv.o perly.o
164 -ld $(LARGE) $(LDFLAGS) -r $(obj) main.o hv.o perly.o -o uperl.o
165
166saber: $(saber)
167 # load $(saber)
168 # load /lib/libm.a
a687059c 169
170# Replicating all this junk is yucky, but I don't see a portable way to fix it.
171
03a14243 172tperly.o: perly.c perly.h $(h)
f1ca563b 173 $(RMS) tperly.c
a687059c 174 $(SLN) perly.c tperly.c
132b68a5 175 $(CCCMD) -DTAINT tperly.c
f1ca563b 176 $(RMS) tperly.c
a687059c 177
fe14fcc3 178tperl.o: perl.c perly.h patchlevel.h perl.h $(h)
f1ca563b 179 $(RMS) tperl.c
fe14fcc3 180 $(SLN) perl.c tperl.c
132b68a5 181 $(CCCMD) -DTAINT tperl.c
f1ca563b 182 $(RMS) tperl.c
fe14fcc3 183
184sperl.o: perl.c perly.h patchlevel.h $(h)
f1ca563b 185 $(RMS) sperl.c
fe14fcc3 186 $(SLN) perl.c sperl.c
132b68a5 187 $(CCCMD) -DTAINT -DIAMSUID sperl.c
f1ca563b 188 $(RMS) sperl.c
13281fa4 189
79072805 190tav.o: av.c $(h)
191 $(RMS) tav.c
192 $(SLN) av.c tav.c
193 $(CCCMD) -DTAINT tav.c
194 $(RMS) tav.c
a687059c 195
79072805 196tcop.o: cop.c $(h)
197 $(RMS) tcop.c
198 $(SLN) cop.c tcop.c
199 $(CCCMD) -DTAINT tcop.c
200 $(RMS) tcop.c
a687059c 201
ff2452de 202tcons.o: cons.c $(h) perly.h
f1ca563b 203 $(RMS) tcons.c
a687059c 204 $(SLN) cons.c tcons.c
132b68a5 205 $(CCCMD) -DTAINT tcons.c
f1ca563b 206 $(RMS) tcons.c
a687059c 207
79072805 208tconsop.o: consop.c $(h)
209 $(RMS) tconsop.c
210 $(SLN) consop.c tconsop.c
211 $(CCCMD) -DTAINT tconsop.c
212 $(RMS) tconsop.c
a687059c 213
79072805 214tdoop.o: doop.c $(h)
215 $(RMS) tdoop.c
216 $(SLN) doop.c tdoop.c
217 $(CCCMD) -DTAINT tdoop.c
218 $(RMS) tdoop.c
a687059c 219
03a14243 220tdoio.o: doio.c $(h)
f1ca563b 221 $(RMS) tdoio.c
a687059c 222 $(SLN) doio.c tdoio.c
132b68a5 223 $(CCCMD) -DTAINT tdoio.c
f1ca563b 224 $(RMS) tdoio.c
a687059c 225
03a14243 226tdolist.o: dolist.c $(h)
f1ca563b 227 $(RMS) tdolist.c
a687059c 228 $(SLN) dolist.c tdolist.c
132b68a5 229 $(CCCMD) -DTAINT tdolist.c
f1ca563b 230 $(RMS) tdolist.c
a687059c 231
03a14243 232tdump.o: dump.c $(h)
f1ca563b 233 $(RMS) tdump.c
a687059c 234 $(SLN) dump.c tdump.c
132b68a5 235 $(CCCMD) -DTAINT tdump.c
f1ca563b 236 $(RMS) tdump.c
a687059c 237
03a14243 238teval.o: eval.c $(h)
f1ca563b 239 $(RMS) teval.c
a687059c 240 $(SLN) eval.c teval.c
132b68a5 241 $(CCCMD) -DTAINT teval.c
f1ca563b 242 $(RMS) teval.c
a687059c 243
79072805 244thv.o: hv.c $(h)
245 $(RMS) thv.c
246 $(SLN) hv.c thv.c
247 $(CCCMD) -DTAINT thv.c
248 $(RMS) thv.c
a687059c 249
79072805 250tmain.o: main.c $(h)
251 $(RMS) tmain.c
252 $(SLN) main.c tmain.c
253 $(CCCMD) -DTAINT tmain.c
254 $(RMS) tmain.c
255
256tpp.o: pp.c $(h)
257 $(RMS) tpp.c
258 $(SLN) pp.c tpp.c
259 $(CCCMD) -DTAINT tpp.c
260 $(RMS) tpp.c
a687059c 261
03a14243 262tregcomp.o: regcomp.c $(h)
f1ca563b 263 $(RMS) tregcomp.c
a687059c 264 $(SLN) regcomp.c tregcomp.c
132b68a5 265 $(CCCMD) -DTAINT tregcomp.c
f1ca563b 266 $(RMS) tregcomp.c
a687059c 267
03a14243 268tregexec.o: regexec.c $(h)
f1ca563b 269 $(RMS) tregexec.c
a687059c 270 $(SLN) regexec.c tregexec.c
132b68a5 271 $(CCCMD) -DTAINT tregexec.c
f1ca563b 272 $(RMS) tregexec.c
a687059c 273
79072805 274tgv.o: gv.c $(h)
275 $(RMS) tgv.c
276 $(SLN) gv.c tgv.c
277 $(CCCMD) -DTAINT tgv.c
278 $(RMS) tgv.c
a687059c 279
79072805 280tsv.o: sv.c $(h) perly.h
281 $(RMS) tsv.c
282 $(SLN) sv.c tsv.c
283 $(CCCMD) -DTAINT tsv.c
284 $(RMS) tsv.c
a687059c 285
ff2452de 286ttoke.o: toke.c $(h) perly.h
f1ca563b 287 $(RMS) ttoke.c
a687059c 288 $(SLN) toke.c ttoke.c
132b68a5 289 $(CCCMD) -DTAINT ttoke.c
f1ca563b 290 $(RMS) ttoke.c
a687059c 291
03a14243 292tutil.o: util.c $(h)
f1ca563b 293 $(RMS) tutil.c
a687059c 294 $(SLN) util.c tutil.c
132b68a5 295 $(CCCMD) -DTAINT tutil.c
f1ca563b 296 $(RMS) tutil.c
8d063cd8 297
fe14fcc3 298perly.h: perly.c
ff2452de 299 @ echo Dummy dependency for dumb parallel make
300 touch perly.h
301
79072805 302embed.h: embed_h.SH global.var interp.var
303 sh embed_h.SH
304
132b68a5 305perly.c: perly.y perly.fixer
b3634b01 306 @ \
307case "$(YACC)" in \
79072805 308 *bison*) echo 'Expect' 25 shift/reduce and 53 reduce/reduce conflicts;; \
309 *) echo 'Expect' 27 shift/reduce and 51 reduce/reduce conflicts;; \
b3634b01 310esac
fe14fcc3 311 $(YACC) -d perly.y
b3634b01 312 sh $(shellflags) ./perly.fixer y.tab.c perly.c
378cc40b 313 mv y.tab.h perly.h
ff2452de 314 echo 'extern YYSTYPE yylval;' >>perly.h
8d063cd8 315
fe14fcc3 316perly.o: perly.c perly.h $(h)
132b68a5 317 $(CCCMD) perly.c
8d063cd8 318
a687059c 319install: all
7e1cf235 320 ./perl installperl
8d063cd8 321
322clean:
b3634b01 323 rm -f *.o all perl taintperl suidperl perly.c
a687059c 324 cd x2p; $(MAKE) clean
8d063cd8 325
b6ccd89c 326realclean: clean
a687059c 327 cd x2p; $(MAKE) realclean
b6ccd89c 328 rm -f *.orig */*.orig *~ */*~ core $(addedbyconf) h2ph h2ph.man
fe14fcc3 329 rm -f perly.c perly.h t/perl Makefile config.h makedepend makedir
132b68a5 330 rm -f makefile x2p/Makefile x2p/makefile cflags x2p/cflags
f1ca563b 331 rm -f c2ph pstruct
8d063cd8 332
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
336# for that spot.
337
fe14fcc3 338lint: perly.c $(c)
339 lint $(lintflags) $(defs) perly.c $(c) > perl.fuzz
8d063cd8 340
341depend: makedepend
378cc40b 342 - test -f perly.h || cp /dev/null perly.h
fdf95cbb 343 ./makedepend
378cc40b 344 - test -s perly.h || /bin/rm -f perly.h
a687059c 345 cd x2p; $(MAKE) depend
8d063cd8 346
347test: perl
fe14fcc3 348 - cd t && chmod +x TEST */*.t
b3634b01 349 - cd t && (rm -f perl; $(SLN) ../perl perl) && ./perl TEST </dev/tty
8d063cd8 350
351clist:
352 echo $(c) | tr ' ' '\012' >.clist
353
354hlist:
355 echo $(h) | tr ' ' '\012' >.hlist
356
357shlist:
358 echo $(sh) | tr ' ' '\012' >.shlist
359
360# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
79072805 361$(obj) hv.o:
8d063cd8 362 @ echo "You haven't done a "'"make depend" yet!'; exit 1
93a17b20 363
8d063cd8 364makedepend: makedepend.SH
b3634b01 365 /bin/sh $(shellflags) makedepend.SH
79072805 366