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