perl 5.0 alpha 3
[p5sagit/p5-mst-13.2.git] / Makefile
1 # : Makefile.SH,v 15738Revision: 4.1 15738Date: 92/08/07 17:18:08 $
2 #
3 # $Log: Makefile.SH,v $
4 # Revision 4.1  92/08/07  17:18:08  lwall
5 # Stage 6 Snapshot
6
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
11 # Revision 4.0.1.3  91/11/05  15:48:11  lwall
12 # patch11: saberized perl
13 # patch11: added support for dbz
14
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
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
24 # Revision 4.0  91/03/20  00:58:54  lwall
25 # 4.0 baseline.
26
27
28
29 CC = cc
30 YACC = /bin/yacc
31 bin = /usr/local/bin
32 scriptdir = /usr/local/bin
33 privlib = /usr/local/lib/perl
34 mansrc = /usr/man/manl
35 manext = l
36 LDFLAGS = 
37 CLDFLAGS = 
38 SMALL = 
39 LARGE =  
40 mallocsrc = malloc.c
41 mallocobj = malloc.o
42 SLN = ln -s
43 RMS = rm -f
44
45 libs = -ldbm -lm -lposix 
46
47 public = perl
48
49 shellflags = 
50
51 # To use an alternate make, set  in config.sh.
52 MAKE = make
53
54
55 CCCMD = `sh $(shellflags) cflags $@`
56
57 private = 
58
59 scripts = h2ph
60
61 manpages = perl.man h2ph.man
62
63 util =
64
65 sh = Makefile.SH makedepend.SH h2ph.SH
66
67 h1 = EXTERN.h INTERN.h av.h cop.h config.h embed.h form.h handy.h
68 h2 = hv.h op.h opcode.h perl.h regcomp.h regexp.h gv.h sv.h util.h
69
70 h = $(h1) $(h2)
71
72 c1 = av.c cop.c cons.c consop.c doop.c doio.c dolist.c
73 c2 = eval.c hv.c main.c $(mallocsrc) perl.c pp.c regcomp.c regexec.c
74 c3 = gv.c sv.c toke.c util.c usersub.c
75
76 c = $(c1) $(c2) $(c3)
77
78 s1 = av.c cop.c cons.c consop.c doop.c doio.c dolist.c
79 s2 = eval.c hv.c main.c perl.c pp.c regcomp.c regexec.c
80 s3 = gv.c sv.c toke.c util.c usersub.c perly.c
81
82 saber = $(s1) $(s2) $(s3)
83
84 obj1 = av.o scope.o op.o doop.o doio.o dolist.o dump.o
85 obj2 = $(mallocobj) mg.o pp.o regcomp.o regexec.o
86 obj3 = gv.o sv.o toke.o util.o deb.o run.o
87
88 obj = $(obj1) $(obj2) $(obj3)
89
90 tobj1 = tav.o tcop.o tcons.o tconsop.o tdoop.o tdoio.o tdolist.o tdump.o
91 tobj2 = teval.o thv.o $(mallocobj) tpp.o tregcomp.o tregexec.o
92 tobj3 = tgv.o tsv.o ttoke.o tutil.o
93
94 tobj = $(tobj1) $(tobj2) $(tobj3)
95
96 lintflags = -hbvxac
97
98 addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
99
100 # grrr
101 SHELL = /bin/sh
102
103 .c.o:
104         $(CCCMD) $*.c
105
106
107 all: perl
108
109 #all: $(public) $(private) $(util) uperl.o $(scripts)
110 #       cd x2p; $(MAKE) all
111 #       touch all
112
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.
117
118 perl: $& 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"
121
122 libperl.rlb: libperl.a
123         ranlib libperl.a
124         touch libperl.rlb
125
126 libperl.a: $& perly.o perl.o $(obj) hv.o usersub.o
127         ar rcuv libperl.a $(obj) hv.o perly.o usersub.o
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.
133
134 suidperl: $& sperl.o tmain.o libtperl.rlb
135         $(CC) $(LARGE) $(CLDFLAGS) sperl.o tmain.o libtperl.a $(libs) -o suidperl
136
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
142 taintperl: $& tmain.o libtperl.rlb
143         $(CC) $(LARGE) $(CLDFLAGS) tmain.o libtperl.a $(libs) -o taintperl
144
145 libtperl.rlb: libtperl.a
146         ranlib libtperl.a
147         touch libtperl.rlb
148
149 libtperl.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
154 dbzperl: $& main.o zhv.o libperl.rlb
155         $(CC) $(LARGE) $(CLDFLAGS) main.o zhv.o /usr/lib/dbz.o libperl.a $(libs) -o dbzperl
156
157 zhv.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
163 uperl.o: $& $(obj) main.o hv.o perly.o
164         -ld $(LARGE) $(LDFLAGS) -r $(obj) main.o hv.o perly.o -o uperl.o
165
166 saber: $(saber)
167         # load $(saber)
168         # load /lib/libm.a
169
170 # Replicating all this junk is yucky, but I don't see a portable way to fix it.
171
172 tperly.o: perly.c perly.h $(h)
173         $(RMS) tperly.c
174         $(SLN) perly.c tperly.c
175         $(CCCMD) -DTAINT tperly.c
176         $(RMS) tperly.c
177
178 tperl.o: perl.c perly.h patchlevel.h perl.h $(h)
179         $(RMS) tperl.c
180         $(SLN) perl.c tperl.c
181         $(CCCMD) -DTAINT tperl.c
182         $(RMS) tperl.c
183
184 sperl.o: perl.c perly.h patchlevel.h $(h)
185         $(RMS) sperl.c
186         $(SLN) perl.c sperl.c
187         $(CCCMD) -DTAINT -DIAMSUID sperl.c
188         $(RMS) sperl.c
189
190 tav.o: av.c $(h)
191         $(RMS) tav.c
192         $(SLN) av.c tav.c
193         $(CCCMD) -DTAINT tav.c
194         $(RMS) tav.c
195
196 tcop.o: cop.c $(h)
197         $(RMS) tcop.c
198         $(SLN) cop.c tcop.c
199         $(CCCMD) -DTAINT tcop.c
200         $(RMS) tcop.c
201
202 tcons.o: cons.c $(h) perly.h
203         $(RMS) tcons.c
204         $(SLN) cons.c tcons.c
205         $(CCCMD) -DTAINT tcons.c
206         $(RMS) tcons.c
207
208 tconsop.o: consop.c $(h)
209         $(RMS) tconsop.c
210         $(SLN) consop.c tconsop.c
211         $(CCCMD) -DTAINT tconsop.c
212         $(RMS) tconsop.c
213
214 tdoop.o: doop.c $(h)
215         $(RMS) tdoop.c
216         $(SLN) doop.c tdoop.c
217         $(CCCMD) -DTAINT tdoop.c
218         $(RMS) tdoop.c
219
220 tdoio.o: doio.c $(h)
221         $(RMS) tdoio.c
222         $(SLN) doio.c tdoio.c
223         $(CCCMD) -DTAINT tdoio.c
224         $(RMS) tdoio.c
225
226 tdolist.o: dolist.c $(h)
227         $(RMS) tdolist.c
228         $(SLN) dolist.c tdolist.c
229         $(CCCMD) -DTAINT tdolist.c
230         $(RMS) tdolist.c
231
232 tdump.o: dump.c $(h)
233         $(RMS) tdump.c
234         $(SLN) dump.c tdump.c
235         $(CCCMD) -DTAINT tdump.c
236         $(RMS) tdump.c
237
238 teval.o: eval.c $(h)
239         $(RMS) teval.c
240         $(SLN) eval.c teval.c
241         $(CCCMD) -DTAINT teval.c
242         $(RMS) teval.c
243
244 thv.o: hv.c $(h)
245         $(RMS) thv.c
246         $(SLN) hv.c thv.c
247         $(CCCMD) -DTAINT thv.c
248         $(RMS) thv.c
249
250 tmain.o: main.c $(h)
251         $(RMS) tmain.c
252         $(SLN) main.c tmain.c
253         $(CCCMD) -DTAINT tmain.c
254         $(RMS) tmain.c
255
256 tpp.o: pp.c $(h)
257         $(RMS) tpp.c
258         $(SLN) pp.c tpp.c
259         $(CCCMD) -DTAINT tpp.c
260         $(RMS) tpp.c
261
262 tregcomp.o: regcomp.c $(h)
263         $(RMS) tregcomp.c
264         $(SLN) regcomp.c tregcomp.c
265         $(CCCMD) -DTAINT tregcomp.c
266         $(RMS) tregcomp.c
267
268 tregexec.o: regexec.c $(h)
269         $(RMS) tregexec.c
270         $(SLN) regexec.c tregexec.c
271         $(CCCMD) -DTAINT tregexec.c
272         $(RMS) tregexec.c
273
274 tgv.o: gv.c $(h)
275         $(RMS) tgv.c
276         $(SLN) gv.c tgv.c
277         $(CCCMD) -DTAINT tgv.c
278         $(RMS) tgv.c
279
280 tsv.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
285
286 ttoke.o: toke.c $(h) perly.h
287         $(RMS) ttoke.c
288         $(SLN) toke.c ttoke.c
289         $(CCCMD) -DTAINT ttoke.c
290         $(RMS) ttoke.c
291
292 tutil.o: util.c $(h)
293         $(RMS) tutil.c
294         $(SLN) util.c tutil.c
295         $(CCCMD) -DTAINT tutil.c
296         $(RMS) tutil.c
297
298 perly.h: perly.c
299         @ echo Dummy dependency for dumb parallel make
300         touch perly.h
301
302 embed.h: embed_h.SH global.var interp.var
303         sh embed_h.SH
304
305 perly.c: perly.y perly.fixer
306         @ \
307 case "$(YACC)" in \
308     *bison*) echo 'Expect' 25 shift/reduce and 53 reduce/reduce conflicts;; \
309     *) echo 'Expect' 27 shift/reduce and 51 reduce/reduce conflicts;; \
310 esac
311         $(YACC) -d perly.y
312         sh $(shellflags) ./perly.fixer y.tab.c perly.c
313         mv y.tab.h perly.h
314         echo 'extern YYSTYPE yylval;' >>perly.h
315
316 perly.o: perly.c perly.h $(h)
317         $(CCCMD) perly.c
318
319 install: all
320         ./perl installperl
321
322 clean:
323         rm -f *.o all perl taintperl suidperl perly.c
324         cd x2p; $(MAKE) clean
325
326 realclean: clean
327         cd x2p; $(MAKE) realclean
328         rm -f *.orig */*.orig *~ */*~ core $(addedbyconf) h2ph h2ph.man
329         rm -f perly.c perly.h t/perl Makefile config.h makedepend makedir
330         rm -f makefile x2p/Makefile x2p/makefile cflags x2p/cflags
331         rm -f c2ph pstruct
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
338 lint: perly.c $(c)
339         lint $(lintflags) $(defs) perly.c $(c) > perl.fuzz
340
341 depend: makedepend
342         - test -f perly.h || cp /dev/null perly.h
343         ./makedepend
344         - test -s perly.h || /bin/rm -f perly.h
345         cd x2p; $(MAKE) depend
346
347 test: perl
348         - cd t && chmod +x TEST */*.t
349         - cd t && (rm -f perl; $(SLN) ../perl perl) && ./perl TEST </dev/tty
350
351 clist:
352         echo $(c) | tr ' ' '\012' >.clist
353
354 hlist:
355         echo $(h) | tr ' ' '\012' >.hlist
356
357 shlist:
358         echo $(sh) | tr ' ' '\012' >.shlist
359
360 # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
361 $(obj) hv.o:
362         @ echo "You haven't done a "'"make depend" yet!'; exit 1
363
364 makedepend: makedepend.SH
365         /bin/sh $(shellflags) makedepend.SH
366