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