This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perlre: Add some clarifying script run documentation
[perl5.git] / Makefile.SH
CommitLineData
1f00b0d6
S
1#!/bin/sh
2
937aac54 3# quote() - Creates a shell literal
6bc4329f 4# Usage: echo "...` quote "..." `..."
937aac54
EB
5quote() {
6 case "$1" in
7 '') echo "''" ;;
87d98376 8 *) echo "$1" | sed 's/\([^a-zA-Z0-9.:_/-]\)/\\\1/g' ;;
937aac54
EB
9 esac
10}
11
a02608de 12case $PERL_CONFIG_SH in
2304df62 13'')
66b99216
JH
14 if test -f config.sh
15 then TOP=.
2304df62
AD
16 else
17 echo "Can't find config.sh."; exit 1
18 fi
19 . $TOP/config.sh
20 ;;
21esac
761ee4e8 22
1247ba6e
AB
23case "$osname" in
24amigaos)
25 devtty=CONSOLE:
26 ;;
27*)
28 devtty=/dev/tty
29 ;;
30esac
31
3c32af27 32Makefile=Makefile
5a20539c 33
2304df62
AD
34: This forces SH files to create target in same directory as SH file.
35: This is so that make depend always knows where to find SH derivatives.
36case "$0" in
37*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
38esac
39
6bc4329f 40pwd="`pwd`"
d5d19f97 41linklibperl='$(LIBPERL)'
fe5460cc 42linklibperl_nonshr=''
3c321fdc 43shrpldflags='$(LDDLFLAGS)'
6ee623d5 44ldlibpth=''
ac9901e0 45DPERL_EXTERNAL_GLOB='-DPERL_EXTERNAL_GLOB'
bf799c64 46DPERL_IS_MINIPERL='-DPERL_IS_MINIPERL'
d96ebe2e 47case "$useshrplib" in
48true)
f4db5405 49 # Prefix all runs of 'miniperl' and 'perl' with
5cf1d1f1 50 # $ldlibpth so that ./perl finds *this* shared libperl.
c1b49bc0 51 case "$LD_LIBRARY_PATH" in
6bc4329f
EB
52 '') ldlibpth="LD_LIBRARY_PATH=` quote "$pwd" `" ;;
53 *) ldlibpth="LD_LIBRARY_PATH=` quote "$pwd" `:` quote "$LD_LIBRARY_PATH" `" ;;
c1b49bc0 54 esac
6ee623d5 55
d5d19f97 56 pldlflags="$cccdlflags"
07f3cc2a 57 static_ldflags=''
d96ebe2e 58 case "${osname}${osvers}" in
59 next4*)
3c321fdc 60 ld=libtool
61 lddlflags="-dynamic -undefined warning -framework System \
62 -compatibility_version 1 -current_version $patchlevel \
63 -prebind -seg1addr 0x27000000 -install_name \$(shrpdir)/\$@"
6ee623d5 64 ;;
7eb35c03 65 darwin*)
f556e5b9 66 shrpldflags="${ldflags} -dynamiclib \
c1e7a127
W
67 -compatibility_version \
68 ${api_revision}.${api_version}.${api_subversion} \
f556e5b9 69 -current_version \
c1e7a127 70 ${revision}.${patchlevel}.${subversion} \
f556e5b9
JH
71 -install_name \$(shrpdir)/\$@"
72 ;;
5cf1d1f1 73 cygwin*)
5f9145a3
RU
74 shrpldflags="$shrpldflags -Wl,--out-implib=libperl.dll.a -Wl,--image-base,0x52000000"
75 linklibperl="-L. -lperl"
8736538c 76 ;;
73d40b3e 77 sunos*)
d5d19f97
UP
78 linklibperl="-lperl"
79 ;;
a0a23c6b 80 netbsd*|freebsd[234]*|openbsd*|dragonfly*|bitrig*)
099685bc
JH
81 linklibperl="-L. -lperl"
82 ;;
0c52c6a9
TV
83 interix*)
84 linklibperl="-L. -lperl"
85 shrpldflags="$shrpldflags -Wl,--image-base,0x57000000"
86 ;;
3c321fdc 87 aix*)
21efc957
RT
88 case "$cc" in
89 gcc*)
90 shrpldflags="-shared -Wl,-H512 -Wl,-T512 -Wl,-bhalt:4 -Wl,-bM:SRE -Wl,-bE:perl.exp"
91 case "$osvers" in
92 3*) shrpldflags="$shrpldflags -e _nostart"
93 ;;
94 *) shrpldflags="$shrpldflags -Wl,-bnoentry"
95 ;;
96 esac
97 shrpldflags="$shrpldflags $ldflags $perllibs $cryptlib"
98 linklibperl="-L $archlibexp/CORE -L `pwd | sed 's/\/UU$//'` -lperl"
fe5460cc 99 linklibperl_nonshr='-lperl_nonshr'
1553ab04 100 ;;
21efc957
RT
101 *)
102 shrpldflags="-H512 -T512 -bhalt:4 -bM:SRE -bE:perl.exp"
103 case "$osvers" in
104 3*) shrpldflags="$shrpldflags -e _nostart"
105 ;;
106 *) shrpldflags="$shrpldflags -b noentry"
107 ;;
108 esac
109 shrpldflags="$shrpldflags $ldflags $perllibs $cryptlib"
110 linklibperl="-L $archlibexp/CORE -L `pwd | sed 's/\/UU$//'` -lperl"
fe5460cc 111 linklibperl_nonshr='-lperl_nonshr'
1553ab04
TB
112 ;;
113 esac
3c321fdc 114 ;;
1c7d1a19
GS
115 hpux*)
116 linklibperl="-L `pwd | sed 's/\/UU$//'` -Wl,+s -Wl,+b$archlibexp/CORE -lperl"
46193409 117 ;;
ac9901e0 118 os390*)
4144573e 119 shrpldflags='-W l,XPLINK,dll'
ac9901e0
PP
120 linklibperl='libperl.x'
121 DPERL_EXTERNAL_GLOB=''
122 ;;
655635e8 123 esac
5cf1d1f1
JH
124 case "$ldlibpthname" in
125 '') ;;
126 *)
127 case "$osname" in
128 os2)
129 ldlibpth=''
130 ;;
5cf1d1f1 131 *)
937aac54
EB
132 eval "ldlibpthval=\"\$$ldlibpthname\""
133
134 case "$ldlibpthval" in
6bc4329f
EB
135 '') ldlibpth="$ldlibpthname=` quote "$pwd" `" ;;
136 *) ldlibpth="$ldlibpthname=` quote "$pwd" `:` quote "$ldlibpthval" `" ;;
937aac54
EB
137 esac
138
5cf1d1f1
JH
139 ;;
140 esac
937aac54 141
5cf1d1f1
JH
142 ;;
143 esac
ecfc5424 144
9b9c6f34
AE
145 case "$osname" in
146 linux)
830717a7
AD
147 # If there is a pre-existing $libperl from a previous
148 # installation, Linux needs to use LD_PRELOAD to
149 # override the LD_LIBRARY_PATH setting. See the
150 # INSTALL file, under "Building a shared perl library".
151 # If there is no pre-existing $libperl, we don't need
152 # to do anything further.
153 if test -f $archlib/CORE/$libperl; then
68e8d60a 154 rm -f preload
d0ae58a5 155 cat <<'EOT' > preload
fde91635
JH
156#! /bin/sh
157lib=$1
158shift
159test -r $lib && export LD_PRELOAD="$lib $LD_PRELOAD"
160exec "$@"
161EOT
9b9c6f34
AE
162 chmod 755 preload
163 ldlibpth="$ldlibpth `pwd`/preload `pwd`/$libperl"
830717a7
AD
164 fi
165 ;;
9b9c6f34
AE
166 os390) test -f /bin/env && ldlibpth="/bin/env $ldlibpth"
167 ;;
60d79001 168 esac
9b9c6f34 169
60d79001 170 ;;
9b9c6f34
AE
171
172*) pldlflags=''
07f3cc2a 173 static_ldflags='CCCDLFLAGS='
b1f5ad7d
JH
174 ;;
175esac
176
de4c0096
TC
177: is Cwd static or dynamic
178static_cwd='define'
c0e3b4b5
TC
179storable_limit_dep=''
180storable_type=''
04718b47 181list_util_dep='$(PERL_EXE)'
de4c0096
TC
182for f in $dynamic_ext; do
183 case $f in
184 Cwd) static_cwd='undef' ;;
c0e3b4b5
TC
185 List/Util) list_util_dep=lib/auto/List/Util/Util.$dlext ;;
186 Storable) storable_limit_dep=lib/auto/Storable/Storable.$dlext
187 storable_type='dynamic' ;;
de4c0096
TC
188 esac
189done
190
a0d0e21e
LW
191: Prepare dependency lists for Makefile.
192dynamic_list=' '
ec81ed5d 193dynamic_ext_re="lib/auto/re/re.$dlext"
1179df5f 194extra_dep='
635c6126 195ext/Pod-Functions/pm_to_blib: cpan/Pod-Simple/pm_to_blib cpan/Pod-Escapes/pm_to_blib pod/perlfunc.pod
dd3e0aed 196cpan/IO-Compress/pm_to_blib: dist/lib/pm_to_blib
1179df5f 197'
a0d0e21e
LW
198for f in $dynamic_ext; do
199 : the dependency named here will never exist
ecfc5424 200 base=`echo "$f" | sed 's/.*\///'`
dd3e0aed 201 this_target="lib/auto/$f/$base.$dlext"
9f3ef600
NC
202 dynamic_list="$dynamic_list $this_target"
203
204 : Parallel makes reveal that we have some interdependencies
205 case $f in
90e91dd8 206 Math/BigInt/FastCalc|Devel/NYTProf) extra_dep="$extra_dep
04718b47 207$this_target: $list_util_dep" ;;
9f3ef600
NC
208 Unicode/Normalize) extra_dep="$extra_dep
209$this_target: uni.data" ;;
210 esac
a0d0e21e
LW
211done
212
213static_list=' '
a0d0e21e
LW
214for f in $static_ext; do
215 base=`echo "$f" | sed 's/.*\///'`
cd4d8a96 216 static_list="$static_list lib/auto/$f/$base\$(LIB_EXT)"
54f7170d
AD
217 : Parallel makes reveal that we have some interdependencies
218 this_target="lib/auto/$f/$base\$(LIB_EXT)"
219 case $f in
220 Math/BigInt/FastCalc|Devel/NYTProf) extra_dep="$extra_dep
221$this_target: lib/auto/List/Util/Util\$(LIB_EXT)" ;;
222 Unicode/Normalize) extra_dep="$extra_dep
223$this_target: uni.data" ;;
c0e3b4b5 224 Storable) storable_type='static' ;;
54f7170d 225 esac
a0d0e21e
LW
226done
227
4318d5a0
GB
228nonxs_list=' '
229for f in $nonxs_ext; do
6c0ec79a 230 p=`echo "$f" | tr / -`
a193a2db 231 for d in ext dist cpan; do
321c3589
NC
232 if test -d $d/$p; then
233 nonxs_list="$nonxs_list $d/$p/pm_to_blib"
234 fi
235 done
4318d5a0
GB
236done
237
5ac1e9b2 238dtrace_h=''
efc4bddf
DM
239
240# three object files generated by 'dtrace -G' when dtrace is enabled
241dtrace_perllib_o=''
242dtrace_mini_o=''
243dtrace_main_o=''
244
5ac1e9b2
AA
245case "$usedtrace" in
246define|true)
c2538af7
TC
247 dtrace_h='perldtrace.h'
248 case "$dtraceobject" in
249 define)
efc4bddf
DM
250 dtrace_perllib_o='dtrace_perllib$(OBJ_EXT)'
251 dtrace_mini_o='dtrace_mini$(OBJ_EXT)'
252 dtrace_main_o='dtrace_main$(OBJ_EXT)'
c2538af7
TC
253 ;;
254 esac
5ac1e9b2
AA
255 ;;
256esac
257
5a20539c
VK
258echo "Extracting $Makefile (with variable substitutions)"
259$spitshell >$Makefile <<!GROK!THIS!
260# $Makefile
85e6fe83
LW
261# This file is derived from Makefile.SH. Any changes made here will
262# be lost the next time you run Configure.
655635e8 263# Makefile is used to generate $firstmakefile. The only difference
264# is that $firstmakefile has the dependencies filled in at the end.
0de566d7 265
2304df62 266CC = $cc
232e078e 267LD = $ld
16d20bd9 268
2304df62
AD
269LDFLAGS = $ldflags
270CLDFLAGS = $ldflags
85e6fe83 271
2304df62
AD
272mallocsrc = $mallocsrc
273mallocobj = $mallocobj
85e6fe83 274LNS = $lns
4c901d04
JH
275# NOTE: some systems don't grok "cp -f". XXX Configure test needed?
276CPS = $cp
2304df62 277RMS = rm -f
85e6fe83
LW
278ranlib = $ranlib
279
16d20bd9
AD
280# The following are mentioned only to make metaconfig include the
281# appropriate questions in Configure. If you want to change these,
8e07c86e 282# edit config.sh instead, or specify --man1dir=/wherever on
16d20bd9
AD
283# installman commandline.
284bin = $installbin
285scriptdir = $scriptdir
d96ebe2e 286shrpdir = $archlibexp/CORE
16d20bd9
AD
287privlib = $installprivlib
288man1dir = $man1dir
289man1ext = $man1ext
290man3dir = $man3dir
291man3ext = $man3ext
292
85e6fe83
LW
293# The following are used to build and install shared libraries for
294# dynamic loading.
295LDDLFLAGS = $lddlflags
3c321fdc 296SHRPLDFLAGS = $shrpldflags
85e6fe83 297CCDLFLAGS = $ccdlflags
a0d0e21e 298DLSUFFIX = .$dlext
ecfc5424 299PLDLFLAGS = $pldlflags
d96ebe2e 300LIBPERL = $libperl
d5d19f97 301LLIBPERL= $linklibperl
fe5460cc 302LLIBPERL_NONSHR= $linklibperl_nonshr
ecfc5424 303SHRPENV = $shrpenv
a0d0e21e 304
94c41b70
AD
305# Static targets are ordinarily built without CCCDLFLAGS. However,
306# if building a shared libperl.so that might later be linked into
307# another application, then it might be appropriate to also build static
308# extensions (usually just DynaLoader) with relocatable code (e.g. -fPIC
07f3cc2a
NC
309# for GNU cc).
310STATIC_LDFLAGS = $static_ldflags
94c41b70 311
6ee623d5 312# The following is used to include the current directory in
5cf1d1f1 313# the dynamic loader path you are building a shared libperl.
6ee623d5
GS
314LDLIBPTH = $ldlibpth
315
cef6ea9d 316# Sometimes running an executable is an adventure.
6aafa456 317RUN =
cef6ea9d 318
b98f6b80
JR
319# When cross-compiling we want to use a (mini)perl built for the host, not the target
320HOST_PERL = $hostperl
321HOST_GENERATE = $hostgenerate
9094a4e8 322SYSTEM_PERL = $perl
b98f6b80 323
5a20539c
VK
324# These variables may need to be manually set for non-Unix systems.
325AR = $full_ar
cf9c4992 326HOST_EXE_EXT = $_exe
5a20539c
VK
327EXE_EXT = $_exe
328LIB_EXT = $_a
329OBJ_EXT = $_o
330PATH_SEP = $p_
331
199863e7
NC
332# Macros to invoke a copy of miniperl during the build. Targets which
333# are built using these macros should depend on \$(MINIPERL_EXE)
334MINIPERL_EXE = miniperl\$(EXE_EXT)
6aafa456 335MINIPERL = \$(LDLIBPTH) ./miniperl\$(EXE_EXT) -Ilib
199863e7 336
19bf1007
YO
337# Macros to invoke sort the MANIFEST during build
338MANIFEST_SRT = MANIFEST.srt
339
9094a4e8
JR
340!GROK!THIS!
341
342case "$usecrosscompile$perl" in
343define?*)
344 $spitshell >>$Makefile <<!GROK!THIS!
34b80e25
JV
345# Macros to invoke a copy of our fully operational perl during the build.
346PERL_EXE = perl\$(EXE_EXT)
9094a4e8
JR
347RUN_PERL = \$(LDLIBPTH) \$(RUN) $perl\$(EXE_EXT)
348!GROK!THIS!
349 ;;
350*)
351 $spitshell >>$Makefile <<!GROK!THIS!
352# Macros to invoke a copy of our fully operational perl during the build.
353PERL_EXE = perl\$(EXE_EXT)
3d7c117d 354RUN_PERL = \$(LDLIBPTH) \$(RUN) ./perl\$(EXE_EXT) -Ilib -I.
9094a4e8
JR
355!GROK!THIS!
356 ;;
357esac
34b80e25 358
9094a4e8 359$spitshell >>$Makefile <<!GROK!THIS!
5fb77da4
JV
360# Macros to run our tests
361RUN_TESTS = \$(LDLIBPTH) ./runtests
34b80e25 362
a0d0e21e 363dynamic_ext = $dynamic_list
ec81ed5d 364dynamic_ext_re = $dynamic_ext_re
a0d0e21e 365static_ext = $static_list
4318d5a0
GB
366nonxs_ext = $nonxs_list
367ext = \$(dynamic_ext) \$(static_ext) \$(nonxs_ext)
908fcb8b 368DYNALOADER = DynaLoader\$(OBJ_EXT)
2304df62 369
9c839522 370libs = $perllibs $cryptlib
2304df62 371
c35c732c 372public = \$(PERL_EXE) utilities
2304df62
AD
373
374shellflags = $shellflags
375
1247ba6e
AB
376# The /dev/tty or the moral equivalent.
377devtty = $devtty
378
d96ebe2e 379# This is set to MAKE=$make if your $make command doesn't
380# do it for you.
381$make_set_make
4633a7c4 382
1fef16b3
JH
383# Mention $gmake here so it gets probed for by Configure.
384
cfe76a0a
JC
385!GROK!THIS!
386
387case "${osname}" in
09617314 388linux*|darwin)
cfe76a0a 389$spitshell >>$Makefile <<!GROK!THIS!
4f9287d3
NC
390# If you're going to use valgrind and it can't be invoked as plain valgrind
391# then you'll need to change this, or override it on the make command line.
c7b956bb
JC
392VALGRIND ?= valgrind
393VG_TEST ?= ./perl -e 1 2>/dev/null
4f9287d3 394
cfe76a0a
JC
395!GROK!THIS!
396 ;;
397esac
398
f2a60c1f
TC
399case "$dtracexnolibs" in
400define) xnolibs=-xnolibs ;;
401*) xnolibs= ;;
402esac
403
cfe76a0a 404$spitshell >>$Makefile <<!GROK!THIS!
f2a60c1f 405DTRACE = $dtrace $xnolibs
5ac1e9b2 406DTRACE_H = $dtrace_h
efc4bddf
DM
407
408DTRACE_PERLLIB_O = $dtrace_perllib_o # "dtrace -G" output for perllib_objs
409DTRACE_MINI_O = $dtrace_mini_o # "dtrace -G" output for common and mini
410DTRACE_MAIN_O = $dtrace_main_o # "dtrace -G" output for perlmain.o
5ac1e9b2 411
4633a7c4
LW
412FIRSTMAKEFILE = $firstmakefile
413
414# Any special object files needed by this architecture, e.g. os2/os2.obj
415ARCHOBJS = $archobjs
416
89ada9f2 417.SUFFIXES: .c \$(OBJ_EXT) .i .s
cd4d8a96 418
d96ebe2e 419# grrr
420SHELL = $sh
655635e8 421
28e8609d
JH
422# how to tr(anslate) newlines
423TRNL = '$trnl'
424
82240bfc
JH
425OPTIMIZE = $optimize
426
3343e82c
JH
427EXTRAS = $extras
428
bf35c3f6
JH
429INSTALLPREFIXEXP = $prefix
430
d56c5707 431!GROK!THIS!
b7b35fc2 432# not used by Makefile but by installperl;
d56c5707
JH
433# mentioned here so that metaconfig picks these up
434# $installusrbinperl
435# $versiononly
b7b35fc2 436
8170cb12
JH
437case "${osname}:${osvers}" in
438darwin:*)
5a20539c 439$spitshell >>$Makefile <<EOF
8170cb12
JH
440
441# Your locales are broken (osname $osname, osvers $osvers)
442# and to avoid the numerous
443# perl: warning: Setting locale failed.
444# warnings during the build process we reset the locale variables.
445
446LC_ALL=C
447LANG=C
448LANGUAGE=C
449EOF
450 ;;
451esac
2304df62 452
85e6fe83 453## In the following dollars and backticks do not need the extra backslash.
5a20539c 454$spitshell >>$Makefile <<'!NO!SUBS!'
2304df62 455
ba0f5503 456CCCMD = sh $(shellflags) cflags "optimize='$(OPTIMIZE)'" $@
89ada9f2 457
ba0f5503 458CCCMDSRC = sh $(shellflags) cflags "optimize='$(OPTIMIZE)'" $<
2304df62 459
744ac0ea
NC
460CONFIGPM_FROM_CONFIG_SH = lib/Config.pm lib/Config_heavy.pl
461CONFIGPM = $(CONFIGPM_FROM_CONFIG_SH) lib/Config_git.pl
5a20539c
VK
462
463CONFIGPOD = lib/Config.pod
464
465CONFIGH = config.h
466!NO!SUBS!
5a20539c 467
9719c95b
NC
468SH_to_target() {
469 echo $@ | sed -e s/\\\.SH//g -e s/_/./g
470}
0ff64a71 471
e5a8a0fb 472SH='Makefile.SH cflags.SH config_h.SH makedepend.SH myconfig.SH runtests.SH pod/Makefile.SH'
9719c95b 473shextract=`SH_to_target $SH`
0ff64a71 474
5a20539c 475## In the following dollars and backticks do not need the extra backslash.
0ff64a71 476$spitshell >>$Makefile <<!GROK!THIS!
5a20539c 477
7b4d95f7 478private = preplibrary \$(CONFIGPM) \$(CONFIGPOD) git_version.h lib/buildcustomize.pl
2304df62 479
4633a7c4
LW
480# Files to be built with variable substitution before miniperl
481# is available.
0ff64a71 482sh = $SH
4633a7c4 483
0ff64a71
NC
484shextract = $shextract
485!GROK!THIS!
486
487## In the following dollars and backticks do not need the extra backslash.
488$spitshell >>$Makefile <<'!NO!SUBS!'
4633a7c4 489
2560602c 490addedbyconf = UU $(shextract)
2304df62 491
5ad7e614 492# Unicode data files generated by mktables
3df51b85
KW
493unidatafiles = lib/unicore/Decomposition.pl lib/unicore/TestProp.pl \
494 lib/unicore/CombiningClass.pl lib/unicore/Name.pl \
1a234f2b 495 lib/unicore/UCD.pl lib/unicore/Name.pm \
3e344d15 496 lib/unicore/Heavy.pl lib/unicore/mktables.lst
5ad7e614
NC
497
498# Directories of Unicode data files generated by mktables
499unidatadirs = lib/unicore/To lib/unicore/lib
500
5a20539c 501h1 = EXTERN.h INTERN.h XSUB.h av.h $(CONFIGH) cop.h cv.h dosish.h
4d3a042d 502h2 = embed.h form.h gv.h handy.h hv.h hv_func.h keywords.h mg.h op.h opcode.h
dd2155a4 503h3 = pad.h patchlevel.h perl.h perlapi.h perly.h pp.h proto.h regcomp.h
219f41b1 504h4 = regexp.h scope.h sv.h unixish.h util.h iperlsys.h thread.h
7bbf947b 505h5 = utf8.h warnings.h mydtrace.h op_reg_common.h l1_char_class_tab.h
9d9177be
KW
506h6 = charclass_invlists.h
507h = $(h1) $(h2) $(h3) $(h4) $(h5) $(h6)
2304df62 508
8b371338 509c1 = av.c scope.c op.c doop.c doio.c dump.c gv.c hv.c mg.c reentr.c mro_core.c perl.c
00e74f14 510c2 = perly.c pp.c pp_hot.c pp_ctl.c pp_sys.c regcomp.c regexec.c utf8.c sv.c
26ea9e12 511c3 = taint.c toke.c util.c deb.c run.c universal.c pad.c globals.c keywords.c
f832b29a 512c4 = perlio.c perlapi.c numeric.c mathoms.c locale.c pp_pack.c pp_sort.c caretx.c dquote.c time64.c
b5bbe64a 513c5 = $(mallocsrc)
2304df62 514
a812f6a9 515c = $(c1) $(c2) $(c3) $(c4) $(c5) miniperlmain.c opmini.c perlmini.c
2304df62 516
8b371338 517obj1 = $(mallocobj) gv$(OBJ_EXT) toke$(OBJ_EXT) perly$(OBJ_EXT) pad$(OBJ_EXT) regcomp$(OBJ_EXT) dump$(OBJ_EXT) util$(OBJ_EXT) mg$(OBJ_EXT) reentr$(OBJ_EXT) mro_core$(OBJ_EXT) keywords$(OBJ_EXT)
bf799c64 518obj2 = hv$(OBJ_EXT) av$(OBJ_EXT) run$(OBJ_EXT) pp_hot$(OBJ_EXT) sv$(OBJ_EXT) pp$(OBJ_EXT) scope$(OBJ_EXT) pp_ctl$(OBJ_EXT) pp_sys$(OBJ_EXT)
f832b29a 519obj3 = doop$(OBJ_EXT) doio$(OBJ_EXT) regexec$(OBJ_EXT) utf8$(OBJ_EXT) taint$(OBJ_EXT) deb$(OBJ_EXT) universal$(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) caretx$(OBJ_EXT) dquote$(OBJ_EXT) time64$(OBJ_EXT)
655635e8 520
98d35ab7
DM
521# split the objects into 3 exclusive sets: those used by both miniperl and
522# perl, and those used by just one or the other. Doesn't include the
523# actual perl(mini)main.o, nor any dtrace objects.
524
525common_objs = $(obj1) $(obj2) $(obj3) $(ARCHOBJS)
526mini_only_objs = opmini$(OBJ_EXT) perlmini$(OBJ_EXT)
527main_only_objs = op$(OBJ_EXT) perl$(OBJ_EXT)
528
529miniperl_objs_nodt = $(mini_only_objs) $(common_objs) miniperlmain$(OBJ_EXT)
efc4bddf 530perllib_objs_nodt = $(main_only_objs) $(common_objs)
98d35ab7 531
728ecd1a
TC
532!NO!SUBS!
533
534# dtrace with -G modifies the source object files, which can cause
535# dependency issues, and can cause the dtrace -G to fail on FreeBSD
536# so separate the objects generated by $(CC) from those used to link
537# the executable when dtrace -G is involved.
538#
539# $(FOO:op%os=np%ns) isn't generally portable but is portable to
540# the makes on darwin, Solaris, FreeBSD and Linux, which is where we
541# use dtrace
542
543case "$usedtrace:$dtraceobject" in
544define:define)
545 $spitshell >>$Makefile <<'!NO!SUBS!'
546
547miniperl_dtrace_objs = $(miniperl_objs_nodt:%=mpdtrace/%)
548perllib_dtrace_objs = $(perllib_objs_nodt:%=libpdtrace/%)
549perlmain_dtrace_objs = maindtrace/perlmain$(OBJ_EXT)
550
551miniperl_objs = $(miniperl_dtrace_objs) $(DTRACE_MINI_O)
552perllib_objs = $(perllib_dtrace_objs) $(DTRACE_PERLLIB_O)
553perlmain_objs = $(perlmain_dtrace_objs) $(DTRACE_MAIN_O)
554
555miniperl_dep = $(DTRACE_MINI_O)
556perllib_dep = $(DTRACE_PERLLIB_O)
557perlmain_dep = $(DTRACE_MAIN_O)
558
559!NO!SUBS!
560 ;;
561*)
562 $spitshell >>$Makefile <<'!NO!SUBS!'
563
efc4bddf
DM
564miniperl_objs = $(miniperl_objs_nodt) $(DTRACE_MINI_O)
565perllib_objs = $(perllib_objs_nodt) $(DTRACE_PERLLIB_O)
566perlmain_objs = perlmain$(OBJ_EXT) $(DTRACE_MAIN_O)
2304df62 567
728ecd1a
TC
568miniperl_dep = $(miniperl_objs)
569perllib_dep = $(perllib_objs)
570perlmain_dep = $(perlmain_objs)
571
572!NO!SUBS!
573 ;;
574esac
575
576$spitshell >>$Makefile <<'!NO!SUBS!'
577
373fec1e 578perltoc_pod_prereqs = extra.pods pod/perl5292delta.pod pod/perlapi.pod pod/perlintern.pod pod/perlmodlib.pod pod/perluniprops.pod
7eb47696 579generated_pods = pod/perltoc.pod $(perltoc_pod_prereqs)
9387abf8 580generated_headers = uudmap.h bitcount.h mg_data.h
344af494 581
075abff3 582lintflags = \
5f66b61c
AL
583 -b \
584 -n \
075abff3 585 -p \
075abff3
AL
586 -Ncheck=%all \
587 -Nlevel=4 \
bb263b4e
AL
588 -errchk=parentheses \
589 -errhdr=%all \
66a1b24b 590 -errfmt=src \
075abff3 591 -errtags \
5f66b61c 592 -erroff=E_ASSIGN_NARROW_CONV \
075abff3 593 -erroff=E_BAD_PTR_CAST \
5f66b61c
AL
594 -erroff=E_BAD_PTR_CAST_ALIGN \
595 -erroff=E_BAD_PTR_INT_COMBINATION \
596 -erroff=E_BAD_SIGN_EXTEND \
075abff3 597 -erroff=E_BLOCK_DECL_UNUSED \
5f66b61c 598 -erroff=E_CASE_FALLTHRU \
abcf5ada 599 -erroff=E_CONST_EXPR \
075abff3 600 -erroff=E_CONSTANT_CONDITION \
abcf5ada 601 -erroff=E_END_OF_LOOP_CODE_NOT_REACHED \
5f66b61c 602 -erroff=E_EQUALITY_NOT_ASSIGNMENT \
075abff3 603 -erroff=E_EXPR_NULL_EFFECT \
66a1b24b 604 -erroff=E_FALSE_LOGICAL_EXPR \
66a1b24b 605 -erroff=E_INCL_NUSD \
5f66b61c 606 -erroff=E_LOOP_EMPTY \
66a1b24b 607 -erroff=E_MAIN_PARAM \
5f66b61c
AL
608 -erroff=E_POINTER_TO_OBJECT \
609 -erroff=E_PTRDIFF_OVERFLOW \
610 -erroff=E_SHIFT_CNT_NEG_TOO_BIG_L \
611 -erroff=E_STATIC_UNUSED \
05c462c4 612 -erroff=E_TRUE_LOGICAL_EXPR
2304df62 613
e21c97b9 614.c$(OBJ_EXT):
ba0f5503
DM
615 @echo `$(CCCMD)` $(PLDLFLAGS) $*.c
616 @`$(CCCMD)` $(PLDLFLAGS) $*.c
2304df62 617
29b9baac 618.c.i: perl.h config.h
ba0f5503
DM
619 @echo `$(CCCMDSRC)` -E $*.c \> $*.i
620 @`$(CCCMDSRC)` -E $*.c > $*.i
89ada9f2 621
29b9baac 622.c.s: perl.h config.h
ba0f5503
DM
623 @echo `$(CCCMDSRC)` -S $*.c
624 @`$(CCCMDSRC)` -S $*.c
89ada9f2 625
c0e3b4b5 626all: $(FIRSTMAKEFILE) $(MINIPERL_EXE) $(generated_pods) $(private) $(unidatafiles) $(public) $(dynamic_ext) $(nonxs_ext) extras.make $(MANIFEST_SRT) common_build
51356d76
NC
627 @echo " ";
628 @echo " Everything is up to date. Type '$(MAKE) test' to run test suite."
629
0e9f069a
MA
630$(MANIFEST_SRT): MANIFEST $(PERL_EXE)
631 @$(RUN_PERL) Porting/manisort -q || (echo "WARNING: re-sorting MANIFEST"; \
632 $(RUN_PERL) Porting/manisort -q -o MANIFEST; sh -c true)
19bf1007
YO
633 @touch $(MANIFEST_SRT)
634
c35c732c 635.PHONY: all utilities
8565263a 636
2b63e250
AD
637# Both git_version.h and lib/Config_git.pl are built
638# by make_patchnum.pl.
639git_version.h: lib/Config_git.pl
640
641lib/Config_git.pl: $(MINIPERL_EXE) make_patchnum.pl
199863e7 642 $(MINIPERL) make_patchnum.pl
dcff826f
YO
643
644# make sure that we recompile perl.c if the git version changes
645perl$(OBJ_EXT): git_version.h
6ee623d5 646
d1309555
NC
647!NO!SUBS!
648
c35c732c 649# Making utilities requires Cwd. If we have dynamic
939767c9
AD
650# loading, we only need miniperl and Cwd.$dlext. If we have static
651# loading, we need to build perl first.
de4c0096
TC
652case "$usedl$static_cwd" in
653defineundef)
939767c9 654 util_deps='$(MINIPERL_EXE) $(CONFIGPM) lib/auto/Cwd/Cwd$(DLSUFFIX) FORCE'
939767c9 655 ;;
de4c0096
TC
656definedefine)
657 util_deps='$(PERL_EXE) $(CONFIGPM) FORCE'
de4c0096 658 ;;
939767c9 659*) util_deps='$(PERL_EXE) $(CONFIGPM) FORCE'
939767c9
AD
660 ;;
661esac
662
d1309555 663$spitshell >>$Makefile <<!GROK!THIS!
145bbcac 664utils/Makefile: \$(MINIPERL_EXE) \$(CONFIGPM) utils/Makefile.PL
69b63ee4 665 \$(MINIPERL) utils/Makefile.PL
145bbcac
NC
666
667utilities: utils/Makefile $util_deps
d1309555 668 @echo " "; echo " Making utilities"; cd utils; \$(LDLIBPTH) \$(MAKE) all
909b3858 669
d1309555 670!GROK!THIS!
939767c9 671
d1309555 672$spitshell >>$Makefile <<'!NO!SUBS!'
909b3858 673
16d20bd9
AD
674# This is now done by installman only if you actually want the man pages.
675# @echo " "; echo " Making docs"; cd pod; $(MAKE) all;
85e6fe83
LW
676
677# Phony target to force checking subdirectories.
e50aee73 678# Apparently some makes require an action for the FORCE target.
869a466c 679.PHONY: FORCE
85e6fe83 680FORCE:
4633a7c4 681 @sh -c true
aa9e9805 682!NO!SUBS!
4ba7095c 683
aa9e9805 684for file in op perl; do
6cdadb5a
NC
685 if $issymlink $file.c; then
686 $spitshell >>$Makefile <<!GROK!THIS!
687
688# We do a copy of the $file.c instead of a symlink because gcc gets huffy
689# if we have a symlink forest to another disk (it complains about too many
690# levels of symbolic links, even if we have only two)
c015c5e4 691
aa9e9805
NC
692${file}mini.c: $file.c
693 \$(RMS) ${file}mini.c
694 \$(CPS) ${file}.c ${file}mini.c
6cdadb5a
NC
695!GROK!THIS!
696 else
697 $spitshell >>$Makefile <<!GROK!THIS!
698
699${file}mini.c: $file.c
700 \$(RMS) ${file}mini.c
701 \$(LNS) ${file}.c ${file}mini.c
702!GROK!THIS!
703 fi
704
705 $spitshell >>$Makefile <<!GROK!THIS!
bd0dd1d8 706
aa9e9805 707${file}mini\$(OBJ_EXT): ${file}mini.c
ba0f5503
DM
708 echo @\`\$(CCCMD)\` \$(PLDLFLAGS) $DPERL_IS_MINIPERL $DPERL_EXTERNAL_GLOB ${file}mini.c
709 @\`\$(CCCMD)\` \$(PLDLFLAGS) $DPERL_IS_MINIPERL $DPERL_EXTERNAL_GLOB ${file}mini.c
aa9e9805
NC
710!GROK!THIS!
711done
bf799c64 712
aa9e9805 713$spitshell >>$Makefile <<'!NO!SUBS!'
bf799c64 714
9387abf8 715globals$(OBJ_EXT): $(generated_headers)
9444d213 716
6f83ef0e 717uudmap.h mg_data.h: bitcount.h
0f13ebd5 718
6f83ef0e 719generate_uudmap$(OBJ_EXT): mg_raw.h
9444d213 720
b98f6b80
JR
721!NO!SUBS!
722
1ca484ac
BF
723# If hostgerenate isn't defined, then we have to build
724# generate_uudmap and run it. This can potentially mean running
725# it on the target system if we're cross-compiling.
726# If it is defined, then we just run it locally.
727case "$hostgenerate" in
329865d8 728''|'undef')
1ca484ac
BF
729$spitshell >>$Makefile <<!GROK!THIS!
730bitcount.h: generate_uudmap\$(HOST_EXE_EXT)
731 $run ./generate_uudmap\$(HOST_EXE_EXT) \$(generated_headers)
732 -@for f in \$(generated_headers); do \\
733 $from \$\$f; \\
734 done
735
736!GROK!THIS!
737
738$spitshell >>$Makefile <<'!NO!SUBS!'
b98f6b80 739generate_uudmap$(HOST_EXE_EXT): generate_uudmap$(OBJ_EXT)
1ca484ac 740 $(CC) -o generate_uudmap$(EXE_EXT) $(LDFLAGS) generate_uudmap$(OBJ_EXT) $(libs)
b98f6b80
JR
741
742!NO!SUBS!
1ca484ac
BF
743;;
744*)
745$spitshell >>$Makefile <<'!NO!SUBS!'
746bitcount.h: generate_uudmap$(HOST_EXE_EXT)
747 ./generate_uudmap$(HOST_EXE_EXT) $(generated_headers)
748
aa9e9805 749generate_uudmap$(HOST_EXE_EXT): generate_uudmap$(OBJ_EXT)
1ca484ac
BF
750 -@rm generate_uudmap$(HOST_EXE_EXT)
751 $(LNS) $(HOST_GENERATE) generate_uudmap$(HOST_EXE_EXT)
9444d213 752
b98f6b80 753!NO!SUBS!
1ca484ac
BF
754;;
755esac
756
218f8ee6
AB
757case "$osname" in
758amigaos*)
759$spitshell >>$Makefile <<'!NO!SUBS!'
760perlmain.c: $(MINIPERL_EXE) ext/ExtUtils-Miniperl/pm_to_blib
69b63ee4 761 $(MINIPERL) -MExtUtils::Miniperl -e 'writemain(\\"perlmain.c", @ARGV)' DynaLoader $(static_ext)
218f8ee6
AB
762
763# The file ext.libs is a list of libraries that must be linked in
764# for static extensions, e.g. -lm -lgdbm, etc. The individual
765# static extension Makefile's add to it.
766ext.libs: $(static_ext)
767 -@test -f ext.libs || touch ext.libs
b98f6b80 768
218f8ee6
AB
769!NO!SUBS!
770;;
771*)
b98f6b80 772$spitshell >>$Makefile <<'!NO!SUBS!'
7b4d95f7 773perlmain.c: $(MINIPERL_EXE) ext/ExtUtils-Miniperl/pm_to_blib
69b63ee4 774 $(MINIPERL) -MExtUtils::Miniperl -e 'writemain(\"perlmain.c", @ARGV)' DynaLoader $(static_ext)
85e6fe83 775
a0d0e21e
LW
776# The file ext.libs is a list of libraries that must be linked in
777# for static extensions, e.g. -lm -lgdbm, etc. The individual
778# static extension Makefile's add to it.
fed7345c 779ext.libs: $(static_ext)
a0d0e21e 780 -@test -f ext.libs || touch ext.libs
85e6fe83 781
ecfc5424 782!NO!SUBS!
218f8ee6
AB
783;;
784esac
599a829f 785
d96ebe2e 786# How to build libperl. This is still rather convoluted.
599a829f 787# Load up custom Makefile.SH fragment for shared loading and executables:
8736538c 788case "$osname" in
8736538c
AS
789*)
790 Makefile_s="$osname/Makefile.SHs"
791 ;;
792esac
793
549a6b10
JH
794case "$osname" in
795aix)
5a20539c 796 $spitshell >>$Makefile <<!GROK!THIS!
9c839522 797LIBS = $perllibs
5f9d9a17
ME
798# In AIX we need to change this for building Perl itself from
799# its earlier definition (which is for building external
800# extensions *after* Perl has been built and installed)
801CCDLFLAGS = `echo $ccdlflags|sed -e 's@-bE:.*/perl\.exp@-bE:perl.exp@'`
549a6b10
JH
802
803!GROK!THIS!
804 case "$useshrplib" in
805 define|true|[yY]*)
5a20539c 806 $spitshell >>$Makefile <<'!NO!SUBS!'
549a6b10
JH
807
808LIBPERL_NONSHR = libperl_nonshr$(LIB_EXT)
809MINIPERL_NONSHR = miniperl_nonshr$(EXE_EXT)
810
98d35ab7 811$(LIBPERL_NONSHR): $(perllib_objs)
549a6b10 812 $(RMS) $(LIBPERL_NONSHR)
98d35ab7 813 $(AR) rc $(LIBPERL_NONSHR) $(perllib_objs)
549a6b10 814
bf799c64 815$(MINIPERL_NONSHR): $(LIBPERL_NONSHR) miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perlmini$(OBJ_EXT)
a7089531 816 $(CC) $(LDFLAGS) -o $(MINIPERL_NONSHR) miniperlmain$(OBJ_EXT) \
bf799c64 817 opmini$(OBJ_EXT) perlmini$(OBJ_EXT) $(LIBPERL_NONSHR) $(LIBS)
549a6b10
JH
818
819MINIPERLEXP = $(MINIPERL_NONSHR)
820
821LIBPERLEXPORT = perl.exp
822
823!NO!SUBS!
824
825 ;;
826 *)
5a20539c 827 $spitshell >>$Makefile <<'!NO!SUBS!'
199863e7 828MINIPERLEXP = $(MINIPERL_EXE)
549a6b10
JH
829
830PERLEXPORT = perl.exp
831
832!NO!SUBS!
833 ;;
834 esac
5a20539c 835 $spitshell >>$Makefile <<'!NO!SUBS!'
e6807d8a 836perl.exp: $(MINIPERLEXP) makedef.pl $(CONFIGPM) $(SYM) $(SYMH)
72bbce3d 837 $(MINIPERL) makedef.pl --sort-fold PLATFORM=aix CC_FLAGS="$(OPTIMIZE)" > perl.exp
549a6b10
JH
838
839!NO!SUBS!
840 ;;
2c2d71f5 841os2)
5a20539c 842 $spitshell >>$Makefile <<'!NO!SUBS!'
2c2d71f5
JH
843MINIPERLEXP = miniperl
844
e6807d8a 845perl5.def: $(MINIPERLEXP) makedef.pl $(CONFIGPM) $(SYM) $(SYMH) miniperl.map
72bbce3d 846 $(MINIPERL) makedef.pl PLATFORM=os2 -DPERL_DLL=$(PERL_DLL) CC_FLAGS="$(OPTIMIZE)" > perl5.def
2c2d71f5
JH
847
848!NO!SUBS!
849 ;;
5f9145a3 850cygwin)
5a20539c 851 $spitshell >>$Makefile <<'!NO!SUBS!'
5f9145a3
RU
852cygwin.c: cygwin/cygwin.c
853 $(LNS) cygwin/cygwin.c
854
855LIBPERL_NONSHR = libperl$(LIB_EXT)
856
98d35ab7 857$(LIBPERL_NONSHR): $(perllib_objs)
5f9145a3 858 $(RMS) $(LIBPERL_NONSHR)
98d35ab7 859 $(AR) rc $(LIBPERL_NONSHR) $(perllib_objs)
5f9145a3
RU
860
861!NO!SUBS!
862 ;;
549a6b10
JH
863esac
864
5f9145a3 865if test -s $Makefile_s ; then
8736538c 866 . $Makefile_s
5a20539c 867 $spitshell >>$Makefile <<!GROK!THIS!
cd4d8a96 868
8736538c 869Makefile: $Makefile_s
cd4d8a96 870!GROK!THIS!
871else
5ac1e9b2
AA
872 case "$dtrace_h" in
873 ?*)
5a20539c 874 $spitshell >>$Makefile <<'!NO!SUBS!'
12b81ca5 875# dtrace dicards const qualifiers from arguments, put them back
5ac1e9b2 876$(DTRACE_H): perldtrace.d
12b81ca5
TC
877 $(DTRACE) -h -s perldtrace.d -o $(DTRACE_H).in
878 sed -e '/const/!s/char \*/const char */g' $(DTRACE_H).in >$(DTRACE_H)
879 $(RMS) $(DTRACE_H).in
5ac1e9b2
AA
880
881mydtrace.h: $(DTRACE_H)
882
883!NO!SUBS!
884 ;;
885 esac
efc4bddf
DM
886 case "$dtraceobject" in
887 define)
5a20539c 888 $spitshell >>$Makefile <<'!NO!SUBS!'
efc4bddf 889$(DTRACE_MINI_O): perldtrace.d $(miniperl_objs_nodt)
728ecd1a
TC
890 -rm -rf mpdtrace
891 mkdir mpdtrace
892 cp $(miniperl_objs_nodt) mpdtrace/
893 $(DTRACE) -G -s perldtrace.d -o $(DTRACE_MINI_O) $(miniperl_dtrace_objs)
efc4bddf
DM
894
895$(DTRACE_PERLLIB_O): perldtrace.d $(perllib_objs_nodt)
728ecd1a
TC
896 -rm -rf libpdtrace
897 mkdir libpdtrace
898 cp $(perllib_objs_nodt) libpdtrace/
899 $(DTRACE) -G -s perldtrace.d -o $(DTRACE_PERLLIB_O) $(perllib_dtrace_objs)
5ac1e9b2 900
efc4bddf 901$(DTRACE_MAIN_O): perldtrace.d perlmain$(OBJ_EXT)
728ecd1a
TC
902 -rm -rf maindtrace
903 mkdir maindtrace
904 cp perlmain$(OBJ_EXT) maindtrace/
905 $(DTRACE) -G -s perldtrace.d -o $(DTRACE_MAIN_O) $(perlmain_dtrace_objs) || \
47a83dc6
TC
906 ( $(ECHO) "No probes in perlmain$(OBJ_EXT), generating a dummy $(DTRACE_MAIN_O)" && \
907 $(ECHO) >dtrace_main.c && \
908 `$(CCCMD)` $(PLDLFLAGS) dtrace_main.c && \
909 rm -f dtrace_main.c )
3d450a5d 910
5ac1e9b2
AA
911!NO!SUBS!
912 ;;
913 esac
5a20539c 914 $spitshell >>$Makefile <<'!NO!SUBS!'
728ecd1a 915$(LIBPERL): $& $(perllib_dep) $(DYNALOADER) $(LIBPERLEXPORT)
9c9e9f08 916!NO!SUBS!
d96ebe2e 917 case "$useshrplib" in
918 true)
5a20539c 919 $spitshell >>$Makefile <<'!NO!SUBS!'
0107c41a 920 rm -f $@
98d35ab7 921 $(LD) -o $@ $(SHRPLDFLAGS) $(perllib_objs) $(DYNALOADER) $(libs)
3c321fdc 922!NO!SUBS!
923 case "$osname" in
924 aix)
5a20539c 925 $spitshell >>$Makefile <<'!NO!SUBS!'
28e8609d 926 rm -f libperl$(OBJ_EXT)
3c321fdc 927 mv $@ libperl$(OBJ_EXT)
928 $(AR) qv $(LIBPERL) libperl$(OBJ_EXT)
ecfc5424 929!NO!SUBS!
3c321fdc 930 ;;
931 esac
d96ebe2e 932 ;;
933 *)
5a20539c 934 $spitshell >>$Makefile <<'!NO!SUBS!'
d96ebe2e 935 rm -f $(LIBPERL)
98d35ab7 936 $(AR) rc $(LIBPERL) $(perllib_objs) $(DYNALOADER)
d96ebe2e 937 @$(ranlib) $(LIBPERL)
655635e8 938!NO!SUBS!
d96ebe2e 939 ;;
940 esac
5a20539c 941 $spitshell >>$Makefile <<'!NO!SUBS!'
599a829f
IZ
942
943# How to build executables.
944
945# The $& notation tells Sequent machines that it can do a parallel make,
946# and is harmless otherwise.
947# The miniperl -w -MExporter line is a basic cheap test to catch errors
948# before make goes on to run preplibrary and then MakeMaker on extensions.
949# This is very handy because later errors are often caused by miniperl
950# build problems but that's not obvious to the novice.
951# The Module used here must not depend on Config or any extensions.
952
cb251201
NC
953# The seemingly cranky ordering of having $(MINIPERL_EXE) depend on
954# lib/buildcustomize.pl despite the reality that lib/buildcustomize.pl needs
955# miniperl to exist first permits us to
956# a) have one rule generate both miniperl and lib/buildcustomize.pl
c02d599b 957# (so that lib/buildcustomize.pl is always available. This simplifies things)
cb251201
NC
958# b) have the rest of the Makefile depend on the more obvious $(MINIPERL_EXE)
959
960$(MINIPERL_EXE): lib/buildcustomize.pl
961
ecfb2188
GS
962!NO!SUBS!
963
964 case "${osname}${osvers}" in
218f8ee6
AB
965 amigaos*)
966 $spitshell >>$Makefile <<'!NO!SUBS!'
98d35ab7 967lib/buildcustomize.pl: $& $(miniperl_objs) write_buildcustomize.pl
218f8ee6
AB
968 -@rm -f miniperl.xok
969 $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
98d35ab7 970 $(miniperl_objs) $(libs)
218f8ee6
AB
971# $(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
972 $(MINIPERL) -f write_buildcustomize.pl
973!NO!SUBS!
974 ;;
b6c36746 975 aix*)
5a20539c 976 $spitshell >>$Makefile <<'!NO!SUBS!'
98d35ab7
DM
977lib/buildcustomize.pl: $& $(miniperl_objs)
978 $(CC) -o $(MINIPERL_EXE) $(CLDFLAGS) $(miniperl_objs) $(libs)
6aafa456 979 $(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
b78ac715 980 $(MINIPERL) -f write_buildcustomize.pl
ecfb2188
GS
981!NO!SUBS!
982 ;;
e56d2c04 983 next4*)
5a20539c 984 $spitshell >>$Makefile <<'!NO!SUBS!'
98d35ab7
DM
985lib/buildcustomize.pl: $& $(miniperl_objs) write ldcustomize.pl
986 $(CC) -o $(MINIPERL_EXE) $(miniperl_objs libs)
6aafa456 987 $(LDLIBPTH) ./miniperl$(HOST _EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
b78ac715 988 $(MINIPERL) -f write_buildcustomize.pl
535d2540
JH
989!NO!SUBS!
990 ;;
cb3fc426 991 darwin*)
986530ea
JH
992 case "$osvers" in
993 [1-6].*) ;;
994 *) case "$ldflags" in
995 *"-flat_namespace"*) ;;
996 *) # to allow opmini.o to override stuff in libperl.dylib
5a20539c 997 $spitshell >>$Makefile <<!NO!SUBS!
69625aa9
JH
998NAMESPACEFLAGS = -force_flat_namespace
999!NO!SUBS!
986530ea
JH
1000 ;;
1001 esac
1002 ;;
cb3fc426 1003 esac
5a20539c 1004 $spitshell >>$Makefile <<'!NO!SUBS!'
98d35ab7 1005lib/buildcustomize.pl: $& $(miniperl_objs) write_buildcustomize.pl
cb3fc426 1006 -@rm -f miniperl.xok
199863e7 1007 $(CC) $(CLDFLAGS) $(NAMESPACEFLAGS) -o $(MINIPERL_EXE) \
98d35ab7 1008 $(miniperl_objs) $(libs)
6aafa456 1009 $(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
b78ac715 1010 $(MINIPERL) -f write_buildcustomize.pl
cb3fc426
JH
1011!NO!SUBS!
1012 ;;
ecfb2188 1013 *)
b98f6b80 1014 if test "X$hostperl" != X; then
b2b07891 1015 $spitshell >>$Makefile <<!GROK!THIS!
728ecd1a 1016lib/buildcustomize.pl: \$& \$(miniperl_dep) write_buildcustomize.pl
b98f6b80 1017 -@rm -f miniperl.xok
b2b07891
BF
1018 -@rm \$(MINIPERL_EXE)
1019 \$(LNS) \$(HOST_PERL) \$(MINIPERL_EXE)
1020 \$(LDLIBPTH) ./miniperl\$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
1021 \$(MINIPERL) -f write_buildcustomize.pl 'osname' "$osname"
1022!GROK!THIS!
b98f6b80
JR
1023 else
1024 $spitshell >>$Makefile <<'!NO!SUBS!'
728ecd1a 1025lib/buildcustomize.pl: $& $(miniperl_dep) write_buildcustomize.pl
93c0359c 1026 -@rm -f miniperl.xok
dfef7e50 1027 $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
98d35ab7 1028 $(miniperl_objs) $(libs)
6aafa456 1029 $(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
b78ac715 1030 $(MINIPERL) -f write_buildcustomize.pl
ecfb2188 1031!NO!SUBS!
b98f6b80 1032 fi
ecfb2188
GS
1033 ;;
1034 esac
1035
5a20539c 1036 $spitshell >>$Makefile <<'!NO!SUBS!'
599a829f 1037
728ecd1a 1038$(PERL_EXE): $& $(perlmain_dep) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT) write_buildcustomize.pl
93c0359c 1039 -@rm -f miniperl.xok
6711cb4f
TC
1040!NO!SUBS!
1041
1042 case $osname in
c8aec1f6
AB
1043 # In AmigaOS the Perl executable needs to be linked with -ldl,
1044 # but none of the other executables should be.
1045 amigaos) $spitshell >>$Makefile <<'!NO!SUBS!'
efc4bddf 1046 $(SHRPENV) $(CC) -o perl $(CLDFLAGS) $(CCDLFLAGS) $(perlmain_objs) $(LLIBPERL) $(static_ext) `cat ext.libs` $(libs) -ldl
c8aec1f6
AB
1047!NO!SUBS!
1048 ;;
6711cb4f 1049 os390) $spitshell >>$Makefile <<'!NO!SUBS!'
efc4bddf 1050 $(SHRPENV) $(CC) -o perl $(CLDFLAGS) $(CCDLFLAGS) $(perlmain_objs) $(LLIBPERL) $(static_ext) `cat ext.libs` $(libs)
6711cb4f
TC
1051!NO!SUBS!
1052 ;;
1053 *) $spitshell >>$Makefile <<'!NO!SUBS!'
efc4bddf 1054 $(SHRPENV) $(CC) -o perl $(CLDFLAGS) $(CCDLFLAGS) $(perlmain_objs) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
6711cb4f
TC
1055!NO!SUBS!
1056 ;;
1057 esac
1058
1059 $spitshell >>$Makefile <<'!NO!SUBS!'
599a829f 1060
f946bb38
JH
1061# Microperl. This is just a convenience thing if one happens to
1062# build also the full Perl and therefore the real big Makefile:
f4db5405 1063# usually one should manually explicitly issue the below command.
f946bb38 1064
869a466c 1065.PHONY: microperl
f946bb38
JH
1066microperl:
1067 $(MAKE) -f Makefile.micro
1068
fe5460cc
RT
1069!NO!SUBS!
1070
599a829f
IZ
1071fi
1072
6d4b7d88
JH
1073# Some environment have no system(), which mkpport uses.
1074# Let's try running the commands with shell.
1075case "${osname}" in
1076catamount)
5a20539c 1077$spitshell >>$Makefile <<!GROK!THIS!
6d4b7d88 1078.PHONY: makeppport
199863e7 1079makeppport: \$(MINIPERL_EXE) \$(CONFIGPM)
6d4b7d88 1080 -@for f in Makefile.PL PPPort_pm.PL PPPort_xs.PL ppport_h.PL; do \
199863e7 1081 (cd ext/Devel-PPPort && `pwd`/run.sh ../../$(MINIPERL_EXE) -I../../lib \$\$f); \
6d4b7d88
JH
1082 done
1083
1084!GROK!THIS!
1085;;
1086*)
5a20539c 1087$spitshell >>$Makefile <<'!NO!SUBS!'
6d4b7d88 1088.PHONY: makeppport
199863e7 1089makeppport: $(MINIPERL_EXE) $(CONFIGPM) $(nonxs_ext)
f6b3c354 1090 $(MINIPERL) mkppport
6d4b7d88
JH
1091
1092!NO!SUBS!
1093;;
1094esac
1095
5a20539c 1096$spitshell >>$Makefile <<'!NO!SUBS!'
599a829f 1097
c0e3b4b5 1098.PHONY: preplibrary common_build
7353f64c 1099preplibrary: $(MINIPERL_EXE) $(CONFIGPM) $(PREPLIBRARY_LIBPERL)
2304df62 1100
0f13ebd5
NC
1101$(CONFIGPM_FROM_CONFIG_SH): $(CONFIGPOD)
1102
1103$(CONFIGPOD): config.sh $(MINIPERL_EXE) configpm Porting/Glossary lib/Config_git.pl
199863e7 1104 $(MINIPERL) configpm
2304df62 1105
58fa074c 1106unidatafiles $(unidatafiles) pod/perluniprops.pod: uni.data
6c684aee 1107
199863e7 1108uni.data: $(MINIPERL_EXE) $(CONFIGPM) lib/unicore/mktables $(nonxs_ext)
f6b3c354 1109 $(MINIPERL) lib/unicore/mktables -C lib/unicore -P pod -maketest -makelist -p
f86864ac
KW
1110# Commented out so always runs, mktables looks at far more files than we
1111# can in this makefile to decide if needs to run or not
1112# touch uni.data
5ad7e614 1113
f4e064af 1114# $(PERL_EXE) and ext because pod_lib.pl needs Digest::MD5
7eb47696
NC
1115# But also this ensures that all extensions are built before we try to scan
1116# them, which picks up Devel::PPPort's documentation.
fda9c55c 1117pod/perltoc.pod: $(perltoc_pod_prereqs) $(PERL_EXE) $(ext) pod/buildtoc
9094a4e8 1118 $(RUN_PERL) -f pod/buildtoc -q
7eb47696 1119
0f13ebd5
NC
1120pod/perlapi.pod: pod/perlintern.pod
1121
f4e064af 1122pod/perlintern.pod: $(MINIPERL_EXE) autodoc.pl embed.fnc
199863e7 1123 $(MINIPERL) autodoc.pl
344af494 1124
199863e7 1125pod/perlmodlib.pod: $(MINIPERL_EXE) pod/perlmodlib.PL MANIFEST
f6b3c354 1126 $(MINIPERL) pod/perlmodlib.PL -q
6e2c8928 1127
373fec1e
SH
1128pod/perl5292delta.pod: pod/perldelta.pod
1129 $(RMS) pod/perl5292delta.pod
1130 $(LNS) perldelta.pod pod/perl5292delta.pod
8e7bc40f 1131
199863e7 1132extra.pods: $(MINIPERL_EXE)
ebbebb7c 1133 -@test ! -f extra.pods || rm -f `cat extra.pods`
72b3d9b4 1134 -@rm -f extra.pods
b4bc034f 1135 -@for x in `grep -l '^=[a-z]' README.* | grep -v README.vms` ; do \
72b3d9b4 1136 nx=`echo $$x | sed -e "s/README\.//"`; \
e0be038f 1137 $(LNS) ../$$x "pod/perl"$$nx".pod" ; \
72b3d9b4
GS
1138 echo "pod/perl"$$nx".pod" >> extra.pods ; \
1139 done
ebbebb7c 1140
c0e3b4b5 1141extras.make: $(PERL_EXE)
9094a4e8 1142 -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -MCPAN -e '@ARGV&&make(@ARGV)' `cat extras.lst`
bf35c3f6 1143
34b80e25 1144extras.test: $(PERL_EXE)
9094a4e8 1145 -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -MCPAN -e '@ARGV&&test(@ARGV)' `cat extras.lst`
bf35c3f6 1146
34b80e25 1147extras.install: $(PERL_EXE)
9094a4e8 1148 -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -MCPAN -e '@ARGV&&install(@ARGV)' `cat extras.lst`
bf35c3f6 1149
869a466c 1150.PHONY: install install-strip install-all install-verbose install-silent \
5e2f386f 1151 no-install install.perl install.man install.html
869a466c 1152
70eaf669
IZ
1153# Set this to an empty string to avoid an attempt of rebuild before install
1154INSTALL_DEPENDENCE = all
1155
6784814b
NC
1156no_install no-install: install-notify
1157
1158install: install-all
07f58f84
NC
1159!NO!SUBS!
1160
c0e3b4b5
TC
1161if test "$storable_type" != "" ; then
1162
bcdb10f5
TC
1163case "$static_cwd" in
1164undef) storable_limit_dep="$storable_limit_dep lib/auto/Cwd/Cwd.$dlext" ;;
1165esac
1166
c0e3b4b5
TC
1167$spitshell >>$Makefile <<EOT
1168
1169dist/Storable/lib/Storable/Limit.pm : \$(PERL_EXE) dist/Storable/stacksize $storable_limit_dep
8175eebc 1170 cd dist/Storable ; \$(LDLIBPTH) \$(MAKE) lib/Storable/Limit.pm
c0e3b4b5
TC
1171
1172lib/Storable/Limit.pm : dist/Storable/lib/Storable/Limit.pm
1173 test -d lib/Storable || mkdir lib/Storable
1174 cp dist/Storable/lib/Storable/Limit.pm lib/Storable/Limit.pm
1175EOT
1176
1177common_build_deps="$common_build_deps lib/Storable/Limit.pm"
1178
1179fi
a9bf3e8f 1180
07f58f84
NC
1181for name in all notify silent strip verbose; do
1182 flags="--$name";
078902ab 1183 flags=`echo $flags | sed -e 's/--all//'`
a9bf3e8f
JR
1184 if test "X$hostperl" != X; then
1185 $spitshell >>$Makefile <<EOT
1186
1187install_$name install-$name: \$(INSTALL_DEPENDENCE) installperl all installman
078902ab
GA
1188 \$(HOST_PERL) installperl --destdir=\$(DESTDIR) $flags \$(INSTALLFLAGS) \$(STRIPFLAGS)
1189 \$(HOST_PERL) installman --destdir=\$(DESTDIR) $flags
a9bf3e8f
JR
1190EOT
1191 else
1192 $spitshell >>$Makefile <<EOT
07f58f84
NC
1193
1194install_$name install-$name: \$(INSTALL_DEPENDENCE) installperl all installman
078902ab
GA
1195 \$(RUN_PERL) installperl --destdir=\$(DESTDIR) $flags \$(INSTALLFLAGS) \$(STRIPFLAGS)
1196 \$(RUN_PERL) installman --destdir=\$(DESTDIR) $flags
07f58f84 1197EOT
a9bf3e8f 1198 fi
3a031125
NC
1199
1200 test $name = notify || echo ' -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -Ilib -MCPAN -e '\''@ARGV&&install(@ARGV)'\'' `cat extras.lst`' >>$Makefile
07f58f84
NC
1201done
1202
a9bf3e8f 1203if test "X$hostperl" != X; then
98acbca8 1204 LOCAL_PERL='$(HOST_PERL)'
a9bf3e8f
JR
1205 $spitshell >>$Makefile <<'!NO!SUBS!'
1206install.perl: $(INSTALL_DEPENDENCE) installperl
1207 $(HOST_PERL) installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) $(STRIPFLAGS)
1208 -@test ! -s extras.lst || $(MAKE) extras.install
a9bf3e8f
JR
1209!NO!SUBS!
1210else
98acbca8 1211 LOCAL_PERL='$(RUN_PERL)'
a9bf3e8f 1212 $spitshell >>$Makefile <<'!NO!SUBS!'
70eaf669 1213install.perl: $(INSTALL_DEPENDENCE) installperl
34b80e25 1214 $(RUN_PERL) installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) $(STRIPFLAGS)
d618fe71 1215 -@test ! -s extras.lst || PATH="`pwd`:\${PATH}" PERL5LIB="`pwd`/lib" \$(RUN_PERL) -Ilib -MCPAN -e '@ARGV&&install(@ARGV)' `cat extras.lst`
a0d0e21e 1216
98acbca8
N
1217!NO!SUBS!
1218fi
1219
1220$spitshell >>$Makefile <<!GROK!THIS!
b1a1e9f1 1221install.man: all installman
98acbca8 1222 ${LOCAL_PERL} installman --destdir=\$(DESTDIR) \$(INSTALLFLAGS)
16d20bd9 1223
84902520
TB
1224# XXX Experimental. Hardwired values, but useful for testing.
1225# Eventually Configure could ask for some of these values.
1226install.html: all installhtml
98acbca8
N
1227 -@test -f README.vms && cd vms && \$(LNS) ../README.vms README_vms.pod && cd ..
1228 ${LOCAL_PERL} installhtml \\
1229 --podroot=. --podpath=. --recurse \\
1230 --htmldir=\$(privlib)/html \\
98acbca8
N
1231 --splithead=pod/perlipc \\
1232 --splititem=pod/perlfunc \\
1233 --ignore=Porting/Maintainers.pm,Porting/pumpkin.pod,Porting/repository.pod \\
84902520 1234 --verbose
98acbca8 1235!GROK!THIS!
84902520 1236
a9bf3e8f 1237$spitshell >>$Makefile <<'!NO!SUBS!'
16d20bd9 1238
a0d0e21e 1239# I now supply perly.c with the kits, so the following section is
0de566d7
DM
1240# used only if you force bison to run by saying
1241# make regen_perly
1242# You normally shouldn't remake perly.[ch].
1243
1244.PHONY: regen_perly
1245
59c72abb 1246run_byacc run-byacc:
0de566d7
DM
1247 @echo "run_byacc is obsolete; try 'make regen_perly' instead"
1248
f05e27e5 1249# this outputs perly.h, perly.act and perly.tab
59c72abb 1250regen_perly regen-perly:
0de566d7 1251 perl regen_perly.pl
56febc5e
AD
1252
1253# We don't want to regenerate perly.c and perly.h, but they might
1254# appear out-of-date after a patch is applied or a new distribution is
1255# made.
92c28edd 1256perly.c: perly.y
b233458b
JH
1257 -@sh -c true
1258
92c28edd 1259perly.h: perly.y
b233458b
JH
1260 -@sh -c true
1261
d500e60d 1262SYM = globvar.sym perlio.sym
419eaf7b 1263
907b3e23 1264SYMH = perlvars.h intrpvar.h
419eaf7b 1265
dae78bb1
IZ
1266CHMOD_W = chmod +w
1267
a8581515 1268# The following files are generated automatically
d500e60d 1269# embed.pl: proto.h embed.h embedvar.h perlapi.h perlapi.c
897d3989 1270# opcode.pl: opcode.h opnames.h pp_proto.h
c83f8f39
JH
1271# regcomp.pl: regnodes.h
1272# warnings.pl: warnings.h lib/warnings.pm
f2c01b15 1273# feature.pl: feature.h lib/feature.pm
e50aee73
AD
1274# The correct versions should be already supplied with the perl kit,
1275# in case you don't have perl available.
36bb303b 1276# To force them to be regenerated, run
9ad884cb 1277# perl regen.pl
36bb303b
NC
1278# with your existing copy of perl
1279# (make regen_headers is kept for backwards compatibility)
e1354ed6 1280
1e2f36ef 1281.PHONY: regen_headers regen_all
869a466c 1282
95aa0565 1283regen: FORCE
9ad884cb 1284 -perl regen.pl
2caceca9 1285 -perl regen/uconfig_h.pl
8e07c86e 1286
59c72abb 1287regen_headers regen-headers: FORCE
95aa0565 1288 -perl regen.pl -v
2caceca9 1289 -perl regen/uconfig_h.pl -v
95aa0565 1290
bfc0a3e7 1291regen_meta regen-meta: META.yml META.json
de65cabd
JV
1292
1293META.yml: FORCE
9094a4e8 1294 PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) Porting/makemeta -y
bfc0a3e7
CBW
1295
1296META.json: FORCE
9094a4e8 1297 PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) Porting/makemeta -j
de65cabd
JV
1298
1299
59c72abb 1300regen_all regen-all: regen regen_meta
9fec149b 1301
1aea71db
A
1302.PHONY: manisort manicheck
1303
1304manisort: FORCE
4e86fc4b
JH
1305 @perl Porting/manisort -q || (echo "WARNING: re-sorting MANIFEST"; \
1306 perl Porting/manisort -q -o MANIFEST; sh -c true)
1aea71db
A
1307
1308manicheck: FORCE
1309 perl Porting/manicheck
1310
a0d0e21e 1311# Extensions:
4318d5a0
GB
1312# Names added to $(dynamic_ext) or $(static_ext) or $(nonxs_ext) will
1313# automatically get built. There should ordinarily be no need to change
1314# any of this part of makefile.
a0d0e21e
LW
1315#
1316# The dummy dependency is a place holder in case $(dynamic_ext) or
1317# $(static_ext) is empty.
1318#
1319# DynaLoader may be needed for extensions that use Makefile.PL.
1320
5e4c4c91 1321$(DYNALOADER): $(MINIPERL_EXE) lib/buildcustomize.pl preplibrary FORCE $(nonxs_ext)
aafd5a98 1322 $(MINIPERL) make_ext.pl $@ $(MAKE_EXT_ARGS) MAKE="$(MAKE)" LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS)
a0d0e21e 1323
56dba491 1324d_dummy $(dynamic_ext): $(MINIPERL_EXE) lib/buildcustomize.pl preplibrary makeppport $(DYNALOADER) FORCE $(PERLEXPORT) $(LIBPERL)
aafd5a98 1325 $(MINIPERL) make_ext.pl $@ $(MAKE_EXT_ARGS) MAKE="$(MAKE)" LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic
a0d0e21e 1326
5e4c4c91 1327s_dummy $(static_ext): $(MINIPERL_EXE) lib/buildcustomize.pl preplibrary makeppport $(DYNALOADER) FORCE
aafd5a98 1328 $(MINIPERL) make_ext.pl $@ $(MAKE_EXT_ARGS) MAKE="$(MAKE)" LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS)
2304df62 1329
5e4c4c91 1330n_dummy $(nonxs_ext): $(MINIPERL_EXE) lib/buildcustomize.pl preplibrary FORCE
aafd5a98 1331 $(MINIPERL) make_ext.pl $@ $(MAKE_EXT_ARGS) MAKE="$(MAKE)" LIBPERL_A=$(LIBPERL)
9f3ef600
NC
1332!NO!SUBS!
1333
5a20539c 1334$spitshell >>$Makefile <<EOF
9f3ef600
NC
1335$extra_dep
1336EOF
1337
5a20539c 1338$spitshell >>$Makefile <<'!NO!SUBS!'
4318d5a0 1339
a774dfe6
RSG
1340.PHONY: printconfig
1341printconfig:
9094a4e8 1342 @eval `$(RUN_PERL) -V:$(CONFIGVAR)`; echo $$$(CONFIGVAR)
a774dfe6 1343
869a466c
JH
1344.PHONY: clean _tidy _mopup _cleaner1 _cleaner2 \
1345 realclean _realcleaner clobber _clobber \
6e2cec71 1346 distclean veryclean _verycleaner
869a466c 1347
dd8235d9 1348clean: realclean
70af249b 1349
6e2cec71 1350realclean: _realcleaner _mopup
fcfe1ab7 1351 @echo "Note that '$(MAKE) realclean' does not delete config.sh or Policy.sh"
70af249b 1352
b37ebb13 1353_clobber:
d9821278 1354 -@rm -f Cross/run-* Cross/to-* Cross/from-* Cross/mkdir
b98f6b80 1355 -rm -rf host
0279961e 1356 rm -f t/test_state
bf35c3f6 1357 rm -f config.sh cppstdin Policy.sh extras.lst
df3c16d0 1358 rm -f $(MANIFEST_SRT)
b37ebb13 1359
6e2cec71 1360clobber: _realcleaner _mopup _clobber
70af249b
CS
1361
1362distclean: clobber
1363
2edbd6da 1364# Like distclean but also removes emacs backups and *.orig.
6e2cec71 1365veryclean: _verycleaner _mopup _clobber
b37ebb13 1366 -@rm -f Obsolete Wanted
2edbd6da 1367
70af249b
CS
1368# Do not 'make _mopup' directly.
1369_mopup:
9387abf8 1370 rm -f *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c opmini.c perlmini.c generate_uudmap$(EXE_EXT) $(generated_headers)
1ed50e5b 1371 -rmdir .depending
72b3d9b4 1372 -@test -f extra.pods && rm -f `cat extra.pods`
b4bc034f 1373 -@test -f vms/README_vms.pod && rm -f vms/README_vms.pod
60f0ee9d 1374 -rm -f perl.exp ext.libs $(generated_pods) uni.data opmini.o perlmini.o pod/roffitall
d96ebe2e 1375 -rm -f perl.export perl.dll perl.libexp perl.map perl.def
f01ecde8 1376 -rm -f *perl.xok
ce0286c6 1377 -rm -f cygwin.c libperl*.def libperl*.dll cygperl*.dll *.exe.stackdump
34b80e25 1378 -rm -f $(PERL_EXE) $(MINIPERL_EXE) $(LIBPERL) libperl.* microperl
fc40bd89 1379 -rm -f config.arch config.over $(DTRACE_H)
70af249b 1380
2edbd6da 1381_cleaner1:
4633a7c4 1382 -cd os2; rm -f Makefile
2edbd6da
JH
1383 -cd pod; $(LDLIBPTH) $(MAKE) $(CLEAN)
1384 -cd utils; $(LDLIBPTH) $(MAKE) $(CLEAN)
199863e7 1385 -@if test -f $(MINIPERL_EXE) ; then \
61edc683 1386 for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \
63d47850 1387 $(MINIPERL) make_ext.pl --target=$(CLEAN) $$x MAKE="$(MAKE)" ; \
61edc683
NC
1388 done ; \
1389 else \
1390 sh $(CLEAN).sh ; \
1391 fi
1392 rm -f realclean.sh veryclean.sh
e621c5a8 1393 -rm -f `grep -v ^# mkppport.lst | grep . | sed -e 's/$$/\/ppport.h/'`
0d4cbbcf
NC
1394
1395# Dear POSIX, thanks for making the default to xargs to be
1396# run once if nothhing is passed in. It is such a great help.
2edbd6da 1397
2ad994b6 1398# Some systems do not support "?", so keep these files separate.
f6b70559
NC
1399
1400# The Time::HiRes Makefile *should* remove dist/Time-HiRes/xdefine for 'clean',
1401# but it's possible to get a rebuilt checkout into a state where it can't run
1402# distclean, and can't recover until the file is gone.
1403# There's no harm in adding it to the top level 'distclean' target - it should
1404# anyway by then, and miniperl is long gone.
1405# Add new rules before that line - the next line (rm -f so_locations ...) is
1406# used as a placeholder by a regen script.
2edbd6da 1407_cleaner2:
2ad994b6 1408 -rm -f core.*perl.*.? t/core.perl.*.? .?*.c
5033177e 1409 rm -f core *perl.core t/core t/*perl.core core.* t/core.*
f18bc4a8
NC
1410 rm -f t/$(PERL_EXE) t/rantests
1411 rm -rf t/tmp*
a0d0e21e 1412 rm -rf $(addedbyconf)
0827416d 1413 rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old makefile.old utils/Makefile
c27f7bb1 1414 rm -f $(private)
ca12659b 1415 rm -rf $(unidatafiles) $(unidatadirs)
a0d0e21e 1416 rm -rf lib/auto
07a6e20d 1417 rm -f lib/.exists lib/*/.exists lib/*/*/.exists
2560602c 1418 rm -f h2ph.man
a0d0e21e 1419 rm -rf .config
7353f64c 1420 rm -f preload
5daeb5b0
NC
1421 rm -f pod2htmd.tmp
1422 rm -rf pod/perlfunc pod/perlipc
1423 -rmdir ext/B/lib
f6b70559 1424 -rm -f dist/Time-HiRes/xdefine
5daeb5b0 1425 rm -f so_locations $(LIBPERL_NONSHR) $(MINIPERL_NONSHR)
df61f5a9
SH
1426 -rmdir lib/version lib/threads lib/inc/ExtUtils lib/inc lib/encoding
1427 -rmdir lib/autodie/exception lib/autodie/Scope lib/autodie lib/XS
1428 -rmdir lib/Win32API lib/VMS lib/Unicode/Collate/Locale
1429 -rmdir lib/Unicode/Collate/CJK lib/Unicode/Collate lib/Tie/Hash
a5ab2255
CBW
1430 -rmdir lib/Thread lib/Text lib/Test2/Util lib/Test2/Tools
1431 -rmdir lib/Test2/IPC/Driver lib/Test2/IPC lib/Test2/Hub/Interceptor
07bc328a
SH
1432 -rmdir lib/Test2/Hub lib/Test2/Formatter lib/Test2/EventFacet
1433 -rmdir lib/Test2/Event/TAP lib/Test2/Event lib/Test2/API lib/Test2
1434 -rmdir lib/Test/use lib/Test/Tester lib/Test/Builder/Tester
1435 -rmdir lib/Test/Builder/IO lib/Test/Builder lib/Test lib/Term
1436 -rmdir lib/TAP/Parser/YAMLish lib/TAP/Parser/SourceHandler
1437 -rmdir lib/TAP/Parser/Scheduler lib/TAP/Parser/Result
1438 -rmdir lib/TAP/Parser/Iterator lib/TAP/Parser lib/TAP/Harness
1439 -rmdir lib/TAP/Formatter/File lib/TAP/Formatter/Console
1440 -rmdir lib/TAP/Formatter lib/TAP lib/Sys/Syslog lib/Sys lib/Sub
1441 -rmdir lib/Search lib/Scalar lib/Pod/Text lib/Pod/Simple
1442 -rmdir lib/Pod/Perldoc lib/PerlIO/via lib/PerlIO lib/Perl
1443 -rmdir lib/Parse/CPAN lib/Parse lib/Params lib/Net/FTP lib/Module/Load
1444 -rmdir lib/Module/CoreList lib/Module lib/Memoize lib/Math/BigInt
1445 -rmdir lib/Math/BigFloat lib/Math lib/MIME lib/Locale/Maketext
1446 -rmdir lib/Locale/Codes lib/Locale lib/List/Util lib/List lib/JSON/PP
1447 -rmdir lib/JSON lib/IPC lib/IO/Uncompress/Adapter lib/IO/Uncompress
1448 -rmdir lib/IO/Socket lib/IO/Compress/Zlib lib/IO/Compress/Zip
1449 -rmdir lib/IO/Compress/Gzip lib/IO/Compress/Base
d81c2d6a
CBW
1450 -rmdir lib/IO/Compress/Adapter lib/IO/Compress lib/IO
1451 -rmdir lib/I18N/LangTags lib/I18N lib/Hash/Util lib/Hash lib/HTTP
1452 -rmdir lib/Filter/Util lib/Filter lib/File/Spec lib/ExtUtils/Typemaps
88e24181
CBW
1453 -rmdir lib/ExtUtils/ParseXS lib/ExtUtils/MakeMaker/version
1454 -rmdir lib/ExtUtils/MakeMaker lib/ExtUtils/Liblist
1455 -rmdir lib/ExtUtils/Constant lib/ExtUtils/Command
727d4ce6
NC
1456 -rmdir lib/ExtUtils/CBuilder/Platform/Windows
1457 -rmdir lib/ExtUtils/CBuilder/Platform lib/ExtUtils/CBuilder
1458 -rmdir lib/Exporter lib/Encode/Unicode lib/Encode/MIME/Header
1459 -rmdir lib/Encode/MIME lib/Encode/KR lib/Encode/JP lib/Encode/CN
1460 -rmdir lib/Encode lib/Digest lib/Devel lib/Data lib/Config/Perl
79116533
SH
1461 -rmdir lib/Compress/Raw lib/Compress lib/Carp lib/CPAN/Plugin
1462 -rmdir lib/CPAN/Meta/History lib/CPAN/Meta lib/CPAN/LWP
1463 -rmdir lib/CPAN/Kwalify lib/CPAN/HTTP lib/CPAN/FTP lib/CPAN/Exception
1464 -rmdir lib/CPAN/API lib/CPAN lib/Attribute lib/Archive/Tar lib/Archive
a770949e 1465 -rmdir lib/App/Prove/State/Result lib/App/Prove/State lib/App/Prove
6e8fbcb5 1466 -rmdir lib/App lib/Amiga
ecfc5424 1467
f4db5405 1468_realcleaner:
95aef5ce 1469 @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=distclean
2edbd6da
JH
1470 @$(LDLIBPTH) $(MAKE) _cleaner2
1471
f4db5405 1472_verycleaner:
2edbd6da
JH
1473 @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=veryclean
1474 @$(LDLIBPTH) $(MAKE) _cleaner2
c94787a5 1475 -rm -f *~ *.orig */*~ */*.orig */*/*~ */*/*.orig
2edbd6da 1476
869a466c 1477.PHONY: lint
bf0dfd28 1478lint: $(c)
075abff3 1479 rm -f *.ln
66a1b24b 1480 lint $(lintflags) -DPERL_CORE -D_REENTRANT -DDEBUGGING -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(c)
2304df62 1481
762030fb
JH
1482cscopeflags = -Rb # Recursive, build-only.
1483
1484.PHONY: cscope
1485# To query the cscope.out "cscope -dLnsymbol" where n = 0 means uses,
8a1d10af
JH
1486# 1 = definitions, 2 = callees, 3 = callers, for example
1487# "cscope -dL1Perl_mg_set" or run cscope interactively (no arguments).
762030fb
JH
1488cscope.out cscope: $(c) $(h)
1489 cscope $(cscopeflags)
1490
fb73857a 1491# Need to unset during recursion to go out of loop.
1492# The README below ensures that the dependency list is never empty and
1493# that when MAKEDEPEND is empty $(FIRSTMAKEFILE) doesn't need rebuilding.
cd4d8a96 1494
84902520 1495MAKEDEPEND = Makefile makedepend
cd4d8a96 1496
fb73857a 1497$(FIRSTMAKEFILE): README $(MAKEDEPEND)
cd4d8a96 1498 $(MAKE) depend MAKEDEPEND=
9719c95b
NC
1499!NO!SUBS!
1500
1501for f in $SH; do
1502 file=`SH_to_target $f`
1503 $spitshell >>$Makefile <<!GROK!THIS!
a0d0e21e 1504
9719c95b
NC
1505$file: $f config.sh
1506 \$(SHELL) $f
1507!GROK!THIS!
1508done
1509
1510$spitshell >>$Makefile <<'!NO!SUBS!'
655635e8 1511
869a466c 1512.PHONY: depend
1be0d08e 1513depend: makedepend $(DTRACE_H) $(generated_headers)
63d47850 1514 sh ./makedepend MAKE="$(MAKE)" cflags
2304df62 1515
9988b539 1516.PHONY: test check test_prep test_prep_nodll test_prep_pre \
ec81ed5d 1517 test_prep_reonly test_tty test-tty test_notty test-notty \
499cea6b 1518 test_harness test_harness_notty minitest test-reonly _test
f258a656 1519
9e716730
MB
1520# The _test target is there just for Test::Smoke, which does a make test_prep
1521# always before invoking this target, thus preventing checking again
f258a656 1522_test:
463c96de 1523 $(RUN_TESTS) choose
869a466c 1524
ec861bc1
JH
1525# Cannot delegate rebuilding of t/perl to make
1526# to allow interlaced test and minitest
3e3baf6d 1527
1167a30e
IZ
1528# Architecture-neutral stuff:
1529
1530test_prep_pre: preplibrary utilities $(nonxs_ext)
421103b7 1531!NO!SUBS!
1167a30e 1532
421103b7
JR
1533case "$targethost" in
1534'') $spitshell >>$Makefile <<'!NO!SUBS!'
59c72abb 1535test_prep test-prep: test_prep_pre $(MINIPERL_EXE) $(unidatafiles) $(PERL_EXE) \
c0e3b4b5 1536 $(dynamic_ext) $(TEST_PERL_DLL) runtests $(generated_pods) common_build
34b80e25 1537 cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE))
a0ed51b3 1538
421103b7
JR
1539!NO!SUBS!
1540;;
1541*) $spitshell >>$Makefile <<!GROK!THIS!
1542test_prep test-prep: test_prep_pre \$(MINIPERL_EXE) \$(unidatafiles) \$(PERL_EXE) \
e5a8a0fb 1543 \$(dynamic_ext) \$(TEST_PERL_DLL) runtests \
c0e3b4b5 1544 \$(generated_pods) common_build
421103b7
JR
1545 $to libperl.*
1546 $to t/*
1547 $to lib/*
1548 $to TestInit.pm
1549 $to win32/FindExt.pm
1550 $to regen/*
1551 $to pod/*
1552 $to MANIFEST
1553 $to Porting/*
1554 $to cpan/*/t
1555 $to dist/*/t
1556 $to ext/*/t
ef4ead6d 1557 $to cpan/Archive-Tar/*
4ef422df 1558 $to cpan/Module-Metadata/*
421103b7
JR
1559 $to cpan/Term-Cap/test.pl
1560 $to cpan/Pod-Usage/*
1561 $to cpan/Pod-Parser/*
1562 $to cpan/IO-Compress/*
1563 $to cpan/HTTP-Tiny/lib/*
1564 $to cpan/Filter-Util-Call/filter-util.pl
1565 $to cpan/Digest-MD5/*
1566 $to cpan/Digest-SHA/*
1567 $to cpan/Test-Simple/*
1568 $to cpan/Pod-Parser/lib/*
1569 $to cpan/Test-Harness/*
1570 $to cpan/Scalar-List-Utils/*
1571 $to ext/IPC-Open3/*
1572 $to ext/Tie-Memoize/*
1573 $to ext/POSIX/*
1574 $to dist/IO/*
1575# --- These three are needed by ExtUtils::MM_Unix to verify PERL_CORE
1576 $to config_h.SH
1577 $to perl.h
1578 $to cflags
421103b7 1579 $to *.h
ef4ead6d
BF
1580# --- For t/porting/customized.t
1581 $to vutil.c
1582 $to vxs.inc
b83fd0ae
BF
1583# --- For t/TEST
1584 $to config.sh
421103b7
JR
1585# --- For lib/diagnostics.t with -Duseshrplib
1586 $to \$(PERL_EXE)
1587 cd t && (rm -f \$(PERL_EXE); \$(LNS) ../\$(PERL_EXE) \$(PERL_EXE)) && cd ..
1588 $to t/\$(PERL_EXE)
1589
1590!GROK!THIS!
1591;;
1592esac
1593
1594$spitshell >>$Makefile <<'!NO!SUBS!'
34b80e25 1595test_prep_reonly: $(MINIPERL_EXE) $(PERL_EXE) $(dynamic_ext_re) $(TEST_PERL_DLL)
63d47850 1596 $(MINIPERL) make_ext.pl $(dynamic_ext_re) MAKE="$(MAKE)" LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic
34b80e25 1597 cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE))
86bfbb31
JR
1598!NO!SUBS!
1599
1600case "$targethost" in
1601'') $spitshell >>$Makefile <<'!NO!SUBS!'
ec81ed5d 1602
937aca76 1603test check: test_prep
5fb77da4 1604 $(RUN_TESTS) choose
ec861bc1 1605
86bfbb31
JR
1606!NO!SUBS!
1607;;
1608*) $spitshell >>$Makefile <<!GROK!THIS!
1609
1610test check: test_prep
fa142983 1611 $run -cwd $targetdir/t -env "$targetenv LD_LIBRARY_PATH=$targetdir:$targetdir/lib:$targetdir/lib/auto:\$\$LD_LIBRARY_PATH" ./TEST
86bfbb31
JR
1612
1613!GROK!THIS!
1614;;
1615esac
1616
1617$spitshell >>$Makefile <<'!NO!SUBS!'
59c72abb 1618test_tty test-tty: test_prep
5fb77da4 1619 $(RUN_TESTS) tty
ec861bc1 1620
59c72abb 1621test_notty test-notty: test_prep
5fb77da4 1622 $(RUN_TESTS) no-tty
ec861bc1 1623
45ed6be3
JC
1624!NO!SUBS!
1625
1626case "${osname}${osvers}" in
09617314 1627linux*|darwin*)
45ed6be3 1628 $spitshell >>$Makefile <<'!NO!SUBS!'
7a834142
JH
1629# Targets for valgrind testing:
1630
9d4d67dd
NC
1631test.valgrind check.valgrind: test_prep
1632 @echo "Checking usemymalloc='n' in config.sh..."
1633 @grep "^usemymalloc=" config.sh
1634 @grep "^usemymalloc='n'" config.sh >/dev/null || exit 1
1635 @echo "And of course you have to have valgrind..."
1636 $(VALGRIND) $(VG_TEST) || exit 1
be075caf 1637 PERL_VALGRIND=1 VALGRIND='$(VALGRIND)' TESTFILE=harness $(RUN_TESTS) choose
45ed6be3
JC
1638!NO!SUBS!
1639 ;;
1640esac
1641
1642$spitshell >>$Makefile <<'!NO!SUBS!'
7a834142 1643
9438e34a 1644# minitest can't depend on lib/Config.pm because that might be where miniperl
344479a0 1645# is crashing.
9438e34a 1646minitest_prep:
8a71e97e 1647 -@test -f lib/Config.pm || $(MAKE) lib/Config.pm $(unidatafiles)
4fa3f26e 1648 @echo " "
d96ebe2e 1649 @echo "You may see some irrelevant test failures if you have been unable"
82dee7de 1650 @echo "to build lib/Config.pm, or the Unicode data files."
4fa3f26e 1651 @echo " "
9438e34a
JH
1652 - cd t && (rm -f $(PERL_EXE); $(LNS) ../$(MINIPERL_EXE) $(PERL_EXE))
1653
1654MINITEST_TESTS = base/*.t comp/*.t cmd/*.t run/*.t io/*.t re/*.t opbasic/*.t op/*.t uni/*.t perf/*.t
1655
1656minitest: $(MINIPERL_EXE) minitest_prep
1247ba6e 1657 - cd t && $(RUN_PERL) TEST $(MINITEST_TESTS) <$(devtty)
9438e34a
JH
1658
1659minitest-notty minitest_notty: $(MINIPERL_EXE) minitest_prep
1660 - cd t && PERL_SKIP_TTY_TEST=1 $(RUN_PERL) TEST $(MINITEST_TESTS)
16d20bd9 1661
1167a30e
IZ
1662# Test via harness
1663
59c72abb 1664test_harness test-harness: test_prep
5fb77da4 1665 TESTFILE=harness $(RUN_TESTS) choose
1167a30e 1666
69bfbd2f 1667test_harness_notty: test_prep
5fb77da4 1668 HARNESS_NOTTY=1 TESTFILE=harness $(RUN_TESTS) choose
69bfbd2f 1669
59c72abb 1670test_reonly test-reonly: test_prep_reonly
5fb77da4 1671 TEST_ARGS='-re \bre\/' TESTFILE=harness $(RUN_TESTS) choose
4979e288 1672
1e547844
JV
1673
1674# Porting tests (well-formedness of pod, manifest, etc)
1675
59c72abb 1676test_porting test-porting: test_prep
48d97dac 1677 cd t && $(RUN_PERL) harness porting/*.t ../lib/diagnostics.t
1e547844 1678
c0e3b4b5
TC
1679!NO!SUBS!
1680
1681$spitshell>>$Makefile <<!GROK!THIS!
1682
1683# intended as a common way to add dependencies to test-prep and all
1684common_build: $common_build_deps
1685
1686!GROK!THIS!
1687
1688$spitshell >>$Makefile <<'!NO!SUBS!'
1689
fb73857a 1690# Handy way to run perlbug -ok without having to install and run the
84902520 1691# installed perlbug. We don't re-run the tests here - we trust the user.
fb73857a 1692# Please *don't* use this unless all tests pass.
1d2dff63 1693# If you want to report test failures, use "make nok" instead.
869a466c
JH
1694
1695.PHONY: ok okfile oknack okfilenack nok nokfile noknack nokfilenack
1696
188cd53f 1697ok: utilities
9094a4e8 1698 $(RUN_PERL) utils/perlbug -ok -s '(UNINSTALLED)'
84902520 1699
105f9295 1700okfile: utilities
9094a4e8 1701 $(RUN_PERL) utils/perlbug -ok -s '(UNINSTALLED)' -F perl.ok
105f9295 1702
890b8eb0 1703oknack: utilities
9094a4e8 1704 $(RUN_PERL) utils/perlbug -ok -s '(UNINSTALLED)' -A
890b8eb0
NC
1705
1706okfilenack: utilities
9094a4e8 1707 $(RUN_PERL) utils/perlbug -ok -s '(UNINSTALLED)' -F perl.ok -A
890b8eb0 1708
1d2dff63 1709nok: utilities
9094a4e8 1710 $(RUN_PERL) utils/perlbug -nok -s '(UNINSTALLED)'
1d2dff63 1711
b4e8cfaf 1712nokfile: utilities
9094a4e8 1713 $(RUN_PERL) utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok
b4e8cfaf 1714
890b8eb0 1715noknack: utilities
9094a4e8 1716 $(RUN_PERL) utils/perlbug -nok -s '(UNINSTALLED)' -A
890b8eb0
NC
1717
1718nokfilenack: utilities
9094a4e8 1719 $(RUN_PERL) utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok -A
890b8eb0 1720
655e5c9e 1721.PHONY: clist hlist
869a466c 1722
85e6fe83 1723clist: $(c)
92c28edd 1724 echo $(c) | tr ' ' $(TRNL) >.clist
2304df62 1725
85e6fe83 1726hlist: $(h)
92c28edd 1727 echo $(h) | tr ' ' $(TRNL) >.hlist
2304df62 1728
869a466c 1729.PHONY: distcheck
599a829f 1730distcheck: FORCE
760ac839
LW
1731 perl '-MExtUtils::Manifest=&fullcheck' -e 'fullcheck()'
1732
dde299c1 1733.PHONY: ctags
3ee700d1 1734
e8d46ec9
RU
1735TAGS: $(c1) $(c2) $(c3) $(c4) $(c5) $(h)
1736 etags $(c1) $(c2) $(c3) $(c4) $(c5) $(h)
1737
5c36f626 1738ctags:
bf799c64 1739 ctags -f Tags -N --totals --languages=c --langmap=c:+.h --exclude=opmini.c --exclude=perlmini.c *.c *.h
5c36f626 1740
2304df62
AD
1741# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
1742# If this runs make out of memory, delete /usr/include lines.
1743!NO!SUBS!
1744
85e6fe83 1745$eunicefix Makefile
cd4d8a96 1746$rm -f $firstmakefile
5ff3f7a4
GS
1747
1748# Now do any special processing required before building.
1749
1750case "$ebcdic" in
2d340b60 1751define)
5ff3f7a4 1752 xxx=''
2d340b60 1753 echo "This is an EBCDIC system, checking if any parser files need regenerating." >&2
7a66b286 1754case "$osname" in
25e9a2e3 1755os390|posix-bc)
7a66b286 1756 ;;
aa34f189 1757*)
e9d08790 1758 echo "'$osname' is an EBCDIC system I don't know that well." >&4
aa34f189 1759 ;;
fe572743 1760esac
5ff3f7a4
GS
1761 case "$xxx" in
1762 '') echo "No parser files were regenerated. That's okay." >&2 ;;
1763 esac
1764 ;;
1765esac
1766
075abff3 1767# ex: set ts=8 sts=4 sw=4 noet: