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