perl 5.0 alpha 8
[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
2304df62 29# I now supply perly.c with the kits, so don't remake perly.c without byacc
30BYACC = byacc
79072805 31CC = cc
79072805 32bin = /usr/local/bin
33scriptdir = /usr/local/bin
34privlib = /usr/local/lib/perl
2304df62 35mansrc = /usr/local/man/man1
36manext = 1
79072805 37LDFLAGS =
38CLDFLAGS =
39SMALL =
40LARGE =
41mallocsrc = malloc.c
42mallocobj = malloc.o
2304df62 43dlsrc = dl.c
44dlobj = dl.o
79072805 45SLN = ln -s
f1ca563b 46RMS = rm -f
8d063cd8 47
2304df62 48libs = -ldbm -ldl -lm -lposix
8d063cd8 49
2304df62 50public = perl
b3634b01 51
79072805 52shellflags =
132b68a5 53
79072805 54# To use an alternate make, set in config.sh.
55MAKE = make
8d063cd8 56
b3634b01 57CCCMD = `sh $(shellflags) cflags $@`
1c3d792e 58
8d063cd8 59private =
60
79220ce3 61scripts = h2ph
62
79220ce3 63manpages = perl.man h2ph.man
8d063cd8 64
65util =
66
79220ce3 67sh = Makefile.SH makedepend.SH h2ph.SH
8d063cd8 68
79072805 69h1 = EXTERN.h INTERN.h av.h cop.h config.h embed.h form.h handy.h
70h2 = hv.h op.h opcode.h perl.h regcomp.h regexp.h gv.h sv.h util.h
8d063cd8 71
2304df62 72h1 = EXTERN.h INTERN.h XSUB.h av.h config.h cop.h cv.h dosish.h
73h2 = embed.h form.h gv.h handy.h hv.h hvdbm.h keywords.h mg.h op.h
74h3 = opcode.h patchlevel.h perl.h perly.h pp.h proto.h regcomp.h
75h4 = regexp.h scope.h sv.h unixish.h util.h
76h = $(h1) $(h2) $(h3) $(h4)
8d063cd8 77
2304df62 78c1 = av.c scope.c op.c doop.c doio.c dump.c hv.c
79c2 = $(mallocsrc) mg.c perly.c pp.c regcomp.c regexec.c
80c3 = gv.c sv.c taint.c toke.c util.c deb.c run.c
a687059c 81
82c = $(c1) $(c2) $(c3)
83
2304df62 84s1 = av.c scope.c op.c doop.c doio.c dump.c hv.c
85s2 = $(mallocobj) mg.c perly.c pp.c regcomp.c regexec.c
86s3 = gv.c sv.c taint.c toke.c util.c deb.c run.c perly.c
f1ca563b 87
88saber = $(s1) $(s2) $(s3)
89
2304df62 90obj1 = av.o scope.o op.o doop.o doio.o dump.o hv.o
91obj2 = $(mallocobj) mg.o perly.o pp.o regcomp.o regexec.o
92obj3 = gv.o sv.o taint.o toke.o util.o deb.o run.o
8d063cd8 93
2304df62 94obj = $(obj1) $(obj2) $(obj3) $(dlobj)
8d063cd8 95
a687059c 96lintflags = -hbvxac
8d063cd8 97
98addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
99
100# grrr
101SHELL = /bin/sh
102
2304df62 103.SUFFIXES: .x
104
8d063cd8 105.c.o:
132b68a5 106 $(CCCMD) $*.c
8d063cd8 107
2304df62 108.x.c:
109 sh writemain $*.x >$*.c
79072805 110
2304df62 111all: miniperl perl lib/Config.pm
79072805 112
2304df62 113#all: $(public) $(private) $(util) $(scripts)
79072805 114# cd x2p; $(MAKE) all
115# touch all
13281fa4 116
2304df62 117# NDBM_File extension
118NDBM_File.c: ext/dbm/NDBM_File.xs ext/xsubpp ext/typemap
119 test -f miniperl || make miniperl
120 ext/xsubpp ext/dbm/NDBM_File.xs >tmp
121 mv tmp NDBM_File.c
122
123NDBM_File.o: NDBM_File.c
124
125# ODBM_File extension
126ODBM_File.c: ext/dbm/ODBM_File.xs ext/xsubpp ext/typemap
127 test -f miniperl || make miniperl
128 ext/xsubpp ext/dbm/ODBM_File.xs >tmp
129 mv tmp ODBM_File.c
130
131ODBM_File.o: ODBM_File.c
132
133# GDBM_File extension
134GDBM_File.c: ext/dbm/GDBM_File.xs ext/xsubpp ext/typemap
135 test -f miniperl || make miniperl
136 ext/xsubpp ext/dbm/GDBM_File.xs >tmp
137 mv tmp GDBM_File.c
138
139GDBM_File.o: GDBM_File.c
140
141# SDBM_File extension
142SDBM_File.c: ext/dbm/SDBM_File.xs ext/xsubpp ext/typemap
143 test -f miniperl || make miniperl
144 ext/xsubpp ext/dbm/SDBM_File.xs >tmp
145 mv tmp SDBM_File.c
146
147SDBM_File.o: SDBM_File.c
148
149lib/auto/SDBM_File/SDBM_File.so: SDBM_File.o ext/dbm/sdbm/libsdbm.a
150 @- mkdir lib/auto/SDBM_File 2>/dev/null
151 ld -o lib/auto/SDBM_File/SDBM_File.so SDBM_File.o ext/dbm/sdbm/libsdbm.a
152
153ext/dbm/sdbm/libsdbm.a: ext/dbm/sdbm/sdbm.c ext/dbm/sdbm/sdbm.h
154 cd ext/dbm/sdbm; $(MAKE) sdbm
155
156# POSIX extension
157POSIX.c: ext/posix/POSIX.xs ext/xsubpp ext/typemap
158 test -f miniperl || make miniperl
159 ext/xsubpp ext/posix/POSIX.xs >tmp
160 mv tmp POSIX.c
161
162POSIX.o: POSIX.c
163lib/auto/POSIX/POSIX.so: POSIX.o ext/dbm/sdbm/libsdbm.a
164 @- mkdir lib/auto/POSIX 2>/dev/null
165 ld -o lib/auto/POSIX/POSIX.so POSIX.o ext/dbm/sdbm/libsdbm.a
166extobjs= ext/dbm/NDBM_File.xs.o ext/dbm/ODBM_File.xs.o ext/dbm/GDBM_File.xs.o ext/dbm/SDBM_File.xs.o ext/posix/POSIX.xs.o
167# The $& notation tells Sequent machines that it can do a parallel make,
1c3d792e 168# and is harmless otherwise.
13281fa4 169
2304df62 170miniperlmain.c: miniperlmain.x
171miniperlmain.o: miniperlmain.c
172miniperl: $& miniperlmain.o perl.o $(obj)
173 $(CC) $(LARGE) $(CLDFLAGS) -o miniperl miniperlmain.o perl.o $(obj) $(libs)
174
175perlmain.c: perlmain.x
176perlmain.o: perlmain.c
177perl: $& perlmain.o perl.o $(obj) NDBM_File.o ODBM_File.o POSIX.o
178 $(CC) $(LARGE) $(CLDFLAGS) -o perl perlmain.o perl.o $(obj) NDBM_File.o ODBM_File.o POSIX.o $(libs)
f1ca563b 179
79072805 180libperl.rlb: libperl.a
181 ranlib libperl.a
182 touch libperl.rlb
79220ce3 183
2304df62 184libperl.a: $& perl.o $(obj)
185 ar rcuv libperl.a $(obj)
a687059c 186
187# This version, if specified in Configure, does ONLY those scripts which need
188# set-id emulation. Suidperl must be setuid root. It contains the "taint"
189# checks as well as the special code to validate that the script in question
190# has been invoked correctly.
13281fa4 191
2304df62 192suidperl: $& sperl.o main.o libperl.rlb
193 $(CC) $(LARGE) $(CLDFLAGS) sperl.o main.o libperl.a $(libs) -o suidperl
79072805 194
2304df62 195lib/Config.pm: config.sh
196 ./configpm
79072805 197
198saber: $(saber)
199 # load $(saber)
200 # load /lib/libm.a
a687059c 201
fe14fcc3 202sperl.o: perl.c perly.h patchlevel.h $(h)
f1ca563b 203 $(RMS) sperl.c
fe14fcc3 204 $(SLN) perl.c sperl.c
2304df62 205 $(CCCMD) -DIAMSUID sperl.c
f1ca563b 206 $(RMS) sperl.c
13281fa4 207
2304df62 208dl.o: ext/dl/dl.c
209 cp ext/dl/dl.c dl.c
210 $(CC) -c dl.c
8d063cd8 211
2304df62 212
fe14fcc3 213perly.h: perly.c
ff2452de 214 @ echo Dummy dependency for dumb parallel make
215 touch perly.h
216
2304df62 217opcode.h: opcode.pl
218 - opcode.pl
219
220embed.h: embed_h.SH global.sym interp.sym
79072805 221 sh embed_h.SH
222
2304df62 223perly.c:
224 @ echo 'Expect' 80 shift/reduce and 62 reduce/reduce conflicts
225 $(BYACC) -d perly.y
b3634b01 226 sh $(shellflags) ./perly.fixer y.tab.c perly.c
378cc40b 227 mv y.tab.h perly.h
ff2452de 228 echo 'extern YYSTYPE yylval;' >>perly.h
8d063cd8 229
fe14fcc3 230perly.o: perly.c perly.h $(h)
132b68a5 231 $(CCCMD) perly.c
8d063cd8 232
a687059c 233install: all
7e1cf235 234 ./perl installperl
8d063cd8 235
236clean:
2304df62 237 rm -f *.o all perl taintperl suidperl miniperl
a687059c 238 cd x2p; $(MAKE) clean
8d063cd8 239
b6ccd89c 240realclean: clean
a687059c 241 cd x2p; $(MAKE) realclean
b6ccd89c 242 rm -f *.orig */*.orig *~ */*~ core $(addedbyconf) h2ph h2ph.man
2304df62 243 rm -f perly.h t/perl Makefile config.h makedepend makedir
132b68a5 244 rm -f makefile x2p/Makefile x2p/makefile cflags x2p/cflags
f1ca563b 245 rm -f c2ph pstruct
8d063cd8 246
247# The following lint has practically everything turned on. Unfortunately,
248# you have to wade through a lot of mumbo jumbo that can't be suppressed.
249# If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
250# for that spot.
251
fe14fcc3 252lint: perly.c $(c)
253 lint $(lintflags) $(defs) perly.c $(c) > perl.fuzz
8d063cd8 254
255depend: makedepend
378cc40b 256 - test -f perly.h || cp /dev/null perly.h
fdf95cbb 257 ./makedepend
378cc40b 258 - test -s perly.h || /bin/rm -f perly.h
a687059c 259 cd x2p; $(MAKE) depend
8d063cd8 260
261test: perl
fe14fcc3 262 - cd t && chmod +x TEST */*.t
b3634b01 263 - cd t && (rm -f perl; $(SLN) ../perl perl) && ./perl TEST </dev/tty
8d063cd8 264
265clist:
266 echo $(c) | tr ' ' '\012' >.clist
267
268hlist:
269 echo $(h) | tr ' ' '\012' >.hlist
270
271shlist:
272 echo $(sh) | tr ' ' '\012' >.shlist
273
274# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
2304df62 275# If this runs make out of memory, delete /usr/include lines.