Improve and restructure t/op/pat.t and split out some unicode related tests into...
[p5sagit/p5-mst-13.2.git] / Makefile.SH
CommitLineData
599a829f 1#! /bin/sh
a02608de 2case $PERL_CONFIG_SH 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
761ee4e8 12
5a20539c 13case $CROSS_NAME in
14'')
15 Makefile=Makefile
16 ;;
17*)
18 # if cross-compilation, the Makefile named accordingly
19 Makefile=Makefile-cross-$CROSS_NAME
20 . Cross/config-${CROSS_NAME}.sh
21 ;;
22esac
23
761ee4e8 24# H.Merijn Brand [17 Feb 2004]
25# This comment is just to ensure that Configure will find variables that
26# are removed/replaced in patches on blead, but are still needed in the
27# 5.8.x, 5.6.x and 5.005.x maintainance tracks.
28# metaconfig -m will scan all .SH files on this level (not deeper), and
29# not in x2p and other subfolders. This file is as good as any .SH
30# patch references
31# #22227 $baserev
32# #22302 $yacc $byacc
33
08c92000 34# H.Merijn Brand [30 Oct 2004]
35# Mentioned for the same reason for future reference
36# #23434 $d_strlcat $d_strlcpy
37
2304df62 38: This forces SH files to create target in same directory as SH file.
39: This is so that make depend always knows where to find SH derivatives.
40case "$0" in
41*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
42esac
43
2304df62 44case "$d_dosuid" in
45*define*) suidperl='suidperl' ;;
46*) suidperl='';;
47esac
48
d5d19f97 49linklibperl='$(LIBPERL)'
3c321fdc 50shrpldflags='$(LDDLFLAGS)'
6ee623d5 51ldlibpth=''
ac9901e0 52DPERL_EXTERNAL_GLOB='-DPERL_EXTERNAL_GLOB'
d96ebe2e 53case "$useshrplib" in
54true)
f4db5405 55 # Prefix all runs of 'miniperl' and 'perl' with
5cf1d1f1 56 # $ldlibpth so that ./perl finds *this* shared libperl.
c1b49bc0 57 case "$LD_LIBRARY_PATH" in
58 '')
59 ldlibpth="LD_LIBRARY_PATH=`pwd`";;
60 *)
61 ldlibpth="LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}";;
62 esac
6ee623d5 63
d5d19f97 64 pldlflags="$cccdlflags"
94c41b70 65 static_target='static_pic'
d96ebe2e 66 case "${osname}${osvers}" in
67 next4*)
3c321fdc 68 ld=libtool
69 lddlflags="-dynamic -undefined warning -framework System \
70 -compatibility_version 1 -current_version $patchlevel \
71 -prebind -seg1addr 0x27000000 -install_name \$(shrpdir)/\$@"
6ee623d5 72 ;;
f556e5b9 73 rhapsody*|darwin*)
74 shrpldflags="${ldflags} -dynamiclib \
c1e7a127 75 -compatibility_version \
76 ${api_revision}.${api_version}.${api_subversion} \
f556e5b9 77 -current_version \
c1e7a127 78 ${revision}.${patchlevel}.${subversion} \
f556e5b9 79 -install_name \$(shrpdir)/\$@"
80 ;;
5cf1d1f1 81 cygwin*)
5f9145a3 82 shrpldflags="$shrpldflags -Wl,--out-implib=libperl.dll.a -Wl,--image-base,0x52000000"
83 linklibperl="-L. -lperl"
8736538c 84 ;;
73d40b3e 85 sunos*)
d5d19f97 86 linklibperl="-lperl"
87 ;;
a774dfe6 88 netbsd*|freebsd[234]*|openbsd*|dragonfly*)
099685bc 89 linklibperl="-L. -lperl"
90 ;;
0c52c6a9 91 interix*)
92 linklibperl="-L. -lperl"
93 shrpldflags="$shrpldflags -Wl,--image-base,0x57000000"
94 ;;
3c321fdc 95 aix*)
96 shrpldflags="-H512 -T512 -bhalt:4 -bM:SRE -bE:perl.exp"
1553ab04 97 case "$osvers" in
549a6b10 98 3*) shrpldflags="$shrpldflags -e _nostart"
1553ab04 99 ;;
6f476969 100 *) shrpldflags="$shrpldflags -bnoentry"
1553ab04 101 ;;
102 esac
9c839522 103 shrpldflags="$shrpldflags $ldflags $perllibs $cryptlib"
549a6b10 104 linklibperl="-L $archlibexp/CORE -L `pwd | sed 's/\/UU$//'` -lperl"
3c321fdc 105 ;;
1c7d1a19 106 hpux*)
107 linklibperl="-L `pwd | sed 's/\/UU$//'` -Wl,+s -Wl,+b$archlibexp/CORE -lperl"
46193409 108 ;;
ac9901e0 109 os390*)
4144573e 110 shrpldflags='-W l,XPLINK,dll'
ac9901e0 111 linklibperl='libperl.x'
112 DPERL_EXTERNAL_GLOB=''
113 ;;
655635e8 114 esac
5cf1d1f1 115 case "$ldlibpthname" in
116 '') ;;
117 *)
118 case "$osname" in
119 os2)
120 ldlibpth=''
121 ;;
5cf1d1f1 122 *)
123 eval "ldlibpth=\"$ldlibpthname=`pwd`:\$$ldlibpthname\""
124 ;;
125 esac
c1b49bc0 126 # Strip off any trailing :'s
127 ldlibpth=`echo $ldlibpth | sed 's/:*$//'`
5cf1d1f1 128 ;;
129 esac
ecfc5424 130
9b9c6f34 131 case "$ldlibpth" in
132 # Protect any spaces
133 *" "*) ldlibpth=`echo $ldlibpth|sed 's/ /\\\\ /g'` ;;
134 esac
6904989c 135
9b9c6f34 136 case "$osname" in
137 linux)
830717a7 138 # If there is a pre-existing $libperl from a previous
139 # installation, Linux needs to use LD_PRELOAD to
140 # override the LD_LIBRARY_PATH setting. See the
141 # INSTALL file, under "Building a shared perl library".
142 # If there is no pre-existing $libperl, we don't need
143 # to do anything further.
144 if test -f $archlib/CORE/$libperl; then
68e8d60a 145 rm -f preload
d0ae58a5 146 cat <<'EOT' > preload
fde91635 147#! /bin/sh
148lib=$1
149shift
150test -r $lib && export LD_PRELOAD="$lib $LD_PRELOAD"
151exec "$@"
152EOT
9b9c6f34 153 chmod 755 preload
154 ldlibpth="$ldlibpth `pwd`/preload `pwd`/$libperl"
830717a7 155 fi
156 ;;
9b9c6f34 157 os390) test -f /bin/env && ldlibpth="/bin/env $ldlibpth"
158 ;;
60d79001 159 esac
9b9c6f34 160
60d79001 161 ;;
9b9c6f34 162
163*) pldlflags=''
164 static_target='static'
b1f5ad7d 165 ;;
166esac
167
a0d0e21e 168: Prepare dependency lists for Makefile.
169dynamic_list=' '
9f3ef600 170extra_dep=''
a0d0e21e 171for f in $dynamic_ext; do
172 : the dependency named here will never exist
ecfc5424 173 base=`echo "$f" | sed 's/.*\///'`
9f3ef600 174 this_target="lib/auto/$f/$base.$dlext"
175 dynamic_list="$dynamic_list $this_target"
176
177 : Parallel makes reveal that we have some interdependencies
178 case $f in
90e91dd8 179 Math/BigInt/FastCalc|Devel/NYTProf) extra_dep="$extra_dep
9f3ef600 180$this_target: lib/auto/List/Util/Util.$dlext" ;;
181 Unicode/Normalize) extra_dep="$extra_dep
182$this_target: uni.data" ;;
183 esac
a0d0e21e 184done
185
186static_list=' '
a0d0e21e 187for f in $static_ext; do
188 base=`echo "$f" | sed 's/.*\///'`
cd4d8a96 189 static_list="$static_list lib/auto/$f/$base\$(LIB_EXT)"
a0d0e21e 190done
191
4318d5a0 192nonxs_list=' '
193for f in $nonxs_ext; do
194 base=`echo "$f" | sed 's/.*\///'`
195 nonxs_list="$nonxs_list ext/$f/pm_to_blib"
196done
197
5ac1e9b2 198dtrace_h=''
199dtrace_o=''
200case "$usedtrace" in
201define|true)
202 dtrace_h='perldtrace.h'
203 $dtrace -G -s perldtrace.d -o perldtrace.tmp >/dev/null 2>&1 \
204 && rm -f perldtrace.tmp && dtrace_o='perldtrace$(OBJ_EXT)'
205 ;;
206esac
207
5a20539c 208echo "Extracting $Makefile (with variable substitutions)"
209$spitshell >$Makefile <<!GROK!THIS!
210# $Makefile
85e6fe83 211# This file is derived from Makefile.SH. Any changes made here will
212# be lost the next time you run Configure.
655635e8 213# Makefile is used to generate $firstmakefile. The only difference
214# is that $firstmakefile has the dependencies filled in at the end.
0de566d7 215
2304df62 216CC = $cc
232e078e 217LD = $ld
16d20bd9 218
2304df62 219LDFLAGS = $ldflags
220CLDFLAGS = $ldflags
85e6fe83 221
2304df62 222mallocsrc = $mallocsrc
223mallocobj = $mallocobj
00e74f14 224madlysrc = $madlysrc
225madlyobj = $madlyobj
85e6fe83 226LNS = $lns
4c901d04 227# NOTE: some systems don't grok "cp -f". XXX Configure test needed?
228CPS = $cp
2304df62 229RMS = rm -f
85e6fe83 230ranlib = $ranlib
231
16d20bd9 232# The following are mentioned only to make metaconfig include the
233# appropriate questions in Configure. If you want to change these,
8e07c86e 234# edit config.sh instead, or specify --man1dir=/wherever on
16d20bd9 235# installman commandline.
236bin = $installbin
237scriptdir = $scriptdir
d96ebe2e 238shrpdir = $archlibexp/CORE
16d20bd9 239privlib = $installprivlib
240man1dir = $man1dir
241man1ext = $man1ext
242man3dir = $man3dir
243man3ext = $man3ext
244
85e6fe83 245# The following are used to build and install shared libraries for
246# dynamic loading.
247LDDLFLAGS = $lddlflags
3c321fdc 248SHRPLDFLAGS = $shrpldflags
85e6fe83 249CCDLFLAGS = $ccdlflags
a0d0e21e 250DLSUFFIX = .$dlext
ecfc5424 251PLDLFLAGS = $pldlflags
d96ebe2e 252LIBPERL = $libperl
d5d19f97 253LLIBPERL= $linklibperl
ecfc5424 254SHRPENV = $shrpenv
a0d0e21e 255
94c41b70 256# Static targets are ordinarily built without CCCDLFLAGS. However,
257# if building a shared libperl.so that might later be linked into
258# another application, then it might be appropriate to also build static
259# extensions (usually just DynaLoader) with relocatable code (e.g. -fPIC
260# for GNU cc). This is handled by ext/util/make_ext.
261STATIC = $static_target
262
6ee623d5 263# The following is used to include the current directory in
5cf1d1f1 264# the dynamic loader path you are building a shared libperl.
6ee623d5 265LDLIBPTH = $ldlibpth
266
cef6ea9d 267# Sometimes running an executable is an adventure.
268RUN = $run
269
5a20539c 270# These variables may need to be manually set for non-Unix systems.
271AR = $full_ar
272HOST_EXE_EXT =
273EXE_EXT = $_exe
274LIB_EXT = $_a
275OBJ_EXT = $_o
276PATH_SEP = $p_
277
278#
a0d0e21e 279dynamic_ext = $dynamic_list
280static_ext = $static_list
4318d5a0 281nonxs_ext = $nonxs_list
282ext = \$(dynamic_ext) \$(static_ext) \$(nonxs_ext)
908fcb8b 283DYNALOADER = DynaLoader\$(OBJ_EXT)
2304df62 284
9c839522 285libs = $perllibs $cryptlib
2304df62 286
443a5b98 287public = perl\$(EXE_EXT) $suidperl utilities translators
2304df62 288
289shellflags = $shellflags
290
d96ebe2e 291# This is set to MAKE=$make if your $make command doesn't
292# do it for you.
293$make_set_make
4633a7c4 294
1fef16b3 295# Mention $gmake here so it gets probed for by Configure.
296
4f9287d3 297# If you're going to use valgrind and it can't be invoked as plain valgrind
298# then you'll need to change this, or override it on the make command line.
299VALGRIND=valgrind
300
5ac1e9b2 301DTRACE = $dtrace
302DTRACE_H = $dtrace_h
303DTRACE_O = $dtrace_o
304
4633a7c4 305FIRSTMAKEFILE = $firstmakefile
306
307# Any special object files needed by this architecture, e.g. os2/os2.obj
308ARCHOBJS = $archobjs
309
89ada9f2 310.SUFFIXES: .c \$(OBJ_EXT) .i .s
cd4d8a96 311
d96ebe2e 312# grrr
313SHELL = $sh
655635e8 314
28e8609d 315# how to tr(anslate) newlines
316TRNL = '$trnl'
317
82240bfc 318OPTIMIZE = $optimize
319
3343e82c 320EXTRAS = $extras
321
bf35c3f6 322INSTALLPREFIXEXP = $prefix
323
d56c5707 324!GROK!THIS!
b7b35fc2 325# not used by Makefile but by installperl;
d56c5707 326# mentioned here so that metaconfig picks these up
327# $installusrbinperl
328# $versiononly
b7b35fc2 329
8170cb12 330case "${osname}:${osvers}" in
331darwin:*)
5a20539c 332$spitshell >>$Makefile <<EOF
8170cb12 333
334# Your locales are broken (osname $osname, osvers $osvers)
335# and to avoid the numerous
336# perl: warning: Setting locale failed.
337# warnings during the build process we reset the locale variables.
338
339LC_ALL=C
340LANG=C
341LANGUAGE=C
342EOF
343 ;;
344esac
2304df62 345
5a20539c 346case $CROSS_NAME in
347'')
85e6fe83 348## In the following dollars and backticks do not need the extra backslash.
5a20539c 349$spitshell >>$Makefile <<'!NO!SUBS!'
2304df62 350
75550b4e 351CCCMD = `sh $(shellflags) cflags "optimize='$(OPTIMIZE)'" $@`
89ada9f2 352
75550b4e 353CCCMDSRC = `sh $(shellflags) cflags "optimize='$(OPTIMIZE)'" $<`
2304df62 354
2d9d8159 355CONFIGPM = lib/Config.pm lib/Config_heavy.pl
5a20539c 356
357CONFIGPOD = lib/Config.pod
358
359CONFIGH = config.h
360!NO!SUBS!
361 ;;
362*)
363 # if cross-compilation
364$spitshell >>$Makefile <<!GROK!THIS!
365CROSS_NAME = $CROSS_NAME
366CROSS_LIB = xlib/$CROSS_NAME
367
368CCCMD = \`sh \$(shellflags) cflags-cross-$CROSS_NAME "optimize='\$(OPTIMIZE)'" \$@\` -I\$(CROSS_LIB)
369CCCMDSRC = \`sh \$(shellflags) cflags-cross-$CROSS_NAME "optimize='\$(OPTIMIZE)'" \$<\` -I\$(CROSS_LIB)
370CONFIGPM = xlib/\$(CROSS_NAME)/Config.pm
371CONFIGPOD = xlib/\$(CROSS_NAME)/Config.pod
372CONFIGH = xconfig.h
373
374xconfig.h: config_h.SH Cross/config-\$(CROSS_NAME).sh
375 CONFIG_SH=Cross/config-\$(CROSS_NAME).sh CONFIG_H=xconfig.h \$(SHELL) config_h.SH
376 #TODO \$(LDLIBPTH) ./miniperl -Ilib -MCross=\$(CROSS_NAME) config_h.PL "INST_VER=\$(INST_VER)" "CORE_DIR=\$(CROSS_LIB)" "CONFIG_H=xconfig.h"
377 cp xconfig.h \$(CROSS_LIB)/
378 cp xconfig.h \$(CROSS_LIB)/config.h
379
380!GROK!THIS!
381 ;;
382esac
383
384## In the following dollars and backticks do not need the extra backslash.
385$spitshell >>$Makefile <<'!NO!SUBS!'
386
387private = preplibrary $(CONFIGPM) $(CONFIGPOD) lib/ExtUtils/Miniperl.pm
2304df62 388
4633a7c4 389# Files to be built with variable substitution before miniperl
390# is available.
391sh = Makefile.SH cflags.SH config_h.SH makeaperl.SH makedepend.SH \
4755096e 392 makedir.SH myconfig.SH writemain.SH pod/Makefile.SH
4633a7c4 393
3ebb1980 394shextract = Makefile cflags config.h makeaperl makedepend \
4755096e 395 makedir myconfig writemain pod/Makefile
4633a7c4 396
397# Files to be built with variable substitution after miniperl is
398# available. Dependencies handled manually below (for now).
2304df62 399
efb12ca0 400pl = pod/pod2html.PL pod/pod2latex.PL pod/pod2man.PL pod/pod2text.PL \
41630250 401 pod/pod2usage.PL pod/podchecker.PL pod/podselect.PL
4633a7c4 402
4755096e 403# lib/lib.pm is not listed here because it has a rule of its own.
efb12ca0 404plextract = pod/pod2html pod/pod2latex pod/pod2man pod/pod2text \
41630250 405 pod/pod2usage pod/podchecker pod/podselect
4633a7c4 406
4755096e 407addedbyconf = UU $(shextract) $(plextract) lib/lib.pm pstruct
2304df62 408
5ad7e614 409# Unicode data files generated by mktables
410unidatafiles = lib/unicore/Canonical.pl lib/unicore/Exact.pl \
411 lib/unicore/Properties lib/unicore/Decomposition.pl \
7ebf06b3 412 lib/unicore/CombiningClass.pl lib/unicore/Name.pl lib/unicore/PVA.pl
5ad7e614 413
414# Directories of Unicode data files generated by mktables
415unidatadirs = lib/unicore/To lib/unicore/lib
416
5a20539c 417h1 = EXTERN.h INTERN.h XSUB.h av.h $(CONFIGH) cop.h cv.h dosish.h
dd2155a4 418h2 = embed.h form.h gv.h handy.h hv.h keywords.h mg.h op.h opcode.h
419h3 = pad.h patchlevel.h perl.h perlapi.h perly.h pp.h proto.h regcomp.h
219f41b1 420h4 = regexp.h scope.h sv.h unixish.h util.h iperlsys.h thread.h
5ac1e9b2 421h5 = utf8.h warnings.h mydtrace.h
33b839e2 422h = $(h1) $(h2) $(h3) $(h4) $(h5)
2304df62 423
e1a479c5 424c1 = av.c scope.c op.c doop.c doio.c dump.c gv.c hv.c mg.c reentr.c mro.c perl.c
00e74f14 425c2 = perly.c pp.c pp_hot.c pp_ctl.c pp_sys.c regcomp.c regexec.c utf8.c sv.c
426c3 = taint.c toke.c util.c deb.c run.c universal.c xsutils.c pad.c globals.c
427c4 = perlio.c perlapi.c numeric.c mathoms.c locale.c pp_pack.c pp_sort.c
428c5 = $(madlysrc) $(mallocsrc)
2304df62 429
00e74f14 430c = $(c1) $(c2) $(c3) $(c4) $(c5) miniperlmain.c perlmain.c opmini.c
2304df62 431
e1a479c5 432obj1 = $(madlyobj) $(mallocobj) gv$(OBJ_EXT) toke$(OBJ_EXT) perly$(OBJ_EXT) op$(OBJ_EXT) pad$(OBJ_EXT) regcomp$(OBJ_EXT) dump$(OBJ_EXT) util$(OBJ_EXT) mg$(OBJ_EXT) reentr$(OBJ_EXT) mro$(OBJ_EXT)
a643aca6 433obj2 = hv$(OBJ_EXT) av$(OBJ_EXT) perl$(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)
7ee2227d 434obj3 = 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) numeric$(OBJ_EXT) mathoms$(OBJ_EXT) locale$(OBJ_EXT) pp_pack$(OBJ_EXT) pp_sort$(OBJ_EXT)
655635e8 435
5ac1e9b2 436ndt_obj = $(obj1) $(obj2) $(obj3) $(ARCHOBJS)
437obj = $(ndt_obj) $(DTRACE_O)
2304df62 438
075abff3 439lintflags = \
5f66b61c 440 -b \
441 -n \
075abff3 442 -p \
075abff3 443 -Ncheck=%all \
444 -Nlevel=4 \
bb263b4e 445 -errchk=parentheses \
446 -errhdr=%all \
66a1b24b 447 -errfmt=src \
075abff3 448 -errtags \
5f66b61c 449 -erroff=E_ASSIGN_NARROW_CONV \
075abff3 450 -erroff=E_BAD_PTR_CAST \
5f66b61c 451 -erroff=E_BAD_PTR_CAST_ALIGN \
452 -erroff=E_BAD_PTR_INT_COMBINATION \
453 -erroff=E_BAD_SIGN_EXTEND \
075abff3 454 -erroff=E_BLOCK_DECL_UNUSED \
5f66b61c 455 -erroff=E_CASE_FALLTHRU \
abcf5ada 456 -erroff=E_CONST_EXPR \
075abff3 457 -erroff=E_CONSTANT_CONDITION \
abcf5ada 458 -erroff=E_END_OF_LOOP_CODE_NOT_REACHED \
5f66b61c 459 -erroff=E_EQUALITY_NOT_ASSIGNMENT \
075abff3 460 -erroff=E_EXPR_NULL_EFFECT \
66a1b24b 461 -erroff=E_FALSE_LOGICAL_EXPR \
66a1b24b 462 -erroff=E_INCL_NUSD \
5f66b61c 463 -erroff=E_LOOP_EMPTY \
66a1b24b 464 -erroff=E_MAIN_PARAM \
5f66b61c 465 -erroff=E_POINTER_TO_OBJECT \
466 -erroff=E_PTRDIFF_OVERFLOW \
467 -erroff=E_SHIFT_CNT_NEG_TOO_BIG_L \
468 -erroff=E_STATIC_UNUSED \
05c462c4 469 -erroff=E_TRUE_LOGICAL_EXPR
2304df62 470
abcf5ada 471splintflags = \
472 -I/usr/lib/gcc/i486-linux-gnu/4.0.2/include/ \
473 -D__builtin_va_list=va_list \
474 -Dsigjmp_buf=jmp_buf \
475 -warnposix \
476 \
477 +boolint \
478 +charintliteral \
479 -fixedformalarray \
480 -mustfreefresh \
481 -nestedextern \
482 -predboolint \
483 -predboolothers \
484 -preproc \
485 -boolops \
486 -shadow \
487 -nullstate \
488 +longintegral \
489 +matchanyintegral \
490 -type \
491 \
492 +line-len 999 \
493 +weak
494
495splintfiles = $(c1)
496
cd4d8a96 497.c$(OBJ_EXT):
d96ebe2e 498 $(CCCMD) $(PLDLFLAGS) $*.c
2304df62 499
89ada9f2 500.c.i:
501 $(CCCMDSRC) -E $*.c > $*.i
502
503.c.s:
504 $(CCCMDSRC) -S $*.c
505
51356d76 506all: $(FIRSTMAKEFILE) miniperl$(EXE_EXT) extra.pods $(private) $(unidatafiles) $(public) $(dynamic_ext) $(nonxs_ext) extras.make
507 @echo " ";
508 @echo " Everything is up to date. Type '$(MAKE) test' to run test suite."
509
81c61bd5 510sperl$(OBJ_EXT): perl.c $(h)
511 $(RMS) sperl.c
512 $(LNS) perl.c sperl.c
513 $(CCCMD) -DIAMSUID sperl.c
514 $(RMS) sperl.c
515
516sperl.i: perl.c $(h)
517 $(CCCMDSRC) -DIAMSUID -E perl.c > sperl.i
518
de125441 519.PHONY: all translators utilities
6ee623d5 520
2d9d8159 521translators: miniperl$(EXE_EXT) $(CONFIGPM) FORCE
6ee623d5 522 @echo " "; echo " Making x2p stuff"; cd x2p; $(LDLIBPTH) $(MAKE) all
8e07c86e 523
2d9d8159 524utilities: miniperl$(EXE_EXT) $(CONFIGPM) $(plextract) lib/lib.pm FORCE
6ee623d5 525 @echo " "; echo " Making utilities"; cd utils; $(LDLIBPTH) $(MAKE) all
909b3858 526
527
16d20bd9 528# This is now done by installman only if you actually want the man pages.
529# @echo " "; echo " Making docs"; cd pod; $(MAKE) all;
85e6fe83 530
531# Phony target to force checking subdirectories.
e50aee73 532# Apparently some makes require an action for the FORCE target.
869a466c 533.PHONY: FORCE
85e6fe83 534FORCE:
4633a7c4 535 @sh -c true
ac9901e0 536!NO!SUBS!
5a20539c 537$spitshell >>$Makefile <<!GROK!THIS!
85e6fe83 538
4ba7095c 539# We do a copy of the op.c instead of a symlink because gcc gets huffy
540# if we have a symlink forest to another disk (it complains about too many
541# levels of symbolic links, even if we have only two)
542
c015c5e4 543opmini.c: op.c
3d30f400 544 \$(RMS) opmini.c
2c38b89b 545 \$(CPS) op.c opmini.c
c015c5e4 546
547opmini\$(OBJ_EXT): opmini.c
ac9901e0 548 \$(CCCMD) \$(PLDLFLAGS) $DPERL_EXTERNAL_GLOB opmini.c
bd0dd1d8 549
9444d213 550globals\$(OBJ_EXT): uudmap.h
551
5a20539c 552uudmap.h: generate_uudmap\$(HOST_EXE_EXT)
553 \$(RUN) ./generate_uudmap\$(HOST_EXE_EXT) >uudmap.h
9444d213 554
5a20539c 555generate_uudmap\$(HOST_EXE_EXT): generate_uudmap\$(OBJ_EXT)
556 \$(CC) -o generate_uudmap\$(EXE_EXT) \$(LDFLAGS) generate_uudmap\$(OBJ_EXT) \$(libs)
9444d213 557
ac9901e0 558!GROK!THIS!
5a20539c 559$spitshell >>$Makefile <<'!NO!SUBS!'
517e7c64 560miniperlmain$(OBJ_EXT): miniperlmain.c patchlevel.h
92c28edd 561 $(CCCMD) $(PLDLFLAGS) $*.c
ecfc5424 562
92c28edd 563perlmain.c: miniperlmain.c config.sh $(FIRSTMAKEFILE)
2c38b89b 564 sh writemain $(DYNALOADER) $(static_ext) > perlmain.c
85e6fe83 565
cd4d8a96 566perlmain$(OBJ_EXT): perlmain.c
92c28edd 567 $(CCCMD) $(PLDLFLAGS) $*.c
85e6fe83 568
a0d0e21e 569# The file ext.libs is a list of libraries that must be linked in
570# for static extensions, e.g. -lm -lgdbm, etc. The individual
571# static extension Makefile's add to it.
fed7345c 572ext.libs: $(static_ext)
a0d0e21e 573 -@test -f ext.libs || touch ext.libs
85e6fe83 574
ecfc5424 575!NO!SUBS!
599a829f 576
d96ebe2e 577# How to build libperl. This is still rather convoluted.
599a829f 578# Load up custom Makefile.SH fragment for shared loading and executables:
8736538c 579case "$osname" in
8736538c 580*)
581 Makefile_s="$osname/Makefile.SHs"
582 ;;
583esac
584
549a6b10 585case "$osname" in
586aix)
5a20539c 587 $spitshell >>$Makefile <<!GROK!THIS!
9c839522 588LIBS = $perllibs
5f9d9a17 589# In AIX we need to change this for building Perl itself from
590# its earlier definition (which is for building external
591# extensions *after* Perl has been built and installed)
592CCDLFLAGS = `echo $ccdlflags|sed -e 's@-bE:.*/perl\.exp@-bE:perl.exp@'`
549a6b10 593
594!GROK!THIS!
595 case "$useshrplib" in
596 define|true|[yY]*)
5a20539c 597 $spitshell >>$Makefile <<'!NO!SUBS!'
549a6b10 598
599LIBPERL_NONSHR = libperl_nonshr$(LIB_EXT)
600MINIPERL_NONSHR = miniperl_nonshr$(EXE_EXT)
601
a643aca6 602$(LIBPERL_NONSHR): $(obj)
549a6b10 603 $(RMS) $(LIBPERL_NONSHR)
a643aca6 604 $(AR) rcu $(LIBPERL_NONSHR) $(obj)
549a6b10 605
bd0dd1d8 606$(MINIPERL_NONSHR): $(LIBPERL_NONSHR) miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT)
a7089531 607 $(CC) $(LDFLAGS) -o $(MINIPERL_NONSHR) miniperlmain$(OBJ_EXT) \
608 opmini$(OBJ_EXT) $(LIBPERL_NONSHR) $(LIBS)
549a6b10 609
610MINIPERLEXP = $(MINIPERL_NONSHR)
611
612LIBPERLEXPORT = perl.exp
613
614!NO!SUBS!
615
616 ;;
617 *)
5a20539c 618 $spitshell >>$Makefile <<'!NO!SUBS!'
549a6b10 619MINIPERLEXP = miniperl$(EXE_EXT)
620
621PERLEXPORT = perl.exp
622
623!NO!SUBS!
624 ;;
625 esac
5a20539c 626 $spitshell >>$Makefile <<'!NO!SUBS!'
549a6b10 627perl.exp: $(MINIPERLEXP) makedef.pl config.sh $(SYM) $(SYMH)
2c38b89b 628 ./$(MINIPERLEXP) makedef.pl PLATFORM=aix CC_FLAGS="$(OPTIMIZE)" | sort -u | sort -f > perl.exp
549a6b10 629
630!NO!SUBS!
631 ;;
2c2d71f5 632os2)
5a20539c 633 $spitshell >>$Makefile <<'!NO!SUBS!'
2c2d71f5 634MINIPERLEXP = miniperl
635
636perl5.def: $(MINIPERLEXP) makedef.pl config.sh $(SYM) $(SYMH) miniperl.map
46aae397 637 ./$(MINIPERLEXP) makedef.pl PLATFORM=os2 -DPERL_DLL=$(PERL_DLL) CC_FLAGS="$(OPTIMIZE)" > perl5.def
2c2d71f5 638
639!NO!SUBS!
640 ;;
5f9145a3 641cygwin)
5a20539c 642 $spitshell >>$Makefile <<'!NO!SUBS!'
5f9145a3 643cygwin.c: cygwin/cygwin.c
644 $(LNS) cygwin/cygwin.c
645
646LIBPERL_NONSHR = libperl$(LIB_EXT)
647
648$(LIBPERL_NONSHR): $(obj)
649 $(RMS) $(LIBPERL_NONSHR)
650 $(AR) rcu $(LIBPERL_NONSHR) $(obj)
651
652!NO!SUBS!
653 ;;
549a6b10 654esac
655
5f9145a3 656if test -s $Makefile_s ; then
8736538c 657 . $Makefile_s
5a20539c 658 $spitshell >>$Makefile <<!GROK!THIS!
cd4d8a96 659
8736538c 660Makefile: $Makefile_s
cd4d8a96 661!GROK!THIS!
662else
5ac1e9b2 663 case "$dtrace_h" in
664 ?*)
5a20539c 665 $spitshell >>$Makefile <<'!NO!SUBS!'
5ac1e9b2 666$(DTRACE_H): perldtrace.d
667 $(DTRACE) -h -s perldtrace.d -o $(DTRACE_H)
668
669mydtrace.h: $(DTRACE_H)
670
671!NO!SUBS!
672 ;;
673 esac
674 case "$dtrace_o" in
675 ?*)
5a20539c 676 $spitshell >>$Makefile <<'!NO!SUBS!'
5ac1e9b2 677$(DTRACE_O): perldtrace.d
678 $(DTRACE) -G -s perldtrace.d -o $(DTRACE_O) $(ndt_obj)
679
680!NO!SUBS!
681 ;;
682 esac
5a20539c 683 $spitshell >>$Makefile <<'!NO!SUBS!'
908fcb8b 684$(LIBPERL): $& $(obj) $(DYNALOADER) $(LIBPERLEXPORT)
9c9e9f08 685!NO!SUBS!
d96ebe2e 686 case "$useshrplib" in
687 true)
5a20539c 688 $spitshell >>$Makefile <<'!NO!SUBS!'
0107c41a 689 rm -f $@
908fcb8b 690 $(LD) -o $@ $(SHRPLDFLAGS) $(obj) $(DYNALOADER) $(libs)
3c321fdc 691!NO!SUBS!
692 case "$osname" in
693 aix)
5a20539c 694 $spitshell >>$Makefile <<'!NO!SUBS!'
28e8609d 695 rm -f libperl$(OBJ_EXT)
3c321fdc 696 mv $@ libperl$(OBJ_EXT)
697 $(AR) qv $(LIBPERL) libperl$(OBJ_EXT)
ecfc5424 698!NO!SUBS!
3c321fdc 699 ;;
700 esac
d96ebe2e 701 ;;
702 *)
5a20539c 703 $spitshell >>$Makefile <<'!NO!SUBS!'
d96ebe2e 704 rm -f $(LIBPERL)
908fcb8b 705 $(AR) rcu $(LIBPERL) $(obj) $(DYNALOADER)
d96ebe2e 706 @$(ranlib) $(LIBPERL)
655635e8 707!NO!SUBS!
d96ebe2e 708 ;;
709 esac
5a20539c 710 $spitshell >>$Makefile <<'!NO!SUBS!'
599a829f 711
712# How to build executables.
713
714# The $& notation tells Sequent machines that it can do a parallel make,
715# and is harmless otherwise.
716# The miniperl -w -MExporter line is a basic cheap test to catch errors
717# before make goes on to run preplibrary and then MakeMaker on extensions.
718# This is very handy because later errors are often caused by miniperl
719# build problems but that's not obvious to the novice.
720# The Module used here must not depend on Config or any extensions.
721
ecfb2188 722!NO!SUBS!
723
724 case "${osname}${osvers}" in
e56d2c04 725 aix*|beos*)
5a20539c 726 $spitshell >>$Makefile <<'!NO!SUBS!'
727miniperl$(EXE_EXT): $& miniperlmain$(OBJ_EXT) $(obj) opmini$(OBJ_EXT)
728 $(CC) -o miniperl$(EXE_EXT) $(CLDFLAGS) \
8fdf96e1 729 `echo $(obj) | sed 's/ op$(OBJ_EXT) / /'` \
a643aca6 730 miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(libs)
5a20539c 731 $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
ecfb2188 732!NO!SUBS!
733 ;;
e56d2c04 734 next4*)
5a20539c 735 $spitshell >>$Makefile <<'!NO!SUBS!'
736miniperl$(EXE_EXT): $& miniperlmain$(OBJ_EXT) $(obj) opmini$(OBJ_EXT)
737 $(CC) -o miniperl$(EXE_EXT) `echo $(obj) | sed 's/ op$(OBJ_EXT) / /'` \
a643aca6 738 miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(libs)
5a20539c 739 $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
535d2540 740!NO!SUBS!
741 ;;
cb3fc426 742 darwin*)
986530ea 743 case "$osvers" in
744 [1-6].*) ;;
745 *) case "$ldflags" in
746 *"-flat_namespace"*) ;;
747 *) # to allow opmini.o to override stuff in libperl.dylib
5a20539c 748 $spitshell >>$Makefile <<!NO!SUBS!
69625aa9 749NAMESPACEFLAGS = -force_flat_namespace
750!NO!SUBS!
986530ea 751 ;;
752 esac
753 ;;
cb3fc426 754 esac
5a20539c 755 $spitshell >>$Makefile <<'!NO!SUBS!'
908fcb8b 756miniperl$(EXE_EXT): $& miniperlmain$(OBJ_EXT) $(obj) opmini$(OBJ_EXT)
cb3fc426 757 -@rm -f miniperl.xok
5a20539c 758 $(CC) $(CLDFLAGS) $(NAMESPACEFLAGS) -o miniperl$(EXE_EXT) \
908fcb8b 759 `echo $(obj) | sed 's/ op$(OBJ_EXT) / /'` \
760 miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(libs)
5a20539c 761 $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
cb3fc426 762!NO!SUBS!
763 ;;
ecfb2188 764 *)
5a20539c 765 $spitshell >>$Makefile <<'!NO!SUBS!'
908fcb8b 766miniperl$(EXE_EXT): $& miniperlmain$(OBJ_EXT) $(obj) opmini$(OBJ_EXT)
93c0359c 767 -@rm -f miniperl.xok
5a20539c 768 $(LDLIBPTH) $(CC) $(CLDFLAGS) -o miniperl$(EXE_EXT) \
908fcb8b 769 `echo $(obj) | sed 's/ op$(OBJ_EXT) / /'` \
770 miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(libs)
5a20539c 771 $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
ecfb2188 772!NO!SUBS!
773 ;;
774 esac
775
5a20539c 776 $spitshell >>$Makefile <<'!NO!SUBS!'
599a829f 777
908fcb8b 778perl$(EXE_EXT): $& perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT)
93c0359c 779 -@rm -f miniperl.xok
908fcb8b 780 $(SHRPENV) $(LDLIBPTH) $(CC) -o perl$(PERL_SUFFIX) $(PERL_PROFILE_LDFLAGS) $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
599a829f 781
4ae3d70a 782# Purify/Quantify Perls.
783
908fcb8b 784pureperl$(EXE_EXT): $& perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT)
785 $(SHRPENV) $(LDLIBPTH) purify $(CC) -o pureperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
599a829f 786
908fcb8b 787purecovperl$(EXE_EXT): $& perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT)
788 $(SHRPENV) $(LDLIBPTH) purecov $(CC) -o purecovperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
dbadb36a 789
908fcb8b 790quantperl$(EXE_EXT): $& perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT)
791 $(SHRPENV) $(LDLIBPTH) quantify $(CC) -o quantperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
2304df62 792
7a834142 793# Valgrind perl (currently Linux only)
794
795perl.valgrind.config: config.sh
796 @echo "To build perl.valgrind you must Configure -Doptimize=-g -Uusemymalloc, checking..."
797 @$(MAKE) perl.config.dashg
798 @echo "Checking usemymalloc='n' in config.sh..."
799 @grep "^usemymalloc=" config.sh
800 @grep "^usemymalloc='n'" config.sh >/dev/null || exit 1
801 @echo "And of course you have to have valgrind..."
4f9287d3 802 $(VALGRIND) ./perl -e 1 2>/dev/null || exit 1
7a834142 803
4ae3d70a 804# Third Degree Perl (Tru64 only)
805
719561de 806perl.config.dashg:
83f0ef60 807 @echo "Checking optimize='-g' in config.sh..."
fdb8bc18 808 @grep "^optimize=" config.sh
809 @egrep "^optimize='(.*-g.*)'" config.sh >/dev/null || exit 1
4ae3d70a 810
811perl.third.config: config.sh
812 @echo "To build perl.third you must Configure -Doptimize=-g -Uusemymalloc, checking..."
6e36760b 813 @$(MAKE) perl.config.dashg
83f0ef60 814 @echo "Checking usemymalloc='n' in config.sh..."
815 @grep "^usemymalloc=" config.sh
816 @grep "^usemymalloc='n'" config.sh >/dev/null || exit 1
170ba846 817
412c6516 818perl.third: /usr/bin/atom perl.third.config perl
dca31ef4 819 atom -tool third -L. -all -gp -toolargs="-invalid -uninit heap+stack+copy -min 0" perl
83f0ef60 820 @echo "Now you may run perl.third and then study perl.3log."
15615bfd 821
4ae3d70a 822# Pixie Perls (Tru64 and IRIX only)
823
719561de 824perl.pixie.config: config.sh
4ae3d70a 825 @echo "To build perl.pixie you must Configure -Doptimize=-g, checking..."
6e36760b 826 @$(MAKE) perl.config.dashg
4ae3d70a 827
719561de 828perl.pixie.atom: /usr/bin/atom perl
4ae3d70a 829 atom -tool pixie -L. -all -toolargs="-quiet" perl
830
831perl.pixie.irix: perl
832 pixie perl
833
719561de 834perl.pixie: /usr/bin/pixie perl.pixie.config perl
4ae3d70a 835 if test -x /usr/bin/atom; then \
836 $(MAKE) perl.pixie.atom; \
837 else \
838 $(MAKE) perl.pixie.irix; \
839 fi
83f0ef60 840 @echo "Now you may run perl.pixie and then run pixie."
841
842# Gprof Perl
843
844perl.config.dashpg:
845 @echo "Checking optimize='-pg' in config.sh..."
846 @grep "^optimize=" config.sh
64778e5f 847 @grep "^optimize='.*-pg.*'" config.sh >/dev/null || exit 1
83f0ef60 848
849perl.gprof.config: config.sh
850 @echo "To build perl.gprof you must Configure -Doptimize=-pg, checking..."
851 @$(MAKE) perl.config.dashpg
852
853perl.gprof: /usr/bin/gprof perl.gprof.config
64778e5f 854 @-rm -f perl
51a35ef1 855 $(MAKE) PERL_SUFFIX=.gprof PERL_PROFILE_LDFLAGS=-pg perl
83f0ef60 856 @echo "Now you may run perl.gprof and then run gprof perl.gprof."
4ae3d70a 857
51a35ef1 858# Gcov Perl
859
860perl.config.gcov:
861 @echo "To build perl.gcov you must use gcc 3.0 or newer, checking..."
862 @echo "Checking gccversion in config.sh..."
863 @grep "^gccversion=" config.sh
864 @grep "^gccversion='[3-9]\." config.sh >/dev/null || exit 1
865 @echo "To build perl.gcov you must Configure -Dccflags=-fprofile-arcs -ftest-coverage, checking..."
866 @echo "Checking ccflags='-fprofile-arcs -ftest-coverage' in config.sh..."
867 @grep "^ccflags=" config.sh
868 @grep "^ccflags='.*-fprofile-arcs -ftest-coverage.*'" config.sh >/dev/null || exit 1
869
870perl.gcov: perl.config.gcov
871 @-rm -f perl
872 $(MAKE) PERL_SUFFIX=.gcov PERL_PROFILE_LDFLAGS='' perl
873 @echo "Now you may run perl.gcov and then run gcov some.c."
874
f946bb38 875# Microperl. This is just a convenience thing if one happens to
876# build also the full Perl and therefore the real big Makefile:
f4db5405 877# usually one should manually explicitly issue the below command.
f946bb38 878
869a466c 879.PHONY: microperl
f946bb38 880microperl:
881 $(MAKE) -f Makefile.micro
882
2304df62 883# This version, if specified in Configure, does ONLY those scripts which need
884# set-id emulation. Suidperl must be setuid root. It contains the "taint"
885# checks as well as the special code to validate that the script in question
886# has been invoked correctly.
887
908fcb8b 888suidperl$(EXE_EXT): $& sperl$(OBJ_EXT) perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT)
889 $(SHRPENV) $(LDLIBPTH) $(CC) -o suidperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) sperl$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
2304df62 890
599a829f 891!NO!SUBS!
892
893fi
894
6d4b7d88 895# Some environment have no system(), which mkpport uses.
896# Let's try running the commands with shell.
897case "${osname}" in
898catamount)
5a20539c 899$spitshell >>$Makefile <<!GROK!THIS!
6d4b7d88 900.PHONY: makeppport
901makeppport: miniperl\$(EXE_EXT) \$(CONFIGPM)
902 -@for f in Makefile.PL PPPort_pm.PL PPPort_xs.PL ppport_h.PL; do \
903 (cd ext/Devel/PPPort && `pwd`/run.sh ../../../miniperl -I../../../lib \$\$f); \
904 done
905
906!GROK!THIS!
907;;
908*)
5a20539c 909$spitshell >>$Makefile <<'!NO!SUBS!'
6d4b7d88 910.PHONY: makeppport
911makeppport: miniperl$(EXE_EXT) $(CONFIGPM)
912 $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib mkppport
913
914!NO!SUBS!
915;;
916esac
917
5a20539c 918$spitshell >>$Makefile <<'!NO!SUBS!'
599a829f 919
fec02dd3 920# We have to call our ./makedir because Ultrix 4.3 make can't handle the line
921# test -d lib/auto || mkdir lib/auto
5b7e50ea 922# We need to autosplit in two steps because VOS can't handle so many args
fec02dd3 923#
869a466c 924.PHONY: preplibrary
2d9d8159 925preplibrary: miniperl$(EXE_EXT) $(CONFIGPM) lib/lib.pm $(PREPLIBRARY_LIBPERL)
cd4d8a96 926 @sh ./makedir lib/auto
a0d0e21e 927 @echo " AutoSplitting perl library"
b306dcb3 928 $(LDLIBPTH) $(RUN) ./miniperl -Ilib -MAutoSplit -MFile::Find -e 'find ({no_chdir=>1, wanted => sub {autosplit_lib_modules($$_) if /\.pm$$/}}, "lib")'
abae58a6 929 $(MAKE) lib/re.pm
2304df62 930
5a20539c 931$(CONFIGPOD): config.sh miniperl$(EXE_EXT) configpm Porting/Glossary
cef6ea9d 932 $(LDLIBPTH) $(RUN) ./miniperl -Ilib configpm
2304df62 933
5a20539c 934$(CONFIGPM): $(CONFIGPOD)
82169296 935
2d9d8159 936lib/ExtUtils/Miniperl.pm: miniperlmain.c miniperl$(EXE_EXT) minimod.pl $(CONFIGPM)
cef6ea9d 937 $(LDLIBPTH) $(RUN) ./miniperl minimod.pl > lib/ExtUtils/Miniperl.pm
fed7345c 938
92c28edd 939lib/re.pm: ext/re/re.pm
960d5a3a 940 @-rm -f $@
2c38b89b 941 cp ext/re/re.pm lib/re.pm
7cfc0d09 942
2d9d8159 943$(plextract): miniperl$(EXE_EXT) $(CONFIGPM) x2p/s2p
42c30c63 944 @-rm -f $@
cef6ea9d 945 $(LDLIBPTH) $(RUN) ./miniperl -I`pwd`/lib $@.PL
72b3d9b4 946
2d9d8159 947x2p/s2p: miniperl$(EXE_EXT) $(CONFIGPM) x2p/s2p.PL
36cf9c44 948 cd x2p; $(LDLIBPTH) $(MAKE) s2p
180c42e0 949
2d9d8159 950lib/lib.pm: miniperl$(EXE_EXT) $(CONFIGPM)
42c30c63 951 @-rm -f $@
cef6ea9d 952 $(LDLIBPTH) $(RUN) ./miniperl -Ilib lib/lib_pm.PL
4755096e 953
6c684aee 954unidatafiles $(unidatafiles): uni.data
955
956uni.data: miniperl$(EXE_EXT) $(CONFIGPM) lib/unicore/mktables
cef6ea9d 957 cd lib/unicore && $(LDLIBPTH) $(RUN) ../../miniperl -I../../lib mktables -w
6c684aee 958 touch uni.data
5ad7e614 959
443a5b98 960extra.pods: miniperl$(EXE_EXT)
ebbebb7c 961 -@test ! -f extra.pods || rm -f `cat extra.pods`
72b3d9b4 962 -@rm -f extra.pods
b4bc034f 963 -@for x in `grep -l '^=[a-z]' README.* | grep -v README.vms` ; do \
72b3d9b4 964 nx=`echo $$x | sed -e "s/README\.//"`; \
40096396 965 cd pod ; $(LNS) ../$$x "perl"$$nx".pod" ; cd .. ; \
72b3d9b4 966 echo "pod/perl"$$nx".pod" >> extra.pods ; \
967 done
a8476e91 968 -@rm -f pod/perlvms.pod
969 -@test -f vms/perlvms.pod && cd pod && $(LNS) ../vms/perlvms.pod perlvms.pod && cd .. && echo "pod/perlvms.pod" >> extra.pods
1400179b 970 -@rm -f pod/perldelta.pod
7120b314 971 -@test -f pod/perl5110delta.pod && cd pod && $(LNS) perl5110delta.pod perldelta.pod && cd .. && echo "pod/perldelta.pod" >> extra.pods # See buildtoc
ebbebb7c 972
443a5b98 973extras.make: perl$(EXE_EXT)
6d4b7d88 974 -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(LDLIBPTH) $(RUN) ./perl -Ilib -MCPAN -e '@ARGV&&make(@ARGV)' `cat extras.lst`
bf35c3f6 975
443a5b98 976extras.test: perl$(EXE_EXT)
6d4b7d88 977 -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(LDLIBPTH) $(RUN) ./perl -Ilib -MCPAN -e '@ARGV&&test(@ARGV)' `cat extras.lst`
bf35c3f6 978
443a5b98 979extras.install: perl$(EXE_EXT)
6d4b7d88 980 -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(LDLIBPTH) $(RUN) ./perl -Ilib -MCPAN -e '@ARGV&&install(@ARGV)' `cat extras.lst`
bf35c3f6 981
869a466c 982.PHONY: install install-strip install-all install-verbose install-silent \
5e2f386f 983 no-install install.perl install.man install.html
869a466c 984
0cf51544 985META.yml: Porting/makemeta Porting/Maintainers.pl Porting/Maintainers.pm
cef6ea9d 986 $(LDLIBPTH) $(RUN) ./miniperl -Ilib Porting/makemeta
0cf51544 987
f556e5b9 988install-strip:
70eaf669 989 $(MAKE) STRIPFLAGS=-s install DESTDIR="$(DESTDIR)"
f556e5b9 990
adbebc0b 991install install-all:
70eaf669 992 $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) DESTDIR="$(DESTDIR)"
c77385cf 993
4ad019ef 994install-verbose:
70eaf669 995 $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-V DESTDIR="$(DESTDIR)"
c458b76c 996
4ad019ef 997install-silent:
70eaf669 998 $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-S DESTDIR="$(DESTDIR)"
4ad019ef 999
1000no-install:
70eaf669 1001 $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-n DESTDIR="$(DESTDIR)"
16d20bd9 1002
70eaf669 1003# Set this to an empty string to avoid an attempt of rebuild before install
1004INSTALL_DEPENDENCE = all
1005
1006install.perl: $(INSTALL_DEPENDENCE) installperl
6d4b7d88 1007 $(LDLIBPTH) $(RUN) ./perl installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) $(STRIPFLAGS)
3eb2897c 1008 -@test ! -s extras.lst || $(MAKE) extras.install
a0d0e21e 1009
b1a1e9f1 1010install.man: all installman
6d4b7d88 1011 $(LDLIBPTH) $(RUN) ./perl installman --destdir=$(DESTDIR) $(INSTALLFLAGS)
16d20bd9 1012
84902520 1013# XXX Experimental. Hardwired values, but useful for testing.
1014# Eventually Configure could ask for some of these values.
1015install.html: all installhtml
40096396 1016 -@test -f README.vms && cd vms && $(LNS) ../README.vms README_vms.pod && cd ..
6d4b7d88 1017 $(LDLIBPTH) $(RUN) ./perl installhtml \
84902520 1018 --podroot=. --podpath=. --recurse \
47ec63d0 1019 --htmldir=$(privlib)/html \
1020 --htmlroot=$(privlib)/html \
84902520 1021 --splithead=pod/perlipc \
1022 --splititem=pod/perlfunc \
1023 --libpods=perlfunc:perlguts:perlvar:perlrun:perlop \
47ec63d0 1024 --ignore=Porting/Maintainers.pm,Porting/patching.pod,Porting/pumpkin.pod,Porting/repository.pod \
84902520 1025 --verbose
1026
16d20bd9 1027
a0d0e21e 1028# I now supply perly.c with the kits, so the following section is
0de566d7 1029# used only if you force bison to run by saying
1030# make regen_perly
1031# You normally shouldn't remake perly.[ch].
1032
1033.PHONY: regen_perly
1034
1035run_byacc:
1036 @echo "run_byacc is obsolete; try 'make regen_perly' instead"
1037
f05e27e5 1038# this outputs perly.h, perly.act and perly.tab
0de566d7 1039regen_perly:
1040 perl regen_perly.pl
56febc5e 1041
1042# We don't want to regenerate perly.c and perly.h, but they might
1043# appear out-of-date after a patch is applied or a new distribution is
1044# made.
92c28edd 1045perly.c: perly.y
b233458b 1046 -@sh -c true
1047
92c28edd 1048perly.h: perly.y
b233458b 1049 -@sh -c true
1050
bd656b61 1051# No compat3.sym here since and including the 5.004_50.
e4d5a464 1052# No interp.sym since 5.005_03.
22c35a8c 1053SYM = global.sym globvar.sym perlio.sym pp.sym
419eaf7b 1054
907b3e23 1055SYMH = perlvars.h intrpvar.h
419eaf7b 1056
dae78bb1 1057CHMOD_W = chmod +w
1058
a8581515 1059# The following files are generated automatically
9ad884cb 1060# autodoc.pl: pod/perlapi.pod pod/perlintern.pod
9ad884cb 1061# embed.pl: proto.h embed.h embedvar.h global.sym
1062# perlapi.h perlapi.c
1063# [* embed.pl needs pp.sym generated by opcode.pl! *]
1064# keywords.pl: keywords.h
1065# opcode.pl: opcode.h opnames.h pp_proto.h pp.sym
c83f8f39 1066# regcomp.pl: regnodes.h
1067# warnings.pl: warnings.h lib/warnings.pm
e50aee73 1068# The correct versions should be already supplied with the perl kit,
1069# in case you don't have perl available.
36bb303b 1070# To force them to be regenerated, run
9ad884cb 1071# perl regen.pl
36bb303b 1072# with your existing copy of perl
1073# (make regen_headers is kept for backwards compatibility)
e1354ed6 1074
b4d4469a 1075AUTOGEN_FILES = keywords.h opcode.h opnames.h pp_proto.h pp.sym proto.h \
1076 embed.h embedvar.h global.sym \
1077 pod/perlintern.pod pod/perlapi.pod \
de125441 1078 perlapi.h perlapi.c regnodes.h \
c83f8f39 1079 warnings.h lib/warnings.pm
e1354ed6 1080
869a466c 1081.PHONY: regen_headers regen_pods regen_all
1082
95aa0565 1083regen: FORCE
9ad884cb 1084 -perl regen.pl
8e07c86e 1085
95aa0565 1086regen_headers: FORCE
1087 -perl regen.pl -v
1088
4755096e 1089regen_pods: FORCE
fcfe1ab7 1090 -cd pod; $(LDLIBPTH) $(MAKE) regen_pods
4755096e 1091
0de566d7 1092regen_all: regen regen_pods
9fec149b 1093
1aea71db 1094.PHONY: manisort manicheck
1095
1096manisort: FORCE
f3a5d88c 1097 LC_ALL=C sort -fdc MANIFEST || (echo "WARNING: re-sorting MANIFEST"; \
1098 LC_ALL=C sort -fdo MANIFEST MANIFEST)
1aea71db 1099
1100manicheck: FORCE
1101 perl Porting/manicheck
1102
a0d0e21e 1103# Extensions:
4318d5a0 1104# Names added to $(dynamic_ext) or $(static_ext) or $(nonxs_ext) will
1105# automatically get built. There should ordinarily be no need to change
1106# any of this part of makefile.
a0d0e21e 1107#
1108# The dummy dependency is a place holder in case $(dynamic_ext) or
1109# $(static_ext) is empty.
1110#
1111# DynaLoader may be needed for extensions that use Makefile.PL.
1112
443a5b98 1113$(DYNALOADER): miniperl$(EXE_EXT) preplibrary FORCE
94c41b70 1114 @$(LDLIBPTH) sh ext/util/make_ext $(STATIC) $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
a0d0e21e 1115
42e07562 1116d_dummy $(dynamic_ext): miniperl$(EXE_EXT) preplibrary makeppport $(DYNALOADER) FORCE
92c28edd 1117 @$(LDLIBPTH) sh ext/util/make_ext dynamic $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
a0d0e21e 1118
42e07562 1119s_dummy $(static_ext): miniperl$(EXE_EXT) preplibrary makeppport $(DYNALOADER) FORCE
94c41b70 1120 @$(LDLIBPTH) sh ext/util/make_ext $(STATIC) $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
2304df62 1121
eedd3f99 1122n_dummy $(nonxs_ext): miniperl$(EXE_EXT) preplibrary FORCE
92c28edd 1123 @$(LDLIBPTH) sh ext/util/make_ext nonxs $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
9f3ef600 1124!NO!SUBS!
1125
5a20539c 1126$spitshell >>$Makefile <<EOF
9f3ef600 1127$extra_dep
1128EOF
1129
5a20539c 1130$spitshell >>$Makefile <<'!NO!SUBS!'
4318d5a0 1131
a774dfe6 1132.PHONY: printconfig
1133printconfig:
6d4b7d88 1134 @eval `$(LDLIBPTH) $(RUN) ./perl -Ilib -V:$(CONFIGVAR)`; echo $$$(CONFIGVAR)
a774dfe6 1135
869a466c 1136.PHONY: clean _tidy _mopup _cleaner1 _cleaner2 \
1137 realclean _realcleaner clobber _clobber \
687d3573 1138 distclean veryclean _verycleaner \
1139 cleanup_unpacked_files unpack_files
869a466c 1140
687d3573 1141clean: cleanup_unpacked_files _tidy _mopup
70af249b 1142
687d3573 1143realclean: cleanup_unpacked_files _realcleaner _mopup
fcfe1ab7 1144 @echo "Note that '$(MAKE) realclean' does not delete config.sh or Policy.sh"
70af249b 1145
b37ebb13 1146_clobber:
5440bc8e 1147 -@rm -f Cross/run-* Cross/to-* Cross/from-*
0279961e 1148 rm -f t/test_state
bf35c3f6 1149 rm -f config.sh cppstdin Policy.sh extras.lst
b37ebb13 1150
687d3573 1151clobber: cleanup_unpacked_files _realcleaner _mopup _clobber
70af249b 1152
1153distclean: clobber
1154
2edbd6da 1155# Like distclean but also removes emacs backups and *.orig.
f6cadd99 1156veryclean: cleanup_unpacked_files _verycleaner _mopup _clobber
b37ebb13 1157 -@rm -f Obsolete Wanted
2edbd6da 1158
70af249b 1159# Do not 'make _mopup' directly.
1160_mopup:
9444d213 1161 rm -f *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c opmini.c uudmap.h generate_uudmap$(EXE_EXT)
1ed50e5b 1162 -rmdir .depending
72b3d9b4 1163 -@test -f extra.pods && rm -f `cat extra.pods`
b4bc034f 1164 -@test -f vms/README_vms.pod && rm -f vms/README_vms.pod
6c684aee 1165 -rm -f perl.exp ext.libs extra.pods uni.data opmini.o
d96ebe2e 1166 -rm -f perl.export perl.dll perl.libexp perl.map perl.def
1cfa4ec7 1167 -rm -f perl.loadmap miniperl.loadmap perl.prelmap miniperl.prelmap
9d4d067b 1168 -rm -f perl.third lib*.so.perl.third perl.3log t/perl.third t/perl.3log
6a966751 1169 -rm -f perl.pixie lib*.so.perl.pixie lib*.so.Addrs
93c0359c 1170 -rm -f perl.Addrs perl.Counts t/perl.Addrs t/perl.Counts *perl.xok
ce0286c6 1171 -rm -f cygwin.c libperl*.def libperl*.dll cygperl*.dll *.exe.stackdump
1ed50e5b 1172 -rm -f perl$(EXE_EXT) suidperl$(EXE_EXT) miniperl$(EXE_EXT) $(LIBPERL) libperl.* microperl
1173 -rm -f opcode.h-old opnames.h-old pp.sym-old pp_proto.h-old
8b53a00d 1174 -rm -f config.arch config.over $(DTRACE_H)
70af249b 1175
1176# Do not 'make _tidy' directly.
1177_tidy:
e3f83878 1178 -cd pod; $(LDLIBPTH) $(MAKE) clean
1179 -cd utils; $(LDLIBPTH) $(MAKE) clean
1180 -cd x2p; $(LDLIBPTH) $(MAKE) clean
4318d5a0 1181 -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \
e3f83878 1182 $(LDLIBPTH) sh ext/util/make_ext clean $$x MAKE=$(MAKE) ; \
a0d0e21e 1183 done
ff68c719 1184
2edbd6da 1185_cleaner1:
4633a7c4 1186 -cd os2; rm -f Makefile
2edbd6da 1187 -cd pod; $(LDLIBPTH) $(MAKE) $(CLEAN)
1188 -cd utils; $(LDLIBPTH) $(MAKE) $(CLEAN)
1189 -cd x2p; $(LDLIBPTH) $(MAKE) $(CLEAN)
4318d5a0 1190 -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \
2edbd6da 1191 $(LDLIBPTH) sh ext/util/make_ext $(CLEAN) $$x MAKE=$(MAKE) ; \
a0d0e21e 1192 done
cef6ea9d 1193 -@test ! -f $(RUN) ./miniperl$(EXE_EXT) || $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib mkppport --clean
2edbd6da 1194
2ad994b6 1195# Some systems do not support "?", so keep these files separate.
2edbd6da 1196_cleaner2:
2ad994b6 1197 -rm -f core.*perl.*.? t/core.perl.*.? .?*.c
5033177e 1198 rm -f core *perl.core t/core t/*perl.core core.* t/core.*
2ad994b6 1199 rm -f t/misctmp* t/forktmp* t/tmp* t/c t/perl$(EXE_EXT) t/rantests
1200 rm -f so_locations $(LIBPERL_NONSHR) $(MINIPERL_NONSHR)
a0d0e21e 1201 rm -rf $(addedbyconf)
0eb4e931 1202 rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old makefile.old
c27f7bb1 1203 rm -f $(private)
ca12659b 1204 rm -rf $(unidatafiles) $(unidatadirs)
a0d0e21e 1205 rm -rf lib/auto
07a6e20d 1206 rm -f lib/.exists lib/*/.exists lib/*/*/.exists
16d20bd9 1207 rm -f h2ph.man pstruct
a0d0e21e 1208 rm -rf .config
f6cadd99 1209 rm -f preload lib/re.pm
0f4f294e 1210 rm -rf lib/Encode lib/Compress lib/Hash lib/re
c146e560 1211 rm -rf lib/TAP lib/Module/Pluggable lib/App
42182ddc 1212 rm -rf lib/IO/Compress lib/IO/Uncompress
fc2730c3 1213 rm -f lib/ExtUtils/ParseXS/t/XSTest.c
1214 rm -f lib/ExtUtils/ParseXS/t/XSTest$(OBJ_EXT)
1215 rm -f lib/ExtUtils/ParseXS/t/XSTest$(DLSUFFIX)
b6c155fe 1216 rm -fr lib/B
1217 -rmdir lib/Data
af39be2f 1218 -rmdir lib/Filter/Util lib/IO/Socket
45812765 1219 -rmdir lib/List lib/MIME lib/Scalar lib/Sys
01f2eac4 1220 -rmdir lib/threads lib/XS
2d55c85b 1221 -rmdir lib/CPANPLUS/Dist/Build/t/dummy-*
1222 -rmdir lib/CPANPLUS/t/dummy-cpanplus lib/CPANPLUS/t/dummy-localmirror
b0d7393a 1223 -rm -f lib/ExtUtils/CBuilder/t/libcompilet.dll.a
1224 -rm -f lib/ExtUtils/ParseXS/t/libXSTest.dll.a
ecfc5424 1225
f4db5405 1226_realcleaner:
2edbd6da 1227 @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=realclean
1228 @$(LDLIBPTH) $(MAKE) _cleaner2
1229
f4db5405 1230_verycleaner:
2edbd6da 1231 @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=veryclean
1232 @$(LDLIBPTH) $(MAKE) _cleaner2
c94787a5 1233 -rm -f *~ *.orig */*~ */*.orig */*/*~ */*/*.orig
2edbd6da 1234
869a466c 1235.PHONY: lint
bf0dfd28 1236lint: $(c)
075abff3 1237 rm -f *.ln
66a1b24b 1238 lint $(lintflags) -DPERL_CORE -D_REENTRANT -DDEBUGGING -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(c)
2304df62 1239
abcf5ada 1240.PHONY: splint
1241splint: $(c)
1242 splint $(splintflags) -DPERL_CORE -D_REENTRANT -DDEBUGGING -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(splintfiles)
1243
fb73857a 1244# Need to unset during recursion to go out of loop.
1245# The README below ensures that the dependency list is never empty and
1246# that when MAKEDEPEND is empty $(FIRSTMAKEFILE) doesn't need rebuilding.
cd4d8a96 1247
84902520 1248MAKEDEPEND = Makefile makedepend
cd4d8a96 1249
fb73857a 1250$(FIRSTMAKEFILE): README $(MAKEDEPEND)
cd4d8a96 1251 $(MAKE) depend MAKEDEPEND=
a0d0e21e 1252
599a829f 1253config.h: config_h.SH config.sh
655635e8 1254 $(SHELL) config_h.SH
1255
a0d0e21e 1256# When done, touch perlmain.c so that it doesn't get remade each time.
869a466c 1257.PHONY: depend
2304df62 1258depend: makedepend
fb73857a 1259 sh ./makedepend MAKE=$(MAKE)
a0d0e21e 1260 - test -s perlmain.c && touch perlmain.c
2304df62 1261 cd x2p; $(MAKE) depend
1262
cd4d8a96 1263# Cannot postpone this until $firstmakefile is ready ;-)
92c28edd 1264makedepend: makedepend.SH config.sh
1265 sh ./makedepend.SH
cd4d8a96 1266
1167a30e 1267.PHONY: test check test_prep test_prep_nodll test_prep_pre _test_prep \
869a466c 1268 test_tty test-tty _test_tty test_notty test-notty _test_notty \
e018f8be 1269 utest ucheck test.utf8 check.utf8 test.torture torturetest \
1de9afcd 1270 test.utf16 check.utf16 utest.utf16 ucheck.utf16 \
869a466c 1271 test.third check.third utest.third ucheck.third test_notty.third \
69bfbd2f 1272 test.deparse test_notty.deparse test_harness test_harness_notty \
4979e288 1273 minitest coretest test.taintwarn test-reonly
869a466c 1274
ec861bc1 1275# Cannot delegate rebuilding of t/perl to make
1276# to allow interlaced test and minitest
3e3baf6d 1277
1167a30e 1278TESTFILE=TEST
1279
687d3573 1280_test_prep: unpack_files
ec861bc1 1281 cd t && (rm -f $(PERL)$(EXE_EXT); $(LNS) ../$(PERL)$(EXE_EXT) $(PERL)$(EXE_EXT))
3e3baf6d 1282
1167a30e 1283# Architecture-neutral stuff:
1284
1285test_prep_pre: preplibrary utilities $(nonxs_ext)
1286
4caedec1 1287test_prep: test_prep_pre miniperl$(EXE_EXT) $(unidatafiles) perl$(EXE_EXT) $(dynamic_ext) $(TEST_PERL_DLL)
5fe84fd2 1288 PERL=./perl $(MAKE) _test_prep
ec861bc1 1289
5fe84fd2 1290_test_tty:
3d18daf1 1291 cd t && $(PERL_DEBUG) $(LDLIBPTH) $(PERL) $(TESTFILE) $(TEST_ARGS) $(TEST_FILES) </dev/tty
ec861bc1 1292
5fe84fd2 1293_test_notty:
3d18daf1 1294 cd t && $(PERL_DEBUG) PERL_SKIP_TTY_TEST=1 $(LDLIBPTH) $(PERL) $(TESTFILE) $(TEST_ARGS) $(TEST_FILES)
ec861bc1 1295
687d3573 1296unpack_files:
cef6ea9d 1297 $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib uupacktool.pl -u -m
687d3573 1298
1299cleanup_unpacked_files:
cef6ea9d 1300 -@test ! -f $(RUN) ./miniperl$(EXE_EXT) || $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib uupacktool.pl -c
687d3573 1301
ec861bc1 1302# The second branch is for testing without a tty or controlling terminal,
1303# see t/op/stat.t
1304_test:
994e9bc0 1305 if (true </dev/tty) >/dev/null 2>&1; then \
4979e288 1306 $(MAKE) TEST_ARGS='$(TEST_ARGS)' TESTFILE=$(TESTFILE) _test_tty ; \
994e9bc0 1307 else \
4979e288 1308 $(MAKE) TEST_ARGS='$(TEST_ARGS)' TESTFILE=$(TESTFILE) _test_notty ; \
994e9bc0 1309 fi
3d8f1d64 1310 @echo "Ran tests" > t/rantests
a0ed51b3 1311
937aca76 1312test check: test_prep
ec861bc1 1313 PERL=./perl $(MAKE) _test
1314
937aca76 1315test_tty: test_prep
5fe84fd2 1316 PERL=./perl $(MAKE) _test_tty
ec861bc1 1317
937aca76 1318test_notty: test_prep
5fe84fd2 1319 PERL=./perl $(MAKE) _test_notty
ec861bc1 1320
83f0ef60 1321utest ucheck test.utf8 check.utf8: test_prep
35117553 1322 PERL=./perl TEST_ARGS=-utf8 $(MAKE) _test
ec861bc1 1323
5a6e071d 1324coretest: test_prep
1325 PERL=./perl TEST_ARGS=-core $(MAKE) _test
1326
48a293f8 1327test-prep: test_prep
5fe84fd2 1328
1329test-tty: test_tty
1330
1331test-notty: test_notty
1332
e018f8be 1333# Torture testing
1334
1335test.torture torturetest: test_prep
1336 PERL=./perl TEST_ARGS=-torture $(MAKE) _test
1337
1de9afcd 1338# Targets for UTF16 testing:
1339
1340minitest.utf16: minitest.prep
1341 - cd t && (rm -f perl$(EXE_EXT); $(LNS) ../miniperl$(EXE_EXT) perl$(EXE_EXT)) \
8cebccf4 1342 && $(LDLIBPTH) $(RUN) ./perl TEST -minitest -utf16 base/*.t comp/*.t cmd/*.t run/*.t io/*.t op/*.t uni/*.t mro/*.t </dev/tty
1de9afcd 1343
1344test.utf16 check.utf16: test_prep
1345 PERL=./perl $(MAKE) TEST_ARGS=-utf16 _test
1346
1347utest.utf16 ucheck.utf16: test_prep
1348 PERL=./perl $(MAKE) TEST_ARGS="-utf8 -utf16" _test
1349
7a834142 1350# Targets for valgrind testing:
1351
1352test_prep.valgrind: test_prep perl.valgrind
1353 PERL=./perl $(MAKE) _test_prep
1354
1355test.valgrind check.valgrind: test_prep perl.valgrind.config
4f9287d3 1356 PERL=./perl PERL_DEBUG=PERL_VALGRIND=1 VALGRIND='$(VALGRIND)' $(MAKE) _test
7a834142 1357
78f158d1 1358utest.valgrind ucheck.valgrind: test_prep.valgrind perl.valgrind.config
7a834142 1359 PERL=./perl PERL_DEBUG=PERL_VALGRIND=1 TEST_ARGS=-utf8 $(MAKE) _test
1360
78f158d1 1361test_notty.valgrind: test_prep.valgrind perl.valgrind.config
7a834142 1362 PERL=./perl $(MAKE) PERL_DEBUG=PERL_VALGRIND=1 _test_notty
1363
ec861bc1 1364# Targets for Third Degree testing.
1365
9b99345a 1366test_prep.third: test_prep perl.third
5fe84fd2 1367 PERL=./perl.third $(MAKE) _test_prep
ec861bc1 1368
937aca76 1369test.third check.third: test_prep.third perl.third
ec861bc1 1370 PERL=./perl.third PERL_DEBUG=PERL_3LOG=1 $(MAKE) _test
1371
937aca76 1372utest.third ucheck.third: test_prep.third perl.third
35117553 1373 PERL=./perl.third PERL_DEBUG=PERL_3LOG=1 TEST_ARGS=-utf8 $(MAKE) _test
ec861bc1 1374
937aca76 1375test_notty.third: test_prep.third perl.third
5fe84fd2 1376 PERL=./perl.third $(MAKE) PERL_DEBUG=PERL_3LOG=1 _test_notty
2304df62 1377
35117553 1378# Targets for Deparse testing.
1379
1380test.deparse: test_prep
1381 PERL=./perl TEST_ARGS=-deparse $(MAKE) _test
1382
1383test_notty.deparse: test_prep
1384 PERL=./perl TEST_ARGS=-deparse $(MAKE) _test_notty
1385
b26492ee 1386# Targets to run the test suite with -t
1387
1388test.taintwarn: test_prep
1389 PERL=./perl TEST_ARGS=-taintwarn $(MAKE) _test
1390
1de9afcd 1391minitest.prep:
4fa3f26e 1392 -@test -f lib/lib.pm && test -f lib/Config.pm || \
5ad7e614 1393 $(MAKE) lib/Config.pm lib/lib.pm $(unidatafiles)
4fa3f26e 1394 @echo " "
d96ebe2e 1395 @echo "You may see some irrelevant test failures if you have been unable"
5ad7e614 1396 @echo "to build lib/Config.pm, lib/lib.pm or the Unicode data files."
4fa3f26e 1397 @echo " "
1de9afcd 1398
1399# Can't depend on lib/Config.pm because that might be where miniperl
1400# is crashing.
1401minitest: miniperl$(EXE_EXT) lib/re.pm minitest.prep
cd4d8a96 1402 - cd t && (rm -f perl$(EXE_EXT); $(LNS) ../miniperl$(EXE_EXT) perl$(EXE_EXT)) \
8cebccf4 1403 && $(LDLIBPTH) $(RUN) ./perl TEST -minitest base/*.t comp/*.t cmd/*.t run/*.t io/*.t op/*.t uni/*.t mro/*.t </dev/tty
16d20bd9 1404
1167a30e 1405# Test via harness
1406
1407test_harness: test_prep
1408 PERL=./perl $(MAKE) TESTFILE=harness _test
1409
69bfbd2f 1410test_harness_notty: test_prep
1411 PERL=./perl HARNESS_NOTTY=1 $(MAKE) TESTFILE=harness _test
1412
4979e288 1413test-reonly: test_prep
1414 PERL=./perl TEST_ARGS='-re \\bpat\\b \\breg \\bre\b \\bsubst \\brxcode' $(MAKE) TESTFILE=harness _test
1415
fb73857a 1416# Handy way to run perlbug -ok without having to install and run the
84902520 1417# installed perlbug. We don't re-run the tests here - we trust the user.
fb73857a 1418# Please *don't* use this unless all tests pass.
1d2dff63 1419# If you want to report test failures, use "make nok" instead.
869a466c 1420
1421.PHONY: ok okfile oknack okfilenack nok nokfile noknack nokfilenack
1422
188cd53f 1423ok: utilities
6d4b7d88 1424 $(LDLIBPTH) $(RUN) ./perl -Ilib utils/perlbug -ok -s '(UNINSTALLED)'
84902520 1425
105f9295 1426okfile: utilities
6d4b7d88 1427 $(LDLIBPTH) $(RUN) ./perl -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -F perl.ok
105f9295 1428
890b8eb0 1429oknack: utilities
6d4b7d88 1430 $(LDLIBPTH) $(RUN) ./perl -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -A
890b8eb0 1431
1432okfilenack: utilities
6d4b7d88 1433 $(LDLIBPTH) $(RUN) ./perl -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -F perl.ok -A
890b8eb0 1434
1d2dff63 1435nok: utilities
6d4b7d88 1436 $(LDLIBPTH) $(RUN) ./perl -Ilib utils/perlbug -nok -s '(UNINSTALLED)'
1d2dff63 1437
b4e8cfaf 1438nokfile: utilities
6d4b7d88 1439 $(LDLIBPTH) $(RUN) ./perl -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok
b4e8cfaf 1440
890b8eb0 1441noknack: utilities
6d4b7d88 1442 $(LDLIBPTH) $(RUN) ./perl -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -A
890b8eb0 1443
1444nokfilenack: utilities
6d4b7d88 1445 $(LDLIBPTH) $(RUN) ./perl -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok -A
890b8eb0 1446
869a466c 1447.PHONY: clist hlist shlist pllist
1448
85e6fe83 1449clist: $(c)
92c28edd 1450 echo $(c) | tr ' ' $(TRNL) >.clist
2304df62 1451
85e6fe83 1452hlist: $(h)
92c28edd 1453 echo $(h) | tr ' ' $(TRNL) >.hlist
2304df62 1454
85e6fe83 1455shlist: $(sh)
92c28edd 1456 echo $(sh) | tr ' ' $(TRNL) >.shlist
2304df62 1457
4633a7c4 1458pllist: $(pl)
92c28edd 1459 echo $(pl) | tr ' ' $(TRNL) >.pllist
4633a7c4 1460
92c28edd 1461Makefile: Makefile.SH ./config.sh
1462 $(SHELL) Makefile.SH
760ac839 1463
869a466c 1464.PHONY: distcheck
599a829f 1465distcheck: FORCE
760ac839 1466 perl '-MExtUtils::Manifest=&fullcheck' -e 'fullcheck()'
1467
869a466c 1468.PHONY: elc
771c4874 1469elc: emacs/cperl-mode.elc
1470
1471emacs/cperl-mode.elc: emacs/cperl-mode.el
1472 -cd emacs; emacs -batch -q -no-site-file -f batch-byte-compile cperl-mode.el
1473
869a466c 1474.PHONY: etags ctags tags
1475
d6a255e6 1476etags: TAGS
1477
1478TAGS: emacs/cperl-mode.elc
3ee700d1 1479 sh emacs/ptags
01e22528 1480
d6a255e6 1481# Let's hope make will not go into an infinite loop on case-unsensitive systems
1482# This may also fail if . is in the head of the path, since perl will
1483# require -Ilib
1484tags: TAGS
1485 perl emacs/e2ctags.pl TAGS > tags
3ee700d1 1486
5c36f626 1487ctags:
abcf5ada 1488 ctags -f Tags -N --totals --languages=c --langmap=c:+.h --exclude=opmini.c *.c *.h
5c36f626 1489
2304df62 1490# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
1491# If this runs make out of memory, delete /usr/include lines.
1492!NO!SUBS!
1493
85e6fe83 1494$eunicefix Makefile
2304df62 1495case `pwd` in
1496*SH)
85e6fe83 1497 $rm -f ../Makefile
cd4d8a96 1498 $ln Makefile ../Makefile
2304df62 1499 ;;
1500esac
cd4d8a96 1501$rm -f $firstmakefile
5ff3f7a4 1502
1503# Now do any special processing required before building.
1504
1505case "$ebcdic" in
2d340b60 1506define)
5ff3f7a4 1507 xxx=''
2d340b60 1508 echo "This is an EBCDIC system, checking if any parser files need regenerating." >&2
7a66b286 1509case "$osname" in
25e9a2e3 1510os390|posix-bc)
e9d08790 1511 if cd x2p
5ff3f7a4 1512 then
e9d08790 1513 rm -f y.tab.c y.tab.h
5928ee40 1514 case "$osname" in
1515 posix-bc)
1516 # we are using two different yaccs in BS2000 Posix!
1517 byacc a2p.y >/dev/null 2>&1
1518 ;;
1519 *) # e.g. os390
1520 yacc a2p.y >/dev/null 2>&1
1521 ;;
1522 esac
e9d08790 1523 if cmp -s y.tab.c a2p.c
1524 then
1525 rm -f y.tab.c
1526 else
1527 echo "a2p.y -> a2p.c" >&2
1528 mv -f y.tab.c a2p.c
1529 chmod u+w a2p.c
1530 sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
f1f802f7 1531 -e 's|^static void __YY_YACC_MAIN.*BS2000.*|/*static main deleted*/|' \
e9d08790 1532 -e 's/y\.tab/a2p/g' a2p.c >a2p.tmp && mv a2p.tmp a2p.c
1533 xxx="$xxx a2p.c"
1534 fi
1535 # In case somebody yacc -d:ed the a2p.y.
1536 if test -f y.tab.h
1537 then
1538 if cmp -s y.tab.h a2p.h
1539 then
1540 rm -f y.tab.h
1541 else
1542 echo "a2p.h -> a2p.h" >&2
1543 mv -f y.tab.h a2p.h
1544 xxx="$xxx a2p.h"
1545 fi
1546 fi
1547 cd ..
5ff3f7a4 1548 fi
7a66b286 1549 ;;
1550vmesa)
1551 # Do nothing in VM/ESA.
1552 ;;
aa34f189 1553*)
e9d08790 1554 echo "'$osname' is an EBCDIC system I don't know that well." >&4
aa34f189 1555 ;;
fe572743 1556esac
5ff3f7a4 1557 case "$xxx" in
1558 '') echo "No parser files were regenerated. That's okay." >&2 ;;
1559 esac
1560 ;;
1561esac
1562
075abff3 1563# ex: set ts=8 sts=4 sw=4 noet: