This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
more thorough cleaning of arenas--keep going until no more
[perl5.git] / Makefile.SH
CommitLineData
599a829f 1#! /bin/sh
2000072c 2case $CONFIGDOTSH in
2304df62
AD
3'')
4 if 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 elif test -f ../../../../config.sh; then TOP=../../../..;
9 else
10 echo "Can't find config.sh."; exit 1
11 fi
12 . $TOP/config.sh
13 ;;
14esac
15: This forces SH files to create target in same directory as SH file.
16: This is so that make depend always knows where to find SH derivatives.
17case "$0" in
18*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
19esac
20
2304df62
AD
21case "$d_dosuid" in
22*define*) suidperl='suidperl' ;;
23*) suidperl='';;
24esac
25
d5d19f97 26linklibperl='$(LIBPERL)'
3c321fdc 27shrpldflags='$(LDDLFLAGS)'
6ee623d5 28ldlibpth=''
daa992e6 29DPERL_EXTERNAL_GLOB='-DPERL_EXTERNAL_GLOB'
d96ebe2e 30case "$useshrplib" in
31true)
6ee623d5 32 # Prefix all runs of 'miniperl' and 'perl' with
5cf1d1f1 33 # $ldlibpth so that ./perl finds *this* shared libperl.
c1b49bc0
GS
34 case "$LD_LIBRARY_PATH" in
35 '')
36 ldlibpth="LD_LIBRARY_PATH=`pwd`";;
37 *)
38 ldlibpth="LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}";;
39 esac
6ee623d5 40
d5d19f97 41 pldlflags="$cccdlflags"
d96ebe2e 42 case "${osname}${osvers}" in
43 next4*)
3c321fdc 44 ld=libtool
45 lddlflags="-dynamic -undefined warning -framework System \
46 -compatibility_version 1 -current_version $patchlevel \
47 -prebind -seg1addr 0x27000000 -install_name \$(shrpdir)/\$@"
6ee623d5 48 ;;
f556e5b9
JH
49 rhapsody*|darwin*)
50 shrpldflags="${ldflags} -dynamiclib \
51 -compatibility_version 1 \
52 -current_version \
53 ${api_version}.${api_subversion} \
54 -image_base 0x4be00000 \
55 -install_name \$(shrpdir)/\$@"
56 ;;
5cf1d1f1 57 cygwin*)
8736538c
AS
58 linklibperl="-lperl"
59 ;;
73d40b3e 60 sunos*)
d5d19f97
UP
61 linklibperl="-lperl"
62 ;;
43039de7 63 netbsd*|freebsd[234]*|openbsd*)
099685bc
JH
64 linklibperl="-L. -lperl"
65 ;;
3c321fdc 66 aix*)
67 shrpldflags="-H512 -T512 -bhalt:4 -bM:SRE -bE:perl.exp"
1553ab04 68 case "$osvers" in
549a6b10 69 3*) shrpldflags="$shrpldflags -e _nostart"
1553ab04 70 ;;
549a6b10 71 *) shrpldflags="$shrpldflags -b noentry"
1553ab04
TB
72 ;;
73 esac
d6f4130b 74 shrpldflags="$shrpldflags $ldflags $perllibs $cryptlib"
549a6b10 75 linklibperl="-L $archlibexp/CORE -L `pwd | sed 's/\/UU$//'` -lperl"
3c321fdc 76 ;;
1c7d1a19
GS
77 hpux*)
78 linklibperl="-L `pwd | sed 's/\/UU$//'` -Wl,+s -Wl,+b$archlibexp/CORE -lperl"
46193409 79 ;;
daa992e6 80 os390*)
2f41d0a8
JH
81 shrpldflags='-W l,dll'
82 linklibperl='libperl.x'
83 DPERL_EXTERNAL_GLOB=''
84 ;;
655635e8 85 esac
5cf1d1f1
JH
86 case "$ldlibpthname" in
87 '') ;;
88 *)
89 case "$osname" in
90 os2)
91 ldlibpth=''
92 ;;
5cf1d1f1
JH
93 *)
94 eval "ldlibpth=\"$ldlibpthname=`pwd`:\$$ldlibpthname\""
95 ;;
96 esac
c1b49bc0
GS
97 # Strip off any trailing :'s
98 ldlibpth=`echo $ldlibpth | sed 's/:*$//'`
5cf1d1f1
JH
99 ;;
100 esac
d5d19f97 101 ;;
f0efd8cf 102*) pldlflags=''
d96ebe2e 103 ;;
ecfc5424
AD
104esac
105
a0d0e21e
LW
106: Prepare dependency lists for Makefile.
107dynamic_list=' '
108for f in $dynamic_ext; do
109 : the dependency named here will never exist
ecfc5424 110 base=`echo "$f" | sed 's/.*\///'`
75f92628 111 dynamic_list="$dynamic_list lib/auto/$f/$base.$dlext"
a0d0e21e
LW
112done
113
114static_list=' '
a0d0e21e
LW
115for f in $static_ext; do
116 base=`echo "$f" | sed 's/.*\///'`
cd4d8a96 117 static_list="$static_list lib/auto/$f/$base\$(LIB_EXT)"
a0d0e21e
LW
118done
119
4318d5a0
GB
120nonxs_list=' '
121for f in $nonxs_ext; do
122 base=`echo "$f" | sed 's/.*\///'`
123 nonxs_list="$nonxs_list ext/$f/pm_to_blib"
124done
125
791ece1b
TD
126# Handle the usage of different yaccs in posix-bc (During Configure we
127# us yacc for perly.y and byacc for a2p.y. The makefiles must use the
128# same configuration for run_byacc!):
129case "$osname" in
130 posix-bc)
131 byacc=$yacc
132 ;;
133esac
134
2304df62 135echo "Extracting Makefile (with variable substitutions)"
655635e8 136$spitshell >Makefile <<!GROK!THIS!
a0d0e21e 137# Makefile.SH
85e6fe83
LW
138# This file is derived from Makefile.SH. Any changes made here will
139# be lost the next time you run Configure.
655635e8 140# Makefile is used to generate $firstmakefile. The only difference
141# is that $firstmakefile has the dependencies filled in at the end.
2304df62 142#
fed7345c 143#
2304df62
AD
144# I now supply perly.c with the kits, so don't remake perly.c without byacc
145BYACC = $byacc
146CC = $cc
232e078e 147LD = $ld
16d20bd9 148
2304df62
AD
149LDFLAGS = $ldflags
150CLDFLAGS = $ldflags
85e6fe83 151
2304df62
AD
152mallocsrc = $mallocsrc
153mallocobj = $mallocobj
85e6fe83 154LNS = $lns
57458f80 155CPS = $cp -f
2304df62 156RMS = rm -f
85e6fe83
LW
157ranlib = $ranlib
158
16d20bd9
AD
159# The following are mentioned only to make metaconfig include the
160# appropriate questions in Configure. If you want to change these,
8e07c86e 161# edit config.sh instead, or specify --man1dir=/wherever on
16d20bd9
AD
162# installman commandline.
163bin = $installbin
164scriptdir = $scriptdir
d96ebe2e 165shrpdir = $archlibexp/CORE
16d20bd9
AD
166privlib = $installprivlib
167man1dir = $man1dir
168man1ext = $man1ext
169man3dir = $man3dir
170man3ext = $man3ext
171
85e6fe83
LW
172# The following are used to build and install shared libraries for
173# dynamic loading.
174LDDLFLAGS = $lddlflags
3c321fdc 175SHRPLDFLAGS = $shrpldflags
85e6fe83 176CCDLFLAGS = $ccdlflags
a0d0e21e 177DLSUFFIX = .$dlext
ecfc5424 178PLDLFLAGS = $pldlflags
d96ebe2e 179LIBPERL = $libperl
d5d19f97 180LLIBPERL= $linklibperl
ecfc5424 181SHRPENV = $shrpenv
a0d0e21e 182
6ee623d5 183# The following is used to include the current directory in
5cf1d1f1 184# the dynamic loader path you are building a shared libperl.
6ee623d5
GS
185LDLIBPTH = $ldlibpth
186
a0d0e21e
LW
187dynamic_ext = $dynamic_list
188static_ext = $static_list
4318d5a0
GB
189nonxs_ext = $nonxs_list
190ext = \$(dynamic_ext) \$(static_ext) \$(nonxs_ext)
cd4d8a96 191DYNALOADER = lib/auto/DynaLoader/DynaLoader\$(LIB_EXT)
2304df62 192
d6f4130b 193libs = $perllibs $cryptlib
2304df62 194
909b3858 195public = perl $suidperl utilities translators
2304df62
AD
196
197shellflags = $shellflags
198
d96ebe2e 199# This is set to MAKE=$make if your $make command doesn't
200# do it for you.
201$make_set_make
4633a7c4 202
dfe9444c 203# These variables may need to be manually set for non-Unix systems.
ccc7f9b3 204AR = $full_ar
dfe9444c
AD
205EXE_EXT = $_exe
206LIB_EXT = $_a
207OBJ_EXT = $_o
208PATH_SEP = $p_
4633a7c4
LW
209
210FIRSTMAKEFILE = $firstmakefile
211
212# Any special object files needed by this architecture, e.g. os2/os2.obj
213ARCHOBJS = $archobjs
214
cd4d8a96 215.SUFFIXES: .c \$(OBJ_EXT)
216
d96ebe2e 217# grrr
218SHELL = $sh
655635e8 219
28e8609d
JH
220# how to tr(anslate) newlines
221TRNL = '$trnl'
222
72d299db 223!GROK!THIS!
b7b35fc2 224# not used by Makefile but by installperl;
72d299db
GS
225# mentioned here so that metaconfig picks these up
226# $installusrbinperl
227# $versiononly
b7b35fc2 228
2304df62 229
85e6fe83 230## In the following dollars and backticks do not need the extra backslash.
2304df62
AD
231$spitshell >>Makefile <<'!NO!SUBS!'
232
d96ebe2e 233CCCMD = `sh $(shellflags) cflags $(LIBPERL) $@`
2304df62 234
fed7345c 235private = preplibrary lib/ExtUtils/Miniperl.pm lib/Config.pm
2304df62 236
4633a7c4
LW
237# Files to be built with variable substitution before miniperl
238# is available.
239sh = Makefile.SH cflags.SH config_h.SH makeaperl.SH makedepend.SH \
b0bd187b 240 makedir.SH myconfig.SH writemain.SH pod/Makefile.SH
4633a7c4 241
b0bd187b
GS
242shextract = Makefile cflags config.h makeaperl makedepend \
243 makedir myconfig writemain pod/Makefile
4633a7c4
LW
244
245# Files to be built with variable substitution after miniperl is
246# available. Dependencies handled manually below (for now).
2304df62 247
efb12ca0 248pl = pod/pod2html.PL pod/pod2latex.PL pod/pod2man.PL pod/pod2text.PL \
b0bd187b
GS
249 pod/pod2usage.PL pod/podchecker.PL pod/podselect.PL \
250 pod/buildtoc.PL
4633a7c4 251
efb12ca0 252plextract = pod/pod2html pod/pod2latex pod/pod2man pod/pod2text \
b0bd187b
GS
253 pod/pod2usage pod/podchecker pod/podselect \
254 pod/buildtoc
4633a7c4 255
247fdecf 256addedbyconf = UU $(shextract) $(plextract) pstruct
2304df62 257
fed7345c 258h1 = EXTERN.h INTERN.h XSUB.h av.h config.h cop.h cv.h dosish.h
a0d0e21e 259h2 = embed.h form.h gv.h handy.h hv.h keywords.h mg.h op.h
6f4183fe 260h3 = opcode.h patchlevel.h perl.h perlapi.h perly.h pp.h proto.h regcomp.h
219f41b1 261h4 = regexp.h scope.h sv.h unixish.h util.h iperlsys.h thread.h
4438c4b7 262h5 = utf8.h warnings.h
33b839e2 263h = $(h1) $(h2) $(h3) $(h4) $(h5)
2304df62 264
e8edd1e6 265c1 = $(mallocsrc) av.c scope.c op.c doop.c doio.c dump.c hv.c mg.c
a0ed51b3 266c2 = perl.c perly.c pp.c pp_hot.c pp_ctl.c pp_sys.c regcomp.c regexec.c utf8.c
09bef843 267c3 = gv.c sv.c taint.c toke.c util.c deb.c run.c universal.c xsutils.c
6f4183fe 268c4 = globals.c perlio.c perlapi.c
2304df62 269
09bef843 270c = $(c1) $(c2) $(c3) $(c4) miniperlmain.c perlmain.c
2304df62 271
e8edd1e6 272obj1 = $(mallocobj) gv$(OBJ_EXT) toke$(OBJ_EXT) perly$(OBJ_EXT) op$(OBJ_EXT) regcomp$(OBJ_EXT) dump$(OBJ_EXT) util$(OBJ_EXT) mg$(OBJ_EXT)
cd4d8a96 273obj2 = hv$(OBJ_EXT) av$(OBJ_EXT) run$(OBJ_EXT) pp_hot$(OBJ_EXT) sv$(OBJ_EXT) pp$(OBJ_EXT) scope$(OBJ_EXT) pp_ctl$(OBJ_EXT) pp_sys$(OBJ_EXT)
6f4183fe 274obj3 = doop$(OBJ_EXT) doio$(OBJ_EXT) regexec$(OBJ_EXT) utf8$(OBJ_EXT) taint$(OBJ_EXT) deb$(OBJ_EXT) universal$(OBJ_EXT) xsutils$(OBJ_EXT) globals$(OBJ_EXT) perlio$(OBJ_EXT) perlapi$(OBJ_EXT)
655635e8 275
4633a7c4 276obj = $(obj1) $(obj2) $(obj3) $(ARCHOBJS)
2304df62 277
a0d0e21e
LW
278# Once perl has been Configure'd and built ok you build different
279# perl variants (Debugging, Embedded, Multiplicity etc) by saying:
d96ebe2e 280# make clean; make LIBPERL=libperl<type>.a
a0d0e21e
LW
281# where <type> is some combination of 'd' and(or) 'e' or 'm'.
282# See cflags to understand how this works.
283#
d96ebe2e 284# This mechanism is getting clunky and might not even work any more.
285# EMBEDDING is on by default, and MULTIPLICITY doesn't work.
286#
a0d0e21e 287
2304df62
AD
288lintflags = -hbvxac
289
cd4d8a96 290.c$(OBJ_EXT):
d96ebe2e 291 $(CCCMD) $(PLDLFLAGS) $*.c
2304df62 292
b1a1e9f1 293all: $(FIRSTMAKEFILE) miniperl extra.pods $(private) $(public) $(dynamic_ext) $(nonxs_ext)
248e23d9
GS
294 @echo " ";
295 @echo " Everything is up to date. 'make test' to run test suite."
909b3858 296
6ee623d5
GS
297compile: all
298 echo "testing compilation" > testcompile;
299 cd utils; $(MAKE) compile;
300 cd x2p; $(MAKE) compile;
301 cd pod; $(MAKE) compile;
302
909b3858 303translators: miniperl lib/Config.pm FORCE
6ee623d5 304 @echo " "; echo " Making x2p stuff"; cd x2p; $(LDLIBPTH) $(MAKE) all
8e07c86e 305
247fdecf 306utilities: miniperl lib/Config.pm $(plextract) FORCE
6ee623d5 307 @echo " "; echo " Making utilities"; cd utils; $(LDLIBPTH) $(MAKE) all
909b3858 308
309
16d20bd9
AD
310# This is now done by installman only if you actually want the man pages.
311# @echo " "; echo " Making docs"; cd pod; $(MAKE) all;
85e6fe83
LW
312
313# Phony target to force checking subdirectories.
e50aee73 314# Apparently some makes require an action for the FORCE target.
85e6fe83 315FORCE:
4633a7c4 316 @sh -c true
2f41d0a8 317!NO!SUBS!
85e6fe83 318
daa992e6
PP
319$spitshell >>Makefile <<!GROK!THIS!
320opmini\$(OBJ_EXT): op.c config.h
321 \$(RMS) opmini.c
322 \$(LNS) op.c opmini.c
323 \$(CCCMD) \$(PLDLFLAGS) $DPERL_EXTERNAL_GLOB opmini.c
324 \$(RMS) opmini.c
bd0dd1d8 325
daa992e6
PP
326!GROK!THIS!
327$spitshell >>Makefile <<'!NO!SUBS!'
2f41d0a8 328miniperlmain$(OBJ_EXT): miniperlmain.c patchlevel.h
92c28edd 329 $(CCCMD) $(PLDLFLAGS) $*.c
ecfc5424 330
92c28edd 331perlmain.c: miniperlmain.c config.sh $(FIRSTMAKEFILE)
e8827f64 332 sh writemain $(DYNALOADER) $(static_ext) > writemain.tmp
92c28edd 333 sh mv-if-diff writemain.tmp perlmain.c
85e6fe83 334
cd4d8a96 335perlmain$(OBJ_EXT): perlmain.c
92c28edd 336 $(CCCMD) $(PLDLFLAGS) $*.c
85e6fe83 337
a0d0e21e
LW
338# The file ext.libs is a list of libraries that must be linked in
339# for static extensions, e.g. -lm -lgdbm, etc. The individual
340# static extension Makefile's add to it.
fed7345c 341ext.libs: $(static_ext)
a0d0e21e 342 -@test -f ext.libs || touch ext.libs
85e6fe83 343
ecfc5424 344!NO!SUBS!
599a829f 345
d96ebe2e 346# How to build libperl. This is still rather convoluted.
599a829f 347# Load up custom Makefile.SH fragment for shared loading and executables:
8736538c 348case "$osname" in
8736538c
AS
349*)
350 Makefile_s="$osname/Makefile.SHs"
351 ;;
352esac
353
549a6b10
JH
354case "$osname" in
355aix)
356 $spitshell >>Makefile <<!GROK!THIS!
d6f4130b 357LIBS = $perllibs
5f9d9a17
ME
358# In AIX we need to change this for building Perl itself from
359# its earlier definition (which is for building external
360# extensions *after* Perl has been built and installed)
361CCDLFLAGS = `echo $ccdlflags|sed -e 's@-bE:.*/perl\.exp@-bE:perl.exp@'`
549a6b10
JH
362
363!GROK!THIS!
364 case "$useshrplib" in
365 define|true|[yY]*)
366 $spitshell >>Makefile <<'!NO!SUBS!'
367
368LIBPERL_NONSHR = libperl_nonshr$(LIB_EXT)
369MINIPERL_NONSHR = miniperl_nonshr$(EXE_EXT)
370
371$(LIBPERL_NONSHR): perl$(OBJ_EXT) $(obj)
372 $(RMS) $(LIBPERL_NONSHR)
373 $(AR) rcu $(LIBPERL_NONSHR) perl$(OBJ_EXT) $(obj)
374
bd0dd1d8 375$(MINIPERL_NONSHR): $(LIBPERL_NONSHR) miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT)
a7089531
GS
376 $(CC) $(LDFLAGS) -o $(MINIPERL_NONSHR) miniperlmain$(OBJ_EXT) \
377 opmini$(OBJ_EXT) $(LIBPERL_NONSHR) $(LIBS)
549a6b10
JH
378
379MINIPERLEXP = $(MINIPERL_NONSHR)
380
381LIBPERLEXPORT = perl.exp
382
383!NO!SUBS!
384
385 ;;
386 *)
387 $spitshell >>Makefile <<'!NO!SUBS!'
388MINIPERLEXP = miniperl$(EXE_EXT)
389
390PERLEXPORT = perl.exp
391
392!NO!SUBS!
393 ;;
394 esac
395 $spitshell >>Makefile <<'!NO!SUBS!'
396perl.exp: $(MINIPERLEXP) makedef.pl config.sh $(SYM) $(SYMH)
397 ./$(MINIPERLEXP) makedef.pl PLATFORM=aix | sort -u | sort -f > perl.exp.tmp
398 sh mv-if-diff perl.exp.tmp perl.exp
399
400!NO!SUBS!
401 ;;
2c2d71f5
JH
402os2)
403 $spitshell >>Makefile <<'!NO!SUBS!'
404MINIPERLEXP = miniperl
405
406perl5.def: $(MINIPERLEXP) makedef.pl config.sh $(SYM) $(SYMH) miniperl.map
407 ./$(MINIPERLEXP) makedef.pl PLATFORM=os2 -DPERL_DLL=$(PERL_DLL) > perl.exp.tmp
408 sh mv-if-diff perl.exp.tmp perl5.def
409
410!NO!SUBS!
411 ;;
549a6b10
JH
412esac
413
8736538c
AS
414if test -r $Makefile_s ; then
415 . $Makefile_s
d96ebe2e 416 $spitshell >>Makefile <<!GROK!THIS!
cd4d8a96 417
8736538c 418Makefile: $Makefile_s
cd4d8a96 419!GROK!THIS!
420else
f0efd8cf 421 $spitshell >>Makefile <<'!NO!SUBS!'
549a6b10 422$(LIBPERL): $& perl$(OBJ_EXT) $(obj) $(LIBPERLEXPORT)
9c9e9f08 423!NO!SUBS!
d96ebe2e 424 case "$useshrplib" in
425 true)
426 $spitshell >>Makefile <<'!NO!SUBS!'
daa992e6 427 $(LD) -o $@ $(SHRPLDFLAGS) perl$(OBJ_EXT) $(obj)
3c321fdc 428!NO!SUBS!
429 case "$osname" in
430 aix)
431 $spitshell >>Makefile <<'!NO!SUBS!'
28e8609d 432 rm -f libperl$(OBJ_EXT)
3c321fdc 433 mv $@ libperl$(OBJ_EXT)
434 $(AR) qv $(LIBPERL) libperl$(OBJ_EXT)
ecfc5424 435!NO!SUBS!
3c321fdc 436 ;;
437 esac
d96ebe2e 438 ;;
439 *)
440 $spitshell >>Makefile <<'!NO!SUBS!'
441 rm -f $(LIBPERL)
442 $(AR) rcu $(LIBPERL) perl$(OBJ_EXT) $(obj)
443 @$(ranlib) $(LIBPERL)
655635e8 444!NO!SUBS!
d96ebe2e 445 ;;
446 esac
599a829f
IZ
447 $spitshell >>Makefile <<'!NO!SUBS!'
448
449# How to build executables.
450
451# The $& notation tells Sequent machines that it can do a parallel make,
452# and is harmless otherwise.
453# The miniperl -w -MExporter line is a basic cheap test to catch errors
454# before make goes on to run preplibrary and then MakeMaker on extensions.
455# This is very handy because later errors are often caused by miniperl
456# build problems but that's not obvious to the novice.
457# The Module used here must not depend on Config or any extensions.
458
ecfb2188
GS
459!NO!SUBS!
460
461 case "${osname}${osvers}" in
535d2540 462 next4*)
ecfb2188 463 $spitshell >>Makefile <<'!NO!SUBS!'
bd0dd1d8 464miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT)
ecfb2188
GS
465 $(CC) -o miniperl `echo $(obj) | sed 's/ op$(OBJ_EXT) / /'` \
466 miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perl$(OBJ_EXT) $(libs)
bd0dd1d8 467 $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
ecfb2188
GS
468!NO!SUBS!
469 ;;
535d2540
JH
470 aix*)
471 $spitshell >>Makefile <<'!NO!SUBS!'
472miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT)
473 $(CC) -o miniperl $(CLDFLAGS) \
474 `echo $(obj) | sed 's/ op$(OBJ_EXT) / /'` \
475 miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perl$(OBJ_EXT) $(libs)
476 $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
477!NO!SUBS!
478 ;;
ecfb2188
GS
479 *)
480 $spitshell >>Makefile <<'!NO!SUBS!'
bd0dd1d8 481miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT)
d6f4130b 482 $(LDLIBPTH) $(CC) $(CLDFLAGS) -o miniperl \
a7089531 483 miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(LLIBPERL) $(libs)
bd0dd1d8 484 $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
ecfb2188
GS
485!NO!SUBS!
486 ;;
487 esac
488
489 $spitshell >>Makefile <<'!NO!SUBS!'
599a829f 490
549a6b10 491perl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
daa992e6 492 $(SHRPENV) $(LDLIBPTH) $(CC) -o perl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
599a829f 493
549a6b10 494pureperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
daa992e6 495 $(SHRPENV) $(LDLIBPTH) purify $(CC) -o pureperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
599a829f 496
549a6b10 497purecovperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
daa992e6 498 $(SHRPENV) $(LDLIBPTH) purecov $(CC) -o purecovperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
dbadb36a 499
549a6b10 500quantperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
daa992e6 501 $(SHRPENV) $(LDLIBPTH) quantify $(CC) -o quantperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
2304df62
AD
502
503# This version, if specified in Configure, does ONLY those scripts which need
504# set-id emulation. Suidperl must be setuid root. It contains the "taint"
505# checks as well as the special code to validate that the script in question
506# has been invoked correctly.
507
549a6b10 508suidperl: $& sperl$(OBJ_EXT) perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
daa992e6 509 $(SHRPENV) $(LDLIBPTH) $(CC) -o suidperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) sperl$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
2304df62 510
599a829f
IZ
511!NO!SUBS!
512
513fi
514
515$spitshell >>Makefile <<'!NO!SUBS!'
516
daa992e6 517sperl$(OBJ_EXT): perl.c $(h)
2304df62 518 $(RMS) sperl.c
85e6fe83 519 $(LNS) perl.c sperl.c
d96ebe2e 520 $(CCCMD) -DIAMSUID sperl.c
2304df62
AD
521 $(RMS) sperl.c
522
fec02dd3
AD
523# We have to call our ./makedir because Ultrix 4.3 make can't handle the line
524# test -d lib/auto || mkdir lib/auto
525#
8374d37a 526preplibrary: miniperl lib/Config.pm
cd4d8a96 527 @sh ./makedir lib/auto
a0d0e21e 528 @echo " AutoSplitting perl library"
92c28edd
JH
529 $(LDLIBPTH) ./miniperl -Ilib -e 'use AutoSplit; \
530 autosplit_lib_modules(@ARGV)' lib/*.pm lib/*/*.pm
2304df62 531
75f92628 532# Take care to avoid modifying lib/Config.pm without reason
fb73857a 533# (If trying to create a new port and having problems with the configpm script,
534# try 'make minitest' and/or commenting out the tests at the end of configpm.)
06605284 535lib/Config.pm: config.sh miniperl configpm lib/re.pm
e8827f64 536 $(LDLIBPTH) ./miniperl configpm configpm.tmp
92c28edd 537 sh mv-if-diff configpm.tmp $@
2304df62 538
92c28edd 539lib/ExtUtils/Miniperl.pm: miniperlmain.c miniperl minimod.pl lib/Config.pm
e8827f64 540 $(LDLIBPTH) ./miniperl minimod.pl > minimod.tmp
92c28edd 541 sh mv-if-diff minimod.tmp $@
fed7345c 542
92c28edd 543lib/re.pm: ext/re/re.pm
ceb0239c 544 rm -f $@
92c28edd 545 cat ext/re/re.pm > $@
7cfc0d09 546
06605284 547$(plextract): miniperl lib/Config.pm
92c28edd 548 $(LDLIBPTH) ./miniperl -Ilib $@.PL
72b3d9b4 549
b1a1e9f1 550extra.pods: miniperl
fec93702 551 -@test -f extra.pods && rm -f `cat extra.pods`
72b3d9b4 552 -@rm -f extra.pods
b4bc034f 553 -@for x in `grep -l '^=[a-z]' README.* | grep -v README.vms` ; do \
72b3d9b4 554 nx=`echo $$x | sed -e "s/README\.//"`; \
55516df5 555 cd pod ; $(LNS) ../$$x "perl"$$nx".pod" ; cd .. ; \
72b3d9b4
GS
556 echo "pod/perl"$$nx".pod" >> extra.pods ; \
557 done
55516df5 558 -@test -f vms/perlvms.pod && cd pod && $(LNS) ../vms/perlvms.pod perlvms.pod && cd .. && echo "pod/perlvms.pod" >> extra.pods
72b3d9b4 559
f556e5b9
JH
560install-strip:
561 $(MAKE) STRIPFLAGS=-s install
562
55516df5
GS
563install:
564 $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS)
565
566install-verbose:
567 $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-V
568
569install-silent:
570 $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-S
571
572no-install:
573 $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-n
16d20bd9 574
b1a1e9f1 575install.perl: all installperl
6ee623d5
GS
576 if [ -n "$(COMPILE)" ]; \
577 then \
578 cd utils; $(MAKE) compile; \
579 cd ../x2p; $(MAKE) compile; \
580 cd ../pod; $(MAKE) compile; \
83673e1f 581 else :; \
6ee623d5 582 fi
55516df5 583 $(LDLIBPTH) ./perl installperl $(INSTALLFLAGS) $(STRIPFLAGS)
a0d0e21e 584
b1a1e9f1 585install.man: all installman
55516df5 586 $(LDLIBPTH) ./perl installman $(INSTALLFLAGS)
16d20bd9 587
84902520
TB
588# XXX Experimental. Hardwired values, but useful for testing.
589# Eventually Configure could ask for some of these values.
590install.html: all installhtml
55516df5 591 -@test -f README.vms && cd vms && $(LNS) ../README.vms README_vms.pod && cd ..
6ee623d5 592 $(LDLIBPTH) ./perl installhtml \
84902520
TB
593 --podroot=. --podpath=. --recurse \
594 --htmldir=$(privlib)/html \
595 --htmlroot=$(privlib)/html \
596 --splithead=pod/perlipc \
597 --splititem=pod/perlfunc \
598 --libpods=perlfunc:perlguts:perlvar:perlrun:perlop \
599 --verbose
600
16d20bd9 601
a0d0e21e 602# I now supply perly.c with the kits, so the following section is
56febc5e
AD
603# used only if you force byacc to run by saying
604# make run_byacc
605# Since we patch up the byacc output, the perly.fixer script needs
606# to run with precisely the same version of byacc as I use. You
607# normally shouldn't remake perly.[ch].
608
232e078e 609run_byacc: FORCE
56febc5e 610 $(BYACC) -d perly.y
57458f80 611 -chmod 664 perly.c perly.h
56febc5e 612 sh $(shellflags) ./perly.fixer y.tab.c perly.c
55497cff 613 sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
614 -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c
ebb99254 615 sed -e '/^extern YYSTYPE yy/D' y.tab.h >yh.tmp && mv yh.tmp y.tab.h
55497cff 616 cmp -s y.tab.h perly.h && rm -f y.tab.h || mv y.tab.h perly.h
fb73857a 617 chmod 664 vms/perly_c.vms vms/perly_h.vms
618 perl vms/vms_yfix.pl perly.c perly.h vms/perly_c.vms vms/perly_h.vms
56febc5e
AD
619
620# We don't want to regenerate perly.c and perly.h, but they might
621# appear out-of-date after a patch is applied or a new distribution is
622# made.
92c28edd 623perly.c: perly.y
b233458b
JH
624 -@sh -c true
625
92c28edd 626perly.h: perly.y
b233458b
JH
627 -@sh -c true
628
bd656b61 629# No compat3.sym here since and including the 5.004_50.
e4d5a464 630# No interp.sym since 5.005_03.
22c35a8c 631SYM = global.sym globvar.sym perlio.sym pp.sym
419eaf7b 632
22c35a8c 633SYMH = perlvars.h intrpvar.h thrdvar.h
419eaf7b 634
dae78bb1
IZ
635CHMOD_W = chmod +w
636
a8581515 637# The following files are generated automatically
c83f8f39
JH
638# keywords.pl: keywords.h
639# opcode.pl: opcode.h opnames.h pp_proto.h pp.sym
640# [* embed.pl needs pp.sym generated by opcode.pl! *]
641# embed.pl: proto.h embed.h embedvar.h global.sym objXSUB.h
642# perlapi.h perlapi.c pod/perlintern.pod
643# pod/perlapi.pod
644# bytecode.pl: ext/ByteLoader/byterun.h ext/ByteLoader/byterun.c
645# ext/B/B/Asmdata.pm
646# regcomp.pl: regnodes.h
647# warnings.pl: warnings.h lib/warnings.pm
e50aee73
AD
648# The correct versions should be already supplied with the perl kit,
649# in case you don't have perl available.
e1354ed6 650# To force them to be regenerated, type
e50aee73 651# make regen_headers
e1354ed6 652
b4d4469a
JH
653AUTOGEN_FILES = keywords.h opcode.h opnames.h pp_proto.h pp.sym proto.h \
654 embed.h embedvar.h global.sym \
655 pod/perlintern.pod pod/perlapi.pod \
c83f8f39
JH
656 objXSUB.h perlapi.h perlapi.c ext/ByteLoader/byterun.h \
657 ext/ByteLoader/byterun.c ext/B/B/Asmdata.pm regnodes.h \
c2276a7b
GS
658 warnings.h lib/warnings.pm \
659 vms/perly_c.vms vms/perly_h.vms
e1354ed6 660
e50aee73 661regen_headers: FORCE
b4d4469a
JH
662 -$(CHMOD_W) $(AUTOGEN_FILES)
663 -perl keywords.pl
664 -perl opcode.pl
665 -perl embed.pl
666 -perl bytecode.pl
667 -perl regcomp.pl
668 -perl warnings.pl
8e07c86e 669
b0bd187b
GS
670regen_pods: FORCE
671 -cd pod; $(LDLIBPTH) make regen_pods
672
504c4e2a
GS
673regen_vms: FORCE
674 -perl vms/vms_yfix.pl perly.c perly.h vms/perly_c.vms vms/perly_h.vms
675
676regen_all: regen_headers regen_pods regen_vms
a4bf32d5 677
a0d0e21e 678# Extensions:
4318d5a0
GB
679# Names added to $(dynamic_ext) or $(static_ext) or $(nonxs_ext) will
680# automatically get built. There should ordinarily be no need to change
681# any of this part of makefile.
a0d0e21e
LW
682#
683# The dummy dependency is a place holder in case $(dynamic_ext) or
684# $(static_ext) is empty.
685#
686# DynaLoader may be needed for extensions that use Makefile.PL.
687
688$(DYNALOADER): miniperl preplibrary FORCE
92c28edd 689 @$(LDLIBPTH) sh ext/util/make_ext static $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
a0d0e21e
LW
690
691d_dummy $(dynamic_ext): miniperl preplibrary $(DYNALOADER) FORCE
92c28edd 692 @$(LDLIBPTH) sh ext/util/make_ext dynamic $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
a0d0e21e
LW
693
694s_dummy $(static_ext): miniperl preplibrary $(DYNALOADER) FORCE
92c28edd 695 @$(LDLIBPTH) sh ext/util/make_ext static $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
2304df62 696
4318d5a0 697n_dummy $(nonxs_ext): miniperl preplibrary $(DYNALOADER) FORCE
92c28edd 698 @$(LDLIBPTH) sh ext/util/make_ext nonxs $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
4318d5a0 699
17b893d8 700clean: _tidy _mopup
70af249b 701
3a6f1039 702realclean: _realcleaner _mopup
4e2a5f63 703 @echo "Note that make realclean does not delete config.sh or Policy.sh"
70af249b 704
3a6f1039 705_clobber:
4e2a5f63 706 rm -f config.sh cppstdin Policy.sh
70af249b 707
3a6f1039
GS
708clobber: _realcleaner _mopup _clobber
709
70af249b
CS
710distclean: clobber
711
3a6f1039
GS
712# Like distclean but also removes emacs backups and *.orig.
713veryclean: _verycleaner _mopup _clobber
714 -@rm -f Obsolete Wanted
715
70af249b
CS
716# Do not 'make _mopup' directly.
717_mopup:
cd4d8a96 718 rm -f *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c
72b3d9b4 719 -@test -f extra.pods && rm -f `cat extra.pods`
b4bc034f 720 -@test -f vms/README_vms.pod && rm -f vms/README_vms.pod
55516df5 721 -rm -f perl.exp ext.libs extra.pods opmini.o
d96ebe2e 722 -rm -f perl.export perl.dll perl.libexp perl.map perl.def
1cfa4ec7 723 -rm -f perl.loadmap miniperl.loadmap perl.prelmap miniperl.prelmap
abec7fe0 724 rm -f perl suidperl miniperl $(LIBPERL) libperl.* microperl
70af249b
CS
725
726# Do not 'make _tidy' directly.
727_tidy:
e3f83878
JH
728 -cd pod; $(LDLIBPTH) $(MAKE) clean
729 -cd utils; $(LDLIBPTH) $(MAKE) clean
730 -cd x2p; $(LDLIBPTH) $(MAKE) clean
4318d5a0 731 -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \
e3f83878 732 $(LDLIBPTH) sh ext/util/make_ext clean $$x MAKE=$(MAKE) ; \
a0d0e21e 733 done
6ee623d5 734 rm -f testcompile compilelog
ff68c719 735
3a6f1039 736_cleaner1:
4633a7c4 737 -cd os2; rm -f Makefile
3a6f1039
GS
738 -cd pod; $(LDLIBPTH) $(MAKE) $(CLEAN)
739 -cd utils; $(LDLIBPTH) $(MAKE) $(CLEAN)
740 -cd x2p; $(LDLIBPTH) $(MAKE) $(CLEAN)
4318d5a0 741 -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \
3a6f1039 742 $(LDLIBPTH) sh ext/util/make_ext $(CLEAN) $$x MAKE=$(MAKE) ; \
a0d0e21e 743 done
3a6f1039
GS
744
745_cleaner2:
d6f4130b 746 rm -f core core.*perl.*.? *perl.core t/core t/core.perl.*.? t/*perl.core t/misctmp* t/forktmp* t/tmp* t/c t/perl t/rantests .?*.c so_locations $(LIBPERL_NONSHR) $(MINIPERL_NONSHR)
a0d0e21e 747 rm -rf $(addedbyconf)
cd4d8a96 748 rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old
fed7345c 749 rm -f $(private)
a0d0e21e 750 rm -rf lib/auto
181ea953 751 rm -f lib/.exists lib/*/.exists
16d20bd9 752 rm -f h2ph.man pstruct
a0d0e21e 753 rm -rf .config
6ee623d5 754 rm -f testcompile compilelog
55516df5 755 -rmdir lib/B lib/Data lib/IO/Socket lib/IO lib/Sys lib/Thread
ecfc5424 756
3a6f1039
GS
757_realcleaner:
758 @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=realclean
759 @$(LDLIBPTH) $(MAKE) _cleaner2
760
761_verycleaner:
762 @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=veryclean
763 @$(LDLIBPTH) $(MAKE) _cleaner2
764 -rm -f *~ *.orig */*~ */*.orig */*/*~ */*/*.orig
765
2304df62
AD
766# The following lint has practically everything turned on. Unfortunately,
767# you have to wade through a lot of mumbo jumbo that can't be suppressed.
768# If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
769# for that spot.
770
daa992e6 771lint: $(c)
2304df62
AD
772 lint $(lintflags) $(defs) perly.c $(c) > perl.fuzz
773
fb73857a 774# Need to unset during recursion to go out of loop.
775# The README below ensures that the dependency list is never empty and
776# that when MAKEDEPEND is empty $(FIRSTMAKEFILE) doesn't need rebuilding.
cd4d8a96 777
84902520 778MAKEDEPEND = Makefile makedepend
cd4d8a96 779
fb73857a 780$(FIRSTMAKEFILE): README $(MAKEDEPEND)
cd4d8a96 781 $(MAKE) depend MAKEDEPEND=
a0d0e21e 782
599a829f 783config.h: config_h.SH config.sh
655635e8 784 $(SHELL) config_h.SH
785
a0d0e21e 786# When done, touch perlmain.c so that it doesn't get remade each time.
2304df62 787depend: makedepend
fb73857a 788 sh ./makedepend MAKE=$(MAKE)
a0d0e21e 789 - test -s perlmain.c && touch perlmain.c
2304df62
AD
790 cd x2p; $(MAKE) depend
791
cd4d8a96 792# Cannot postpone this until $firstmakefile is ready ;-)
92c28edd
JH
793makedepend: makedepend.SH config.sh
794 sh ./makedepend.SH
cd4d8a96 795
d6a255e6
IZ
796# Cannot delegate rebuilding of t/perl to make to allow interlaced
797# test and minitest
798test-prep: miniperl perl preplibrary utilities $(dynamic_ext) $(nonxs_ext) $(TEST_PERL_DLL)
3e3baf6d
TB
799 cd t && (rm -f perl$(EXE_EXT); $(LNS) ../perl$(EXE_EXT) perl$(EXE_EXT))
800
994e9bc0
KH
801# Second branch is for testing without a tty or controling terminal.
802# See t/op/stat.t
3e3baf6d 803test check: test-prep
994e9bc0
KH
804 if (true </dev/tty) >/dev/null 2>&1; then \
805 cd t && $(LDLIBPTH) ./perl TEST </dev/tty; \
806 else \
807 cd t && PERL_SKIP_TTY_TEST=1 $(LDLIBPTH) ./perl TEST; \
808 fi
d6f4130b 809 @echo "Ran tests" > t/rantests
3e3baf6d 810
a0ed51b3 811utest ucheck: test-prep
994e9bc0
KH
812 if (true </dev/tty) >/dev/null 2>&1; then \
813 cd t && $(LDLIBPTH) ./perl UTEST </dev/tty; \
814 else \
815 cd t && PERL_SKIP_TTY_TEST=1 $(LDLIBPTH) ./perl UTEST; \
816 fi
a0ed51b3 817
3e3baf6d
TB
818# For testing without a tty or controling terminal. See t/op/stat.t
819test-notty: test-prep
6ee623d5 820 cd t && PERL_SKIP_TTY_TEST=1 $(LDLIBPTH) ./perl TEST
2304df62 821
d96ebe2e 822# Can't depend on lib/Config.pm because that might be where miniperl
823# is crashing.
a35c6d74 824minitest: miniperl lib/re.pm
d96ebe2e 825 @echo "You may see some irrelevant test failures if you have been unable"
826 @echo "to build lib/Config.pm."
cd4d8a96 827 - cd t && (rm -f perl$(EXE_EXT); $(LNS) ../miniperl$(EXE_EXT) perl$(EXE_EXT)) \
75d9b21f 828 && $(LDLIBPTH) ./perl TEST base/*.t comp/*.t cmd/*.t run/*.t io/*.t op/*.t pragma/*.t </dev/tty
16d20bd9 829
fb73857a 830# Handy way to run perlbug -ok without having to install and run the
84902520 831# installed perlbug. We don't re-run the tests here - we trust the user.
fb73857a 832# Please *don't* use this unless all tests pass.
1d2dff63 833# If you want to report test failures, use "make nok" instead.
188cd53f 834ok: utilities
92c28edd 835 $(LDLIBPTH) ./perl -Ilib utils/perlbug -ok -s '(UNINSTALLED)'
84902520 836
105f9295 837okfile: utilities
92c28edd 838 $(LDLIBPTH) ./perl -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -F perl.ok
105f9295 839
36a291fb
GS
840oknack: utilities
841 $(LDLIBPTH) ./perl -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -A
842
843okfilenack: utilities
844 $(LDLIBPTH) ./perl -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -F perl.ok -A
845
1d2dff63 846nok: utilities
92c28edd 847 $(LDLIBPTH) ./perl -Ilib utils/perlbug -nok -s '(UNINSTALLED)'
1d2dff63 848
b4e8cfaf
GS
849nokfile: utilities
850 $(LDLIBPTH) ./perl -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok
851
36a291fb
GS
852noknack: utilities
853 $(LDLIBPTH) ./perl -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -A
854
855nokfilenack: utilities
856 $(LDLIBPTH) ./perl -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok -A
857
85e6fe83 858clist: $(c)
92c28edd 859 echo $(c) | tr ' ' $(TRNL) >.clist
2304df62 860
85e6fe83 861hlist: $(h)
92c28edd 862 echo $(h) | tr ' ' $(TRNL) >.hlist
2304df62 863
85e6fe83 864shlist: $(sh)
92c28edd 865 echo $(sh) | tr ' ' $(TRNL) >.shlist
2304df62 866
4633a7c4 867pllist: $(pl)
92c28edd 868 echo $(pl) | tr ' ' $(TRNL) >.pllist
4633a7c4 869
92c28edd
JH
870Makefile: Makefile.SH ./config.sh
871 $(SHELL) Makefile.SH
760ac839 872
599a829f 873distcheck: FORCE
760ac839
LW
874 perl '-MExtUtils::Manifest=&fullcheck' -e 'fullcheck()'
875
771c4874
IZ
876elc: emacs/cperl-mode.elc
877
878emacs/cperl-mode.elc: emacs/cperl-mode.el
879 -cd emacs; emacs -batch -q -no-site-file -f batch-byte-compile cperl-mode.el
880
d6a255e6
IZ
881etags: TAGS
882
883TAGS: emacs/cperl-mode.elc
3ee700d1 884 sh emacs/ptags
01e22528 885
d6a255e6
IZ
886ctags: tags
887
888# Let's hope make will not go into an infinite loop on case-unsensitive systems
889# This may also fail if . is in the head of the path, since perl will
890# require -Ilib
891tags: TAGS
892 perl emacs/e2ctags.pl TAGS > tags
3ee700d1 893
2304df62
AD
894# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
895# If this runs make out of memory, delete /usr/include lines.
896!NO!SUBS!
897
85e6fe83 898$eunicefix Makefile
2304df62
AD
899case `pwd` in
900*SH)
85e6fe83 901 $rm -f ../Makefile
cd4d8a96 902 $ln Makefile ../Makefile
2304df62
AD
903 ;;
904esac
cd4d8a96 905$rm -f $firstmakefile
5ff3f7a4
GS
906
907# Now do any special processing required before building.
908
909case "$ebcdic" in
910$define)
911 xxx=''
912 echo "This is an EBCDIC system, checking if any parser files need regenerating." >&4
7a66b286 913case "$osname" in
25e9a2e3 914os390|posix-bc)
5ff3f7a4 915 rm -f y.tab.c y.tab.h
e9d08790 916 # yacc must be a reentrant ("pure") Bison in BS2000 Posix!
5ff3f7a4
GS
917 yacc -d perly.y >/dev/null 2>&1
918 if cmp -s y.tab.c perly.c; then
919 rm -f y.tab.c
920 else
921 echo "perly.y -> perly.c" >&2
922 mv -f y.tab.c perly.c
923 chmod u+w perly.c
c8dba6f3
GS
924 sed -e '/^#include "perl\.h"/a\
925\
926#define yydebug PL_yydebug\
927#define yynerrs PL_yynerrs\
928#define yyerrflag PL_yyerrflag\
929#define yychar PL_yychar\
c8dba6f3
GS
930#define yyval PL_yyval\
931#define yylval PL_yylval' \
932 -e '/YYSTYPE *yyval;/D' \
933 -e '/YYSTYPE *yylval;/D' \
934 -e '/int yychar,/,/yynerrs;/D' \
935 -e 's/int yydebug = 0;/yydebug = 0;/' \
936 -e 's/[^_]realloc(/PerlMem_realloc(/g' \
937 -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
5ff3f7a4
GS
938 -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c
939 xxx="$xxx perly.c"
940 fi
941 if cmp -s y.tab.h perly.h; then
942 rm -f y.tab.h
943 else
944 echo "perly.y -> perly.h" >&2
945 mv -f y.tab.h perly.h
946 xxx="$xxx perly.h"
947 fi
e9d08790 948 if cd x2p
5ff3f7a4 949 then
e9d08790 950 rm -f y.tab.c y.tab.h
5928ee40
JH
951 case "$osname" in
952 posix-bc)
953 # we are using two different yaccs in BS2000 Posix!
954 byacc a2p.y >/dev/null 2>&1
955 ;;
956 *) # e.g. os390
957 yacc a2p.y >/dev/null 2>&1
958 ;;
959 esac
e9d08790
JH
960 if cmp -s y.tab.c a2p.c
961 then
962 rm -f y.tab.c
963 else
964 echo "a2p.y -> a2p.c" >&2
965 mv -f y.tab.c a2p.c
966 chmod u+w a2p.c
967 sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
791ece1b 968 -e 's|^static void __YY_YACC_MAIN.*BS2000.*|/*static main deleted*/|' \
e9d08790
JH
969 -e 's/y\.tab/a2p/g' a2p.c >a2p.tmp && mv a2p.tmp a2p.c
970 xxx="$xxx a2p.c"
971 fi
972 # In case somebody yacc -d:ed the a2p.y.
973 if test -f y.tab.h
974 then
975 if cmp -s y.tab.h a2p.h
976 then
977 rm -f y.tab.h
978 else
979 echo "a2p.h -> a2p.h" >&2
980 mv -f y.tab.h a2p.h
981 xxx="$xxx a2p.h"
982 fi
983 fi
984 cd ..
5ff3f7a4 985 fi
7a66b286
JH
986 ;;
987vmesa)
988 # Do nothing in VM/ESA.
989 ;;
aa34f189 990*)
e9d08790 991 echo "'$osname' is an EBCDIC system I don't know that well." >&4
aa34f189 992 ;;
fe572743 993esac
5ff3f7a4
GS
994 case "$xxx" in
995 '') echo "No parser files were regenerated. That's okay." >&2 ;;
996 esac
997 ;;
998esac
999