This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl 5.0 alpha 8
[perl5.git] / Makefile.SH
CommitLineData
2304df62
AD
1case $CONFIG in
2'')
3 if test -f config.sh; then TOP=.;
4 elif test -f ../config.sh; then TOP=..;
5 elif test -f ../../config.sh; then TOP=../..;
6 elif test -f ../../../config.sh; then TOP=../../..;
7 elif test -f ../../../../config.sh; then TOP=../../../..;
8 else
9 echo "Can't find config.sh."; exit 1
10 fi
11 . $TOP/config.sh
12 ;;
13esac
14: This forces SH files to create target in same directory as SH file.
15: This is so that make depend always knows where to find SH derivatives.
16case "$0" in
17*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
18esac
19
20case "$d_symlink" in
21*define*) sln='ln -s' ;;
22*) sln='ln';;
23esac
24
25case "$d_dosuid" in
26*define*) suidperl='suidperl' ;;
27*) suidperl='';;
28esac
29
30echo "Extracting Makefile (with variable substitutions)"
31: This section of the file will have variable substitutions done on it.
32: Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!.
33: Protect any dollar signs and backticks that you do not want interpreted
34: by putting a backslash in front. You may delete these comments.
35$spitshell >Makefile <<!GROK!THIS!
36# : Makefile.SH,v 15738Revision: 4.1 15738Date: 92/08/07 17:18:08 $
37#
38# $Log: Makefile.SH,v $
39# Revision 4.1 92/08/07 17:18:08 lwall
40# Stage 6 Snapshot
41#
42# Revision 4.0.1.4 92/06/08 11:40:43 lwall
43# patch20: cray didn't give enough memory to /bin/sh
44# patch20: various and sundry fixes
45#
46# Revision 4.0.1.3 91/11/05 15:48:11 lwall
47# patch11: saberized perl
48# patch11: added support for dbz
49#
50# Revision 4.0.1.2 91/06/07 10:14:43 lwall
51# patch4: cflags now emits entire cc command except for the filename
52# patch4: alternate make programs are now semi-supported
53# patch4: uperl.o no longer tries to link in libraries prematurely
54# patch4: installperl now installs x2p stuff too
55#
56# Revision 4.0.1.1 91/04/11 17:30:39 lwall
57# patch1: C flags are now settable on a per-file basis
58#
59# Revision 4.0 91/03/20 00:58:54 lwall
60# 4.0 baseline.
61#
62#
63
64# I now supply perly.c with the kits, so don't remake perly.c without byacc
65BYACC = $byacc
66CC = $cc
67bin = $installbin
68scriptdir = $scriptdir
69privlib = $installprivlib
70mansrc = $mansrc
71manext = $manext
72LDFLAGS = $ldflags
73CLDFLAGS = $ldflags
74SMALL = $small
75LARGE = $large $split
76mallocsrc = $mallocsrc
77mallocobj = $mallocobj
78dlsrc = $dlsrc
79dlobj = $dlobj
80SLN = $sln
81RMS = rm -f
82
83libs = $libs $cryptlib
84
85public = perl $suidperl
86
87shellflags = $shellflags
88
89# To use an alternate make, set $altmake in config.sh.
90MAKE = ${altmake-make}
91!GROK!THIS!
92
93: In the following dollars and backticks do not need the extra backslash.
94$spitshell >>Makefile <<'!NO!SUBS!'
95
96CCCMD = `sh $(shellflags) cflags $@`
97
98private =
99
100scripts = h2ph
101
102manpages = perl.man h2ph.man
103
104util =
105
106sh = Makefile.SH makedepend.SH h2ph.SH
107
108h1 = EXTERN.h INTERN.h av.h cop.h config.h embed.h form.h handy.h
109h2 = hv.h op.h opcode.h perl.h regcomp.h regexp.h gv.h sv.h util.h
110
111h1 = EXTERN.h INTERN.h XSUB.h av.h config.h cop.h cv.h dosish.h
112h2 = embed.h form.h gv.h handy.h hv.h hvdbm.h keywords.h mg.h op.h
113h3 = opcode.h patchlevel.h perl.h perly.h pp.h proto.h regcomp.h
114h4 = regexp.h scope.h sv.h unixish.h util.h
115h = $(h1) $(h2) $(h3) $(h4)
116
117c1 = av.c scope.c op.c doop.c doio.c dump.c hv.c
118c2 = $(mallocsrc) mg.c perly.c pp.c regcomp.c regexec.c
119c3 = gv.c sv.c taint.c toke.c util.c deb.c run.c
120
121c = $(c1) $(c2) $(c3)
122
123s1 = av.c scope.c op.c doop.c doio.c dump.c hv.c
124s2 = $(mallocobj) mg.c perly.c pp.c regcomp.c regexec.c
125s3 = gv.c sv.c taint.c toke.c util.c deb.c run.c perly.c
126
127saber = $(s1) $(s2) $(s3)
128
129obj1 = av.o scope.o op.o doop.o doio.o dump.o hv.o
130obj2 = $(mallocobj) mg.o perly.o pp.o regcomp.o regexec.o
131obj3 = gv.o sv.o taint.o toke.o util.o deb.o run.o
132
133obj = $(obj1) $(obj2) $(obj3) $(dlobj)
134
135lintflags = -hbvxac
136
137addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
138
139# grrr
140SHELL = /bin/sh
141
142.SUFFIXES: .x
143
144.c.o:
145 $(CCCMD) $*.c
146
147.x.c:
148 sh writemain $*.x >$*.c
149
150all: miniperl perl lib/Config.pm
151
152#all: $(public) $(private) $(util) $(scripts)
153# cd x2p; $(MAKE) all
154# touch all
155!NO!SUBS!
156###
157### Boilerplate for all the .xs files in the ext directory.
158### XXX FIXME: At some point we also need to copy .pm files out of
159### XXX the ext directory into lib.
160# Configure sets extensions to a string like
161# "ext/dbm/NDBM_File.xs ext/dbm/ODBM_File.xs ext/dbm/GDBM_File.xs \
162# ext/dbm/SDBM_File.xs ext/posix/POSIX.xs"
163extobjs=" "
164for f in $extensions
165do
166 base=`basename $f .xs`
167 dir=`dirname $f`
168 extobjs="$extobjs $f.o"
169 $spitshell >>Makefile <<!GROK!THIS!
170
171# $base extension
172$base.c: $f ext/xsubpp ext/typemap
173 test -f miniperl || make miniperl
174 ext/xsubpp $f >tmp
175 mv tmp $base.c
176
177$base.o: $base.c
178!GROK!THIS!
179
180 case $base in
181 SDBM_File) $spitshell >>Makefile <<'!NO!SUBS!'
182
183lib/auto/SDBM_File/SDBM_File.so: SDBM_File.o ext/dbm/sdbm/libsdbm.a
184 @- mkdir lib/auto/SDBM_File 2>/dev/null
185 ld -o lib/auto/SDBM_File/SDBM_File.so SDBM_File.o ext/dbm/sdbm/libsdbm.a
186
187ext/dbm/sdbm/libsdbm.a: ext/dbm/sdbm/sdbm.c ext/dbm/sdbm/sdbm.h
188 cd ext/dbm/sdbm; $(MAKE) sdbm
189!NO!SUBS!
190 ;;
191 POSIX) $spitshell >>Makefile <<'!NO!SUBS!'
192lib/auto/POSIX/POSIX.so: POSIX.o ext/dbm/sdbm/libsdbm.a
193 @- mkdir lib/auto/POSIX 2>/dev/null
194 ld -o lib/auto/POSIX/POSIX.so POSIX.o ext/dbm/sdbm/libsdbm.a
195!NO!SUBS!
196 ;;
197 esac
198done
199
200echo "extobjs=$extobjs" >> Makefile
201
202$spitshell >>Makefile <<'!NO!SUBS!'
203# The $& notation tells Sequent machines that it can do a parallel make,
204# and is harmless otherwise.
205
206miniperlmain.c: miniperlmain.x
207miniperlmain.o: miniperlmain.c
208miniperl: $& miniperlmain.o perl.o $(obj)
209 $(CC) $(LARGE) $(CLDFLAGS) -o miniperl miniperlmain.o perl.o $(obj) $(libs)
210
211perlmain.c: perlmain.x
212perlmain.o: perlmain.c
213perl: $& perlmain.o perl.o $(obj) NDBM_File.o ODBM_File.o POSIX.o
214 $(CC) $(LARGE) $(CLDFLAGS) -o perl perlmain.o perl.o $(obj) NDBM_File.o ODBM_File.o POSIX.o $(libs)
215
216libperl.rlb: libperl.a
217 ranlib libperl.a
218 touch libperl.rlb
219
220libperl.a: $& perl.o $(obj)
221 ar rcuv libperl.a $(obj)
222
223# This version, if specified in Configure, does ONLY those scripts which need
224# set-id emulation. Suidperl must be setuid root. It contains the "taint"
225# checks as well as the special code to validate that the script in question
226# has been invoked correctly.
227
228suidperl: $& sperl.o main.o libperl.rlb
229 $(CC) $(LARGE) $(CLDFLAGS) sperl.o main.o libperl.a $(libs) -o suidperl
230
231lib/Config.pm: config.sh
232 ./configpm
233
234saber: $(saber)
235 # load $(saber)
236 # load /lib/libm.a
237
238sperl.o: perl.c perly.h patchlevel.h $(h)
239 $(RMS) sperl.c
240 $(SLN) perl.c sperl.c
241 $(CCCMD) -DIAMSUID sperl.c
242 $(RMS) sperl.c
243
244dl.o: ext/dl/dl.c
245 cp ext/dl/dl.c dl.c
246 $(CC) -c dl.c
247
248!NO!SUBS!
249
250### Now on to the rest of the Makefile.
251$spitshell >>Makefile <<'!NO!SUBS!'
252
253perly.h: perly.c
254 @ echo Dummy dependency for dumb parallel make
255 touch perly.h
256
257opcode.h: opcode.pl
258 - opcode.pl
259
260embed.h: embed_h.SH global.sym interp.sym
261 sh embed_h.SH
262
263perly.c:
264 @ echo 'Expect' 80 shift/reduce and 62 reduce/reduce conflicts
265 $(BYACC) -d perly.y
266 sh $(shellflags) ./perly.fixer y.tab.c perly.c
267 mv y.tab.h perly.h
268 echo 'extern YYSTYPE yylval;' >>perly.h
269
270perly.o: perly.c perly.h $(h)
271 $(CCCMD) perly.c
272
273install: all
274 ./perl installperl
275
276clean:
277 rm -f *.o all perl taintperl suidperl miniperl
278 cd x2p; $(MAKE) clean
279
280realclean: clean
281 cd x2p; $(MAKE) realclean
282 rm -f *.orig */*.orig *~ */*~ core $(addedbyconf) h2ph h2ph.man
283 rm -f perly.h t/perl Makefile config.h makedepend makedir
284 rm -f makefile x2p/Makefile x2p/makefile cflags x2p/cflags
285 rm -f c2ph pstruct
286
287# The following lint has practically everything turned on. Unfortunately,
288# you have to wade through a lot of mumbo jumbo that can't be suppressed.
289# If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
290# for that spot.
291
292lint: perly.c $(c)
293 lint $(lintflags) $(defs) perly.c $(c) > perl.fuzz
294
295depend: makedepend
296 - test -f perly.h || cp /dev/null perly.h
297 ./makedepend
298 - test -s perly.h || /bin/rm -f perly.h
299 cd x2p; $(MAKE) depend
300
301test: perl
302 - cd t && chmod +x TEST */*.t
303 - cd t && (rm -f perl; $(SLN) ../perl perl) && ./perl TEST </dev/tty
304
305clist:
306 echo $(c) | tr ' ' '\012' >.clist
307
308hlist:
309 echo $(h) | tr ' ' '\012' >.hlist
310
311shlist:
312 echo $(sh) | tr ' ' '\012' >.shlist
313
314# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
315# If this runs make out of memory, delete /usr/include lines.
316!NO!SUBS!
317
318$eunicefix Makefile4
319case `pwd` in
320*SH)
321 $rm -f ../Makefile4
322 ln Makefile4 ../Makefile4
323 ;;
324esac
325rm -f makefile