3 case $PERL_CONFIG_SH in
8 echo "Can't find config.sh."; exit 1
19 # if cross-compilation, the Makefile named accordingly
20 Makefile=Makefile-cross-$CROSS_NAME
21 . Cross/config-${CROSS_NAME}.sh
25 : This forces SH files to create target in same directory as SH file.
26 : This is so that make depend always knows where to find SH derivatives.
28 */*) cd `expr X$0 : 'X\(.*\)/'` ;;
31 linklibperl='$(LIBPERL)'
33 shrpldflags='$(LDDLFLAGS)'
35 DPERL_EXTERNAL_GLOB='-DPERL_EXTERNAL_GLOB'
36 DPERL_IS_MINIPERL='-DPERL_IS_MINIPERL'
39 # Prefix all runs of 'miniperl' and 'perl' with
40 # $ldlibpth so that ./perl finds *this* shared libperl.
41 case "$LD_LIBRARY_PATH" in
43 ldlibpth="LD_LIBRARY_PATH=`pwd`";;
45 ldlibpth="LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}";;
48 pldlflags="$cccdlflags"
50 case "${osname}${osvers}" in
53 lddlflags="-dynamic -undefined warning -framework System \
54 -compatibility_version 1 -current_version $patchlevel \
55 -prebind -seg1addr 0x27000000 -install_name \$(shrpdir)/\$@"
58 shrpldflags="${ldflags} -dynamiclib \
59 -compatibility_version \
60 ${api_revision}.${api_version}.${api_subversion} \
62 ${revision}.${patchlevel}.${subversion} \
63 -install_name \$(shrpdir)/\$@"
66 shrpldflags="$shrpldflags -Wl,--out-implib=libperl.dll.a -Wl,--image-base,0x52000000"
67 linklibperl="-L. -lperl"
72 netbsd*|freebsd[234]*|openbsd*|dragonfly*)
73 linklibperl="-L. -lperl"
76 linklibperl="-L. -lperl"
77 shrpldflags="$shrpldflags -Wl,--image-base,0x57000000"
82 shrpldflags="-shared -Wl,-H512 -Wl,-T512 -Wl,-bhalt:4 -Wl,-bM:SRE -Wl,-bE:perl.exp"
84 3*) shrpldflags="$shrpldflags -e _nostart"
86 *) shrpldflags="$shrpldflags -Wl,-bnoentry"
89 shrpldflags="$shrpldflags $ldflags $perllibs $cryptlib"
90 linklibperl="-L $archlibexp/CORE -L `pwd | sed 's/\/UU$//'` -lperl"
91 linklibperl_nonshr='-lperl_nonshr'
94 shrpldflags="-H512 -T512 -bhalt:4 -bM:SRE -bE:perl.exp"
96 3*) shrpldflags="$shrpldflags -e _nostart"
98 *) shrpldflags="$shrpldflags -b noentry"
101 shrpldflags="$shrpldflags $ldflags $perllibs $cryptlib"
102 linklibperl="-L $archlibexp/CORE -L `pwd | sed 's/\/UU$//'` -lperl"
103 linklibperl_nonshr='-lperl_nonshr'
108 linklibperl="-L `pwd | sed 's/\/UU$//'` -Wl,+s -Wl,+b$archlibexp/CORE -lperl"
111 shrpldflags='-W l,XPLINK,dll'
112 linklibperl='libperl.x'
113 DPERL_EXTERNAL_GLOB=''
116 case "$ldlibpthname" in
124 eval "ldlibpth=\"$ldlibpthname=`pwd`:\$$ldlibpthname\""
127 # Strip off any trailing :'s
128 ldlibpth=`echo $ldlibpth | sed 's/:*$//'`
134 *" "*) ldlibpth=`echo $ldlibpth|sed 's/ /\\\\ /g'` ;;
139 # If there is a pre-existing $libperl from a previous
140 # installation, Linux needs to use LD_PRELOAD to
141 # override the LD_LIBRARY_PATH setting. See the
142 # INSTALL file, under "Building a shared perl library".
143 # If there is no pre-existing $libperl, we don't need
144 # to do anything further.
145 if test -f $archlib/CORE/$libperl; then
147 cat <<'EOT' > preload
151 test -r $lib && export LD_PRELOAD="$lib $LD_PRELOAD"
155 ldlibpth="$ldlibpth `pwd`/preload `pwd`/$libperl"
158 os390) test -f /bin/env && ldlibpth="/bin/env $ldlibpth"
165 static_ldflags='CCCDLFLAGS='
169 : is Cwd static or dynamic
171 list_util_dep='$(PERL_EXE)'
172 for f in $dynamic_ext; do
174 Cwd) static_cwd='undef' ;;
175 List/Util) list_util_dep=lib/auto/List/Util/Util.$dlext
179 : Prepare dependency lists for Makefile.
181 dynamic_ext_re="lib/auto/re/re.$dlext"
183 ext/Pod-Functions/pm_to_blib: cpan/Pod-Simple/pm_to_blib cpan/Pod-Escapes/pm_to_blib pod/perlfunc.pod
185 for f in $dynamic_ext; do
186 : the dependency named here will never exist
187 base=`echo "$f" | sed 's/.*\///'`
188 this_target="lib/auto/$f/$base.$dlext"
189 dynamic_list="$dynamic_list $this_target"
191 : Parallel makes reveal that we have some interdependencies
193 Math/BigInt/FastCalc|Devel/NYTProf) extra_dep="$extra_dep
194 $this_target: $list_util_dep" ;;
195 Unicode/Normalize) extra_dep="$extra_dep
196 $this_target: uni.data" ;;
201 for f in $static_ext; do
202 base=`echo "$f" | sed 's/.*\///'`
203 static_list="$static_list lib/auto/$f/$base\$(LIB_EXT)"
204 : Parallel makes reveal that we have some interdependencies
205 this_target="lib/auto/$f/$base\$(LIB_EXT)"
207 Math/BigInt/FastCalc|Devel/NYTProf) extra_dep="$extra_dep
208 $this_target: lib/auto/List/Util/Util\$(LIB_EXT)" ;;
209 Unicode/Normalize) extra_dep="$extra_dep
210 $this_target: uni.data" ;;
215 for f in $nonxs_ext; do
216 p=`echo "$f" | tr / -`
217 for d in ext dist cpan; do
218 if test -d $d/$p; then
219 nonxs_list="$nonxs_list $d/$p/pm_to_blib"
229 dtrace_h='perldtrace.h'
230 $dtrace -G -s perldtrace.d -o perldtrace.tmp >/dev/null 2>&1 \
231 && rm -f perldtrace.tmp && dtrace_o='perldtrace$(OBJ_EXT)' \
232 && minidtrace_o='miniperldtrace$(OBJ_EXT)'
236 echo "Extracting $Makefile (with variable substitutions)"
237 $spitshell >$Makefile <<!GROK!THIS!
239 # This file is derived from Makefile.SH. Any changes made here will
240 # be lost the next time you run Configure.
241 # Makefile is used to generate $firstmakefile. The only difference
242 # is that $firstmakefile has the dependencies filled in at the end.
250 mallocsrc = $mallocsrc
251 mallocobj = $mallocobj
255 # NOTE: some systems don't grok "cp -f". XXX Configure test needed?
260 # The following are mentioned only to make metaconfig include the
261 # appropriate questions in Configure. If you want to change these,
262 # edit config.sh instead, or specify --man1dir=/wherever on
263 # installman commandline.
265 scriptdir = $scriptdir
266 shrpdir = $archlibexp/CORE
267 privlib = $installprivlib
273 # The following are used to build and install shared libraries for
275 LDDLFLAGS = $lddlflags
276 SHRPLDFLAGS = $shrpldflags
277 CCDLFLAGS = $ccdlflags
279 PLDLFLAGS = $pldlflags
281 LLIBPERL= $linklibperl
282 LLIBPERL_NONSHR= $linklibperl_nonshr
285 # Static targets are ordinarily built without CCCDLFLAGS. However,
286 # if building a shared libperl.so that might later be linked into
287 # another application, then it might be appropriate to also build static
288 # extensions (usually just DynaLoader) with relocatable code (e.g. -fPIC
290 STATIC_LDFLAGS = $static_ldflags
292 # The following is used to include the current directory in
293 # the dynamic loader path you are building a shared libperl.
296 # Sometimes running an executable is an adventure.
299 # These variables may need to be manually set for non-Unix systems.
307 # Macros to invoke a copy of miniperl during the build. Targets which
308 # are built using these macros should depend on \$(MINIPERL_EXE)
309 MINIPERL_EXE = miniperl\$(EXE_EXT)
310 MINIPERL = \$(LDLIBPTH) \$(RUN) ./miniperl\$(EXE_EXT) -Ilib
312 # Macros to invoke a copy of our fully operational perl during the build.
313 PERL_EXE = perl\$(EXE_EXT)
314 RUN_PERL = \$(LDLIBPTH) \$(RUN) ./perl\$(EXE_EXT)
316 # Macros to run our tests
317 RUN_TESTS = \$(LDLIBPTH) ./runtests
319 dynamic_ext = $dynamic_list
320 dynamic_ext_re = $dynamic_ext_re
321 static_ext = $static_list
322 nonxs_ext = $nonxs_list
323 ext = \$(dynamic_ext) \$(static_ext) \$(nonxs_ext)
324 DYNALOADER = DynaLoader\$(OBJ_EXT)
326 libs = $perllibs $cryptlib
328 public = \$(PERL_EXE) utilities translators
330 shellflags = $shellflags
332 # This is set to MAKE=$make if your $make command doesn't
336 # Mention $gmake here so it gets probed for by Configure.
342 $spitshell >>$Makefile <<!GROK!THIS!
343 # If you're going to use valgrind and it can't be invoked as plain valgrind
344 # then you'll need to change this, or override it on the make command line.
346 VG_TEST ?= ./perl -e 1 2>/dev/null
352 $spitshell >>$Makefile <<!GROK!THIS!
356 MINIDTRACE_O = $minidtrace_o
358 FIRSTMAKEFILE = $firstmakefile
360 # Any special object files needed by this architecture, e.g. os2/os2.obj
363 .SUFFIXES: .c \$(OBJ_EXT) .i .s
368 # how to tr(anslate) newlines
375 INSTALLPREFIXEXP = $prefix
378 # not used by Makefile but by installperl;
379 # mentioned here so that metaconfig picks these up
383 case "${osname}:${osvers}" in
385 $spitshell >>$Makefile <<EOF
387 # Your locales are broken (osname $osname, osvers $osvers)
388 # and to avoid the numerous
389 # perl: warning: Setting locale failed.
390 # warnings during the build process we reset the locale variables.
401 ## In the following dollars and backticks do not need the extra backslash.
402 $spitshell >>$Makefile <<'!NO!SUBS!'
404 CCCMD = `sh $(shellflags) cflags "optimize='$(OPTIMIZE)'" $@`
406 CCCMDSRC = `sh $(shellflags) cflags "optimize='$(OPTIMIZE)'" $<`
408 CONFIGPM_FROM_CONFIG_SH = lib/Config.pm lib/Config_heavy.pl
409 CONFIGPM = $(CONFIGPM_FROM_CONFIG_SH) lib/Config_git.pl
411 CONFIGPOD = lib/Config.pod
417 # if cross-compilation
418 $spitshell >>$Makefile <<!GROK!THIS!
419 CROSS_NAME = $CROSS_NAME
420 CROSS_LIB = xlib/$CROSS_NAME
422 CCCMD = \`sh \$(shellflags) cflags-cross-$CROSS_NAME "optimize='\$(OPTIMIZE)'" \$@\` -I\$(CROSS_LIB)
423 CCCMDSRC = \`sh \$(shellflags) cflags-cross-$CROSS_NAME "optimize='\$(OPTIMIZE)'" \$<\` -I\$(CROSS_LIB)
424 CONFIGPM = xlib/\$(CROSS_NAME)/Config.pm
425 CONFIGPOD = xlib/\$(CROSS_NAME)/Config.pod
428 xconfig.h: config_h.SH Cross/config-\$(CROSS_NAME).sh
429 CONFIG_SH=Cross/config-\$(CROSS_NAME).sh CONFIG_H=xconfig.h \$(SHELL) config_h.SH
430 #TODO \$(LDLIBPTH) ./miniperl$(EXE_EXT) -Ilib -MCross=\$(CROSS_NAME) config_h.PL "INST_VER=\$(INST_VER)" "CORE_DIR=\$(CROSS_LIB)" "CONFIG_H=xconfig.h"
431 cp xconfig.h \$(CROSS_LIB)/
432 cp xconfig.h \$(CROSS_LIB)/config.h
438 ## In the following dollars and backticks do not need the extra backslash.
439 $spitshell >>$Makefile <<'!NO!SUBS!'
441 private = preplibrary $(CONFIGPM) $(CONFIGPOD) lib/ExtUtils/Miniperl.pm git_version.h lib/buildcustomize.pl
443 # Files to be built with variable substitution before miniperl
445 sh = Makefile.SH cflags.SH config_h.SH makedepend.SH myconfig.SH pod/Makefile.SH
447 shextract = Makefile cflags config.h makedepend makedir myconfig pod/Makefile
449 addedbyconf = UU $(shextract) pstruct
451 # Unicode data files generated by mktables
452 unidatafiles = lib/unicore/Decomposition.pl lib/unicore/TestProp.pl \
453 lib/unicore/CombiningClass.pl lib/unicore/Name.pl \
454 lib/unicore/UCD.pl lib/unicore/Name.pm \
455 lib/unicore/Heavy.pl lib/unicore/mktables.lst
457 # Directories of Unicode data files generated by mktables
458 unidatadirs = lib/unicore/To lib/unicore/lib
460 h1 = EXTERN.h INTERN.h XSUB.h av.h $(CONFIGH) cop.h cv.h dosish.h
461 h2 = embed.h form.h gv.h handy.h hv.h keywords.h mg.h op.h opcode.h
462 h3 = pad.h patchlevel.h perl.h perlapi.h perly.h pp.h proto.h regcomp.h
463 h4 = regexp.h scope.h sv.h unixish.h util.h iperlsys.h thread.h
464 h5 = utf8.h warnings.h mydtrace.h op_reg_common.h l1_char_class_tab.h
465 h6 = charclass_invlists.h
466 h = $(h1) $(h2) $(h3) $(h4) $(h5) $(h6)
468 c1 = av.c scope.c op.c doop.c doio.c dump.c gv.c hv.c mg.c reentr.c mro.c perl.c
469 c2 = perly.c pp.c pp_hot.c pp_ctl.c pp_sys.c regcomp.c regexec.c utf8.c sv.c
470 c3 = taint.c toke.c util.c deb.c run.c universal.c pad.c globals.c keywords.c
471 c4 = perlio.c perlapi.c numeric.c mathoms.c locale.c pp_pack.c pp_sort.c
472 c5 = $(madlysrc) $(mallocsrc)
474 c = $(c1) $(c2) $(c3) $(c4) $(c5) miniperlmain.c opmini.c perlmini.c
476 obj0 = op$(OBJ_EXT) perl$(OBJ_EXT)
477 obj0mini = perlmini$(OBJ_EXT) opmini$(OBJ_EXT) miniperlmain$(OBJ_EXT)
478 obj1 = $(madlyobj) $(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$(OBJ_EXT) keywords$(OBJ_EXT)
479 obj2 = 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)
480 obj3 = 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)
482 minindt_obj = $(obj0mini) $(obj1) $(obj2) $(obj3) $(ARCHOBJS)
483 mini_obj = $(minindt_obj) $(MINIDTRACE_O)
484 ndt_obj = $(obj0) $(obj1) $(obj2) $(obj3) $(ARCHOBJS)
485 obj = $(ndt_obj) $(DTRACE_O)
487 perltoc_pod_prereqs = extra.pods pod/perl5176delta.pod pod/perlapi.pod pod/perlintern.pod pod/perlmodlib.pod pod/perluniprops.pod
488 generated_pods = pod/perltoc.pod $(perltoc_pod_prereqs)
489 generated_headers = uudmap.h bitcount.h mg_data.h
491 Icwd = -Idist/Cwd -Idist/Cwd/lib -Idist/Carp/lib
499 -errchk=parentheses \
503 -erroff=E_ASSIGN_NARROW_CONV \
504 -erroff=E_BAD_PTR_CAST \
505 -erroff=E_BAD_PTR_CAST_ALIGN \
506 -erroff=E_BAD_PTR_INT_COMBINATION \
507 -erroff=E_BAD_SIGN_EXTEND \
508 -erroff=E_BLOCK_DECL_UNUSED \
509 -erroff=E_CASE_FALLTHRU \
510 -erroff=E_CONST_EXPR \
511 -erroff=E_CONSTANT_CONDITION \
512 -erroff=E_END_OF_LOOP_CODE_NOT_REACHED \
513 -erroff=E_EQUALITY_NOT_ASSIGNMENT \
514 -erroff=E_EXPR_NULL_EFFECT \
515 -erroff=E_FALSE_LOGICAL_EXPR \
516 -erroff=E_INCL_NUSD \
517 -erroff=E_LOOP_EMPTY \
518 -erroff=E_MAIN_PARAM \
519 -erroff=E_POINTER_TO_OBJECT \
520 -erroff=E_PTRDIFF_OVERFLOW \
521 -erroff=E_SHIFT_CNT_NEG_TOO_BIG_L \
522 -erroff=E_STATIC_UNUSED \
523 -erroff=E_TRUE_LOGICAL_EXPR
526 -I/usr/lib/gcc/i486-linux-gnu/4.0.2/include/ \
527 -D__builtin_va_list=va_list \
528 -Dsigjmp_buf=jmp_buf \
552 $(CCCMD) $(PLDLFLAGS) $*.c
555 $(CCCMDSRC) -E $*.c > $*.i
560 all: $(FIRSTMAKEFILE) $(MINIPERL_EXE) $(generated_pods) $(private) $(unidatafiles) $(public) $(dynamic_ext) $(nonxs_ext) extras.make
562 @echo " Everything is up to date. Type '$(MAKE) test' to run test suite."
564 .PHONY: all translators utilities
566 # Both git_version.h and lib/Config_git.pl are built
567 # by make_patchnum.pl.
568 git_version.h: lib/Config_git.pl
570 lib/Config_git.pl: $(MINIPERL_EXE) make_patchnum.pl
571 $(MINIPERL) make_patchnum.pl
573 # make sure that we recompile perl.c if the git version changes
574 perl$(OBJ_EXT): git_version.h
578 # Making utilities and translators require Cwd. If we have dynamic
579 # loading, we only need miniperl and Cwd.$dlext. If we have static
580 # loading, we need to build perl first.
581 case "$usedl$static_cwd" in
583 util_deps='$(MINIPERL_EXE) $(CONFIGPM) lib/auto/Cwd/Cwd$(DLSUFFIX) FORCE'
584 x2p_deps='$(MINIPERL_EXE) $(CONFIGPM) $(dynamic_ext) FORCE'
587 util_deps='$(PERL_EXE) $(CONFIGPM) FORCE'
588 x2p_deps='$(PERL_EXE) $(CONFIGPM) $(dynamic_ext) FORCE'
590 *) util_deps='$(PERL_EXE) $(CONFIGPM) FORCE'
591 x2p_deps='$(PERL_EXE) $(CONFIGPM) FORCE'
595 $spitshell >>$Makefile <<!GROK!THIS!
596 translators: $x2p_deps
597 @echo " "; echo " Making x2p stuff"; cd x2p; \$(LDLIBPTH) \$(MAKE) all
600 cd x2p; \$(LDLIBPTH) \$(MAKE) s2p
602 x2p/find2perl: $x2p_deps
603 cd x2p; \$(LDLIBPTH) \$(MAKE) find2perl
605 utilities: $util_deps
606 @echo " "; echo " Making utilities"; cd utils; \$(LDLIBPTH) \$(MAKE) all
610 $spitshell >>$Makefile <<'!NO!SUBS!'
612 # This is now done by installman only if you actually want the man pages.
613 # @echo " "; echo " Making docs"; cd pod; $(MAKE) all;
615 # Phony target to force checking subdirectories.
616 # Apparently some makes require an action for the FORCE target.
622 for file in op perl; do
623 if $issymlink $file.c; then
624 $spitshell >>$Makefile <<!GROK!THIS!
626 # We do a copy of the $file.c instead of a symlink because gcc gets huffy
627 # if we have a symlink forest to another disk (it complains about too many
628 # levels of symbolic links, even if we have only two)
630 ${file}mini.c: $file.c
631 \$(RMS) ${file}mini.c
632 \$(CPS) ${file}.c ${file}mini.c
635 $spitshell >>$Makefile <<!GROK!THIS!
637 ${file}mini.c: $file.c
638 \$(RMS) ${file}mini.c
639 \$(LNS) ${file}.c ${file}mini.c
643 $spitshell >>$Makefile <<!GROK!THIS!
645 ${file}mini\$(OBJ_EXT): ${file}mini.c
646 \$(CCCMD) \$(PLDLFLAGS) $DPERL_IS_MINIPERL $DPERL_EXTERNAL_GLOB ${file}mini.c
650 $spitshell >>$Makefile <<'!NO!SUBS!'
652 globals$(OBJ_EXT): $(generated_headers)
654 uudmap.h mg_data.h: bitcount.h
656 bitcount.h: generate_uudmap$(HOST_EXE_EXT)
657 $(RUN) ./generate_uudmap$(HOST_EXE_EXT) $(generated_headers)
659 generate_uudmap$(OBJ_EXT): mg_raw.h
661 generate_uudmap$(HOST_EXE_EXT): generate_uudmap$(OBJ_EXT)
662 $(CC) -o generate_uudmap$(EXE_EXT) $(LDFLAGS) generate_uudmap$(OBJ_EXT) $(libs)
664 miniperlmain$(OBJ_EXT): miniperlmain.c patchlevel.h
665 $(CCCMD) $(PLDLFLAGS) $*.c
667 perlmain.c: $(MINIPERL_EXE) lib/ExtUtils/Miniperl.pm
668 $(MINIPERL) -Ilib -MExtUtils::Miniperl -e 'writemain(@ARGV)' DynaLoader $(static_ext) > perlmain.c
670 perlmain$(OBJ_EXT): perlmain.c
671 $(CCCMD) $(PLDLFLAGS) $*.c
673 # The file ext.libs is a list of libraries that must be linked in
674 # for static extensions, e.g. -lm -lgdbm, etc. The individual
675 # static extension Makefile's add to it.
676 ext.libs: $(static_ext)
677 -@test -f ext.libs || touch ext.libs
681 # How to build libperl. This is still rather convoluted.
682 # Load up custom Makefile.SH fragment for shared loading and executables:
685 Makefile_s="$osname/Makefile.SHs"
691 $spitshell >>$Makefile <<!GROK!THIS!
693 # In AIX we need to change this for building Perl itself from
694 # its earlier definition (which is for building external
695 # extensions *after* Perl has been built and installed)
696 CCDLFLAGS = `echo $ccdlflags|sed -e 's@-bE:.*/perl\.exp@-bE:perl.exp@'`
699 case "$useshrplib" in
701 $spitshell >>$Makefile <<'!NO!SUBS!'
703 LIBPERL_NONSHR = libperl_nonshr$(LIB_EXT)
704 MINIPERL_NONSHR = miniperl_nonshr$(EXE_EXT)
706 $(LIBPERL_NONSHR): $(obj)
707 $(RMS) $(LIBPERL_NONSHR)
708 $(AR) rcu $(LIBPERL_NONSHR) $(obj)
710 $(MINIPERL_NONSHR): $(LIBPERL_NONSHR) miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perlmini$(OBJ_EXT)
711 $(CC) $(LDFLAGS) -o $(MINIPERL_NONSHR) miniperlmain$(OBJ_EXT) \
712 opmini$(OBJ_EXT) perlmini$(OBJ_EXT) $(LIBPERL_NONSHR) $(LIBS)
714 MINIPERLEXP = $(MINIPERL_NONSHR)
716 LIBPERLEXPORT = perl.exp
722 $spitshell >>$Makefile <<'!NO!SUBS!'
723 MINIPERLEXP = $(MINIPERL_EXE)
725 PERLEXPORT = perl.exp
730 $spitshell >>$Makefile <<'!NO!SUBS!'
731 perl.exp: $(MINIPERLEXP) makedef.pl $(CONFIGPM) $(SYM) $(SYMH)
732 ./$(MINIPERLEXP) makedef.pl --sort-fold PLATFORM=aix CC_FLAGS="$(OPTIMIZE)" > perl.exp
737 $spitshell >>$Makefile <<'!NO!SUBS!'
738 MINIPERLEXP = miniperl
740 perl5.def: $(MINIPERLEXP) makedef.pl $(CONFIGPM) $(SYM) $(SYMH) miniperl.map
741 ./$(MINIPERLEXP) makedef.pl PLATFORM=os2 -DPERL_DLL=$(PERL_DLL) CC_FLAGS="$(OPTIMIZE)" > perl5.def
746 $spitshell >>$Makefile <<'!NO!SUBS!'
747 cygwin.c: cygwin/cygwin.c
748 $(LNS) cygwin/cygwin.c
750 LIBPERL_NONSHR = libperl$(LIB_EXT)
752 $(LIBPERL_NONSHR): $(obj)
753 $(RMS) $(LIBPERL_NONSHR)
754 $(AR) rcu $(LIBPERL_NONSHR) $(obj)
760 if test -s $Makefile_s ; then
762 $spitshell >>$Makefile <<!GROK!THIS!
764 Makefile: $Makefile_s
769 $spitshell >>$Makefile <<'!NO!SUBS!'
770 # dtrace dicards const qualifiers from arguments, put them back
771 $(DTRACE_H): perldtrace.d
772 $(DTRACE) -h -s perldtrace.d -o $(DTRACE_H).in
773 sed -e '/const/!s/char \*/const char */g' $(DTRACE_H).in >$(DTRACE_H)
774 $(RMS) $(DTRACE_H).in
776 mydtrace.h: $(DTRACE_H)
783 $spitshell >>$Makefile <<'!NO!SUBS!'
784 $(DTRACE_O): perldtrace.d $(ndt_obj)
785 $(DTRACE) -G -s perldtrace.d -o $(DTRACE_O) $(ndt_obj)
787 $(MINIDTRACE_O): perldtrace.d $(minindt_obj) perlmini$(OBJ_EXT)
788 $(DTRACE) -G -s perldtrace.d -o $(MINIDTRACE_O) $(minindt_obj) perlmini$(OBJ_EXT)
793 $spitshell >>$Makefile <<'!NO!SUBS!'
794 $(LIBPERL): $& $(obj) $(DYNALOADER) $(LIBPERLEXPORT)
796 case "$useshrplib" in
798 $spitshell >>$Makefile <<'!NO!SUBS!'
800 $(LD) -o $@ $(SHRPLDFLAGS) $(obj) $(DYNALOADER) $(libs)
804 $spitshell >>$Makefile <<'!NO!SUBS!'
805 rm -f libperl$(OBJ_EXT)
806 mv $@ libperl$(OBJ_EXT)
807 $(AR) qv $(LIBPERL) libperl$(OBJ_EXT)
813 $spitshell >>$Makefile <<'!NO!SUBS!'
815 $(AR) rcu $(LIBPERL) $(obj) $(DYNALOADER)
816 @$(ranlib) $(LIBPERL)
820 $spitshell >>$Makefile <<'!NO!SUBS!'
822 # How to build executables.
824 # The $& notation tells Sequent machines that it can do a parallel make,
825 # and is harmless otherwise.
826 # The miniperl -w -MExporter line is a basic cheap test to catch errors
827 # before make goes on to run preplibrary and then MakeMaker on extensions.
828 # This is very handy because later errors are often caused by miniperl
829 # build problems but that's not obvious to the novice.
830 # The Module used here must not depend on Config or any extensions.
834 case "${osname}${osvers}" in
836 $spitshell >>$Makefile <<'!NO!SUBS!'
837 $(MINIPERL_EXE): $& $(mini_obj)
838 $(CC) -o $(MINIPERL_EXE) $(CLDFLAGS) $(mini_obj) $(libs)
839 $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
843 $spitshell >>$Makefile <<'!NO!SUBS!'
844 $(MINIPERL_EXE): $& $(mini_obj)
845 $(CC) -o $(MINIPERL_EXE) $(mini_obj) $(libs)
846 $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
852 *) case "$ldflags" in
853 *"-flat_namespace"*) ;;
854 *) # to allow opmini.o to override stuff in libperl.dylib
855 $spitshell >>$Makefile <<!NO!SUBS!
856 NAMESPACEFLAGS = -force_flat_namespace
862 $spitshell >>$Makefile <<'!NO!SUBS!'
863 $(MINIPERL_EXE): $& $(mini_obj)
865 $(CC) $(CLDFLAGS) $(NAMESPACEFLAGS) -o $(MINIPERL_EXE) \
867 $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
871 $spitshell >>$Makefile <<'!NO!SUBS!'
872 $(MINIPERL_EXE): $& $(mini_obj)
874 $(LDLIBPTH) $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
876 $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
881 $spitshell >>$Makefile <<'!NO!SUBS!'
883 $(PERL_EXE): $& perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT)
885 $(SHRPENV) $(LDLIBPTH) $(CC) -o perl$(PERL_SUFFIX) $(PERL_PROFILE_LDFLAGS) $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
887 # Purify/Quantify Perls.
889 pure$(PERL_EXE): $& perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT)
890 $(SHRPENV) $(LDLIBPTH) purify $(CC) -o pureperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
892 purecov$(PERL_EXE): $& perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT)
893 $(SHRPENV) $(LDLIBPTH) purecov $(CC) -o purecovperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
895 quant$(PERL_EXE): $& perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT)
896 $(SHRPENV) $(LDLIBPTH) quantify $(CC) -o quantperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
900 case "${osname}${osvers}" in
902 $spitshell >>$Makefile <<'!NO!SUBS!'
903 # Valgrind perl (currently Linux, Darwin only)
905 perl.valgrind.config: config.sh
906 @echo "To build perl.valgrind you must Configure -Doptimize=-g -Uusemymalloc, checking..."
907 @$(MAKE) perl.config.dashg
908 @echo "Checking usemymalloc='n' in config.sh..."
909 @grep "^usemymalloc=" config.sh
910 @grep "^usemymalloc='n'" config.sh >/dev/null || exit 1
911 @echo "And of course you have to have valgrind..."
912 $(VALGRIND) $(VG_TEST) || exit 1
917 $spitshell >>$Makefile <<'!NO!SUBS!'
919 # Third Degree Perl (Tru64 only)
922 @echo "Checking optimize='-g' in config.sh..."
923 @grep "^optimize=" config.sh
924 @egrep "^optimize='(.*-g.*)'" config.sh >/dev/null || exit 1
926 perl.third.config: config.sh
927 @echo "To build perl.third you must Configure -Doptimize=-g -Uusemymalloc, checking..."
928 @$(MAKE) perl.config.dashg
929 @echo "Checking usemymalloc='n' in config.sh..."
930 @grep "^usemymalloc=" config.sh
931 @grep "^usemymalloc='n'" config.sh >/dev/null || exit 1
933 perl.third: /usr/bin/atom perl.third.config perl
934 atom -tool third -L. -all -gp -toolargs="-invalid -uninit heap+stack+copy -min 0" perl
935 @echo "Now you may run perl.third and then study perl.3log."
937 # Pixie Perls (Tru64 and IRIX only)
939 perl.pixie.config: config.sh
940 @echo "To build perl.pixie you must Configure -Doptimize=-g, checking..."
941 @$(MAKE) perl.config.dashg
943 perl.pixie.atom: /usr/bin/atom perl
944 atom -tool pixie -L. -all -toolargs="-quiet" perl
946 perl.pixie.irix: perl
949 perl.pixie: /usr/bin/pixie perl.pixie.config perl
950 if test -x /usr/bin/atom; then \
951 $(MAKE) perl.pixie.atom; \
953 $(MAKE) perl.pixie.irix; \
955 @echo "Now you may run perl.pixie and then run pixie."
960 @echo "Checking optimize='-pg' in config.sh..."
961 @grep "^optimize=" config.sh
962 @grep "^optimize='.*-pg.*'" config.sh >/dev/null || exit 1
964 perl.gprof.config: config.sh
965 @echo "To build perl.gprof you must Configure -Doptimize=-pg, checking..."
966 @$(MAKE) perl.config.dashpg
968 perl.gprof: /usr/bin/gprof perl.gprof.config
970 $(MAKE) PERL_SUFFIX=.gprof PERL_PROFILE_LDFLAGS=-pg perl
971 @echo "Now you may run perl.gprof and then run gprof perl.gprof."
976 @echo "To build perl.gcov you must use gcc 3.0 or newer, checking..."
977 @echo "Checking gccversion in config.sh..."
978 @grep "^gccversion=" config.sh
979 @grep "^gccversion='[3-9]\." config.sh >/dev/null || exit 1
980 @echo "To build perl.gcov you must Configure -Dccflags=-fprofile-arcs -ftest-coverage, checking..."
981 @echo "Checking ccflags='-fprofile-arcs -ftest-coverage' in config.sh..."
982 @grep "^ccflags=" config.sh
983 @grep "^ccflags='.*-fprofile-arcs -ftest-coverage.*'" config.sh >/dev/null || exit 1
985 perl.gcov: perl.config.gcov
987 $(MAKE) PERL_SUFFIX=.gcov PERL_PROFILE_LDFLAGS='' perl
988 @echo "Now you may run perl.gcov and then run gcov some.c."
990 # Microperl. This is just a convenience thing if one happens to
991 # build also the full Perl and therefore the real big Makefile:
992 # usually one should manually explicitly issue the below command.
996 $(MAKE) -f Makefile.micro
1002 # Some environment have no system(), which mkpport uses.
1003 # Let's try running the commands with shell.
1006 $spitshell >>$Makefile <<!GROK!THIS!
1008 makeppport: \$(MINIPERL_EXE) \$(CONFIGPM)
1009 -@for f in Makefile.PL PPPort_pm.PL PPPort_xs.PL ppport_h.PL; do \
1010 (cd ext/Devel-PPPort && `pwd`/run.sh ../../$(MINIPERL_EXE) -I../../lib \$\$f); \
1016 $spitshell >>$Makefile <<'!NO!SUBS!'
1018 makeppport: $(MINIPERL_EXE) $(CONFIGPM) $(nonxs_ext)
1019 $(MINIPERL) $(Icwd) mkppport
1025 $spitshell >>$Makefile <<'!NO!SUBS!'
1028 preplibrary: $(MINIPERL_EXE) $(CONFIGPM) $(PREPLIBRARY_LIBPERL)
1030 $(CONFIGPM_FROM_CONFIG_SH): $(CONFIGPOD)
1032 $(CONFIGPOD): config.sh $(MINIPERL_EXE) configpm Porting/Glossary lib/Config_git.pl
1033 $(MINIPERL) configpm
1035 lib/ExtUtils/Miniperl.pm: miniperlmain.c $(MINIPERL_EXE) minimod.pl $(CONFIGPM)
1036 $(MINIPERL) minimod.pl > lib/ExtUtils/Miniperl.pm
1038 lib/buildcustomize.pl: $(MINIPERL_EXE) write_buildcustomize.pl
1039 $(MINIPERL) write_buildcustomize.pl >lib/buildcustomize.pl
1041 unidatafiles $(unidatafiles) pod/perluniprops.pod: uni.data
1043 uni.data: $(MINIPERL_EXE) $(CONFIGPM) lib/unicore/mktables $(nonxs_ext)
1044 $(MINIPERL) $(Icwd) lib/unicore/mktables -C lib/unicore -P pod -maketest -makelist -p
1045 # Commented out so always runs, mktables looks at far more files than we
1046 # can in this makefile to decide if needs to run or not
1049 # $(PERL_EXE) and ext because buildtoc uses Text::Wrap uses re
1050 # But also this ensures that all extensions are built before we try to scan
1051 # them, which picks up Devel::PPPort's documentation.
1052 pod/perltoc.pod: $(perltoc_pod_prereqs) $(PERL_EXE) $(ext) pod/buildtoc
1053 $(RUN_PERL) -f -Ilib pod/buildtoc -q
1055 pod/perlapi.pod: pod/perlintern.pod
1057 pod/perlintern.pod: $(MINIPERL_EXE) autodoc.pl embed.fnc
1058 $(MINIPERL) autodoc.pl
1060 pod/perlmodlib.pod: $(MINIPERL_EXE) pod/perlmodlib.PL MANIFEST
1061 $(MINIPERL) $(Icwd) pod/perlmodlib.PL -q
1063 pod/perl5176delta.pod: pod/perldelta.pod
1064 $(RMS) pod/perl5176delta.pod
1065 $(LNS) perldelta.pod pod/perl5176delta.pod
1067 extra.pods: $(MINIPERL_EXE)
1068 -@test ! -f extra.pods || rm -f `cat extra.pods`
1070 -@for x in `grep -l '^=[a-z]' README.* | grep -v README.vms` ; do \
1071 nx=`echo $$x | sed -e "s/README\.//"`; \
1072 $(LNS) ../$$x "pod/perl"$$nx".pod" ; \
1073 echo "pod/perl"$$nx".pod" >> extra.pods ; \
1076 extras.make: $(PERL_EXE)
1077 -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -Ilib -MCPAN -e '@ARGV&&make(@ARGV)' `cat extras.lst`
1079 extras.test: $(PERL_EXE)
1080 -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -Ilib -MCPAN -e '@ARGV&&test(@ARGV)' `cat extras.lst`
1082 extras.install: $(PERL_EXE)
1083 -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -Ilib -MCPAN -e '@ARGV&&install(@ARGV)' `cat extras.lst`
1085 .PHONY: install install-strip install-all install-verbose install-silent \
1086 no-install install.perl install.man install.html
1088 install_strip install-strip:
1089 $(MAKE) STRIPFLAGS=-s install DESTDIR="$(DESTDIR)"
1091 install install_all install-all:
1092 $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) DESTDIR="$(DESTDIR)"
1094 install_verbose install-verbose:
1095 $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-V DESTDIR="$(DESTDIR)"
1097 install_silent install-silent:
1098 $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-S DESTDIR="$(DESTDIR)"
1100 no_install no-install:
1101 $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-n DESTDIR="$(DESTDIR)"
1103 # Set this to an empty string to avoid an attempt of rebuild before install
1104 INSTALL_DEPENDENCE = all
1106 install.perl: $(INSTALL_DEPENDENCE) installperl
1107 $(RUN_PERL) installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) $(STRIPFLAGS)
1108 -@test ! -s extras.lst || $(MAKE) extras.install
1110 install.man: all installman
1111 $(RUN_PERL) installman --destdir=$(DESTDIR) $(INSTALLFLAGS)
1113 # XXX Experimental. Hardwired values, but useful for testing.
1114 # Eventually Configure could ask for some of these values.
1115 install.html: all installhtml
1116 -@test -f README.vms && cd vms && $(LNS) ../README.vms README_vms.pod && cd ..
1117 $(RUN_PERL) installhtml \
1118 --podroot=. --podpath=. --recurse \
1119 --htmldir=$(privlib)/html \
1120 --htmlroot=$(privlib)/html \
1121 --splithead=pod/perlipc \
1122 --splititem=pod/perlfunc \
1123 --ignore=Porting/Maintainers.pm,Porting/pumpkin.pod,Porting/repository.pod \
1127 # I now supply perly.c with the kits, so the following section is
1128 # used only if you force bison to run by saying
1130 # You normally shouldn't remake perly.[ch].
1134 run_byacc run-byacc:
1135 @echo "run_byacc is obsolete; try 'make regen_perly' instead"
1137 # this outputs perly.h, perly.act and perly.tab
1138 regen_perly regen-perly:
1141 # We don't want to regenerate perly.c and perly.h, but they might
1142 # appear out-of-date after a patch is applied or a new distribution is
1150 SYM = globvar.sym perlio.sym
1152 SYMH = perlvars.h intrpvar.h
1156 # The following files are generated automatically
1157 # embed.pl: proto.h embed.h embedvar.h perlapi.h perlapi.c
1158 # opcode.pl: opcode.h opnames.h pp_proto.h
1159 # regcomp.pl: regnodes.h
1160 # warnings.pl: warnings.h lib/warnings.pm
1161 # feature.pl: feature.h lib/feature.pm
1162 # The correct versions should be already supplied with the perl kit,
1163 # in case you don't have perl available.
1164 # To force them to be regenerated, run
1166 # with your existing copy of perl
1167 # (make regen_headers is kept for backwards compatibility)
1169 AUTOGEN_FILES = opcode.h opnames.h pp_proto.h proto.h embed.h embedvar.h \
1170 perlapi.h perlapi.c regnodes.h warnings.h lib/warnings.pm \
1171 lib/feature.pm feature.h
1173 .PHONY: regen_headers regen_all
1177 -perl regen/uconfig_h.pl
1179 regen_headers regen-headers: FORCE
1181 -perl regen/uconfig_h.pl -v
1183 regen_meta regen-meta: META.yml
1186 PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -Ilib Porting/makemeta
1189 regen_all regen-all: regen regen_meta
1191 .PHONY: manisort manicheck
1194 @perl Porting/manisort -q || (echo "WARNING: re-sorting MANIFEST"; \
1195 perl Porting/manisort -q -o MANIFEST; sh -c true)
1198 perl Porting/manicheck
1201 # Names added to $(dynamic_ext) or $(static_ext) or $(nonxs_ext) will
1202 # automatically get built. There should ordinarily be no need to change
1203 # any of this part of makefile.
1205 # The dummy dependency is a place holder in case $(dynamic_ext) or
1206 # $(static_ext) is empty.
1208 # DynaLoader may be needed for extensions that use Makefile.PL.
1210 $(DYNALOADER): $(MINIPERL_EXE) lib/buildcustomize.pl preplibrary FORCE $(nonxs_ext)
1211 $(MINIPERL) make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS)
1213 d_dummy $(dynamic_ext): $(MINIPERL_EXE) lib/buildcustomize.pl preplibrary makeppport $(DYNALOADER) FORCE $(PERLEXPORT)
1214 $(MINIPERL) make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic
1216 s_dummy $(static_ext): $(MINIPERL_EXE) lib/buildcustomize.pl preplibrary makeppport $(DYNALOADER) FORCE
1217 $(MINIPERL) make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS)
1219 n_dummy $(nonxs_ext): $(MINIPERL_EXE) lib/buildcustomize.pl preplibrary FORCE
1220 $(MINIPERL) make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
1223 $spitshell >>$Makefile <<EOF
1227 $spitshell >>$Makefile <<'!NO!SUBS!'
1231 @eval `$(RUN_PERL) -Ilib -V:$(CONFIGVAR)`; echo $$$(CONFIGVAR)
1233 .PHONY: clean _tidy _mopup _cleaner1 _cleaner2 \
1234 realclean _realcleaner clobber _clobber \
1235 distclean veryclean _verycleaner
1239 realclean: _realcleaner _mopup
1240 @echo "Note that '$(MAKE) realclean' does not delete config.sh or Policy.sh"
1243 -@rm -f Cross/run-* Cross/to-* Cross/from-*
1245 rm -f config.sh cppstdin Policy.sh extras.lst
1247 clobber: _realcleaner _mopup _clobber
1251 # Like distclean but also removes emacs backups and *.orig.
1252 veryclean: _verycleaner _mopup _clobber
1253 -@rm -f Obsolete Wanted
1255 # Do not 'make _mopup' directly.
1257 rm -f *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c opmini.c perlmini.c generate_uudmap$(EXE_EXT) $(generated_headers)
1259 -@test -f extra.pods && rm -f `cat extra.pods`
1260 -@test -f vms/README_vms.pod && rm -f vms/README_vms.pod
1261 -rm -f perl.exp ext.libs $(generated_pods) uni.data opmini.o perlmini.o pod/roffitall
1262 -rm -f perl.export perl.dll perl.libexp perl.map perl.def
1263 -rm -f perl.loadmap miniperl.loadmap perl.prelmap miniperl.prelmap
1264 -rm -f perl.third lib*.so.perl.third perl.3log t/perl.third t/perl.3log
1265 -rm -f perl.pixie lib*.so.perl.pixie lib*.so.Addrs
1266 -rm -f perl.Addrs perl.Counts t/perl.Addrs t/perl.Counts *perl.xok
1267 -rm -f cygwin.c libperl*.def libperl*.dll cygperl*.dll *.exe.stackdump
1268 -rm -f $(PERL_EXE) $(MINIPERL_EXE) $(LIBPERL) libperl.* microperl
1269 -rm -f config.arch config.over $(DTRACE_H) runtests
1271 # Do not 'make _tidy' directly.
1273 -cd pod; $(LDLIBPTH) $(MAKE) clean
1274 -cd utils; $(LDLIBPTH) $(MAKE) clean
1275 -cd x2p; $(LDLIBPTH) $(MAKE) clean
1276 -rm -f lib/Config_git.pl git_version.h
1277 -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \
1278 $(MINIPERL) make_ext.pl --target=clean $$x MAKE=$(MAKE) ; \
1282 -cd os2; rm -f Makefile
1283 -cd pod; $(LDLIBPTH) $(MAKE) $(CLEAN)
1284 -cd utils; $(LDLIBPTH) $(MAKE) $(CLEAN)
1285 -cd x2p; $(LDLIBPTH) $(MAKE) $(CLEAN)
1286 -@if test -f $(MINIPERL_EXE) ; then \
1287 for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \
1288 $(MINIPERL) make_ext.pl --target=$(CLEAN) $$x MAKE=$(MAKE) ; \
1293 rm -f realclean.sh veryclean.sh
1294 -for file in `find cpan dist ext -name ppport.h` ; do rm -f $$file; done
1296 # Dear POSIX, thanks for making the default to xargs to be
1297 # run once if nothhing is passed in. It is such a great help.
1299 # Some systems do not support "?", so keep these files separate.
1301 -rm -f core.*perl.*.? t/core.perl.*.? .?*.c
1302 rm -f core *perl.core t/core t/*perl.core core.* t/core.*
1303 rm -f t/$(PERL_EXE) t/rantests
1305 rm -f so_locations $(LIBPERL_NONSHR) $(MINIPERL_NONSHR)
1306 rm -rf $(addedbyconf)
1307 rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old makefile.old
1309 rm -rf $(unidatafiles) $(unidatadirs)
1311 rm -f lib/.exists lib/*/.exists lib/*/*/.exists
1312 rm -f h2ph.man pstruct
1315 rm -rf lib/Encode lib/Compress lib/Hash lib/re
1316 rm -rf lib/TAP lib/Module/Pluggable lib/App
1318 rm -rf lib/IO/Compress lib/IO/Uncompress
1319 rm -f lib/ExtUtils/ParseXS/t/XSTest.c
1320 rm -f lib/ExtUtils/ParseXS/t/XSTest$(OBJ_EXT)
1321 rm -f lib/ExtUtils/ParseXS/t/XSTest$(DLSUFFIX)
1323 rm -fr lib/CPAN lib/CPANPLUS
1324 rm -fr lib/ExtUtils/CBuilder
1326 rm -rf pod/perlfunc pod/perlipc
1327 -rmdir cpan/CPANPLUS-Dist-Build/t/dummy-cpanplus cpan/CPANPLUS/t/dummy-cpanplus cpan/CPANPLUS/t/dummy-localmirror
1329 -rmdir lib/Archive/Tar lib/Archive lib/Attribute
1330 -rmdir lib/CGI lib/Carp
1331 -rmdir lib/Data lib/Devel lib/Digest
1332 -rmdir lib/ExtUtils/Command lib/ExtUtils/Constant lib/ExtUtils/Liblist lib/ExtUtils/MakeMaker
1333 -rmdir lib/File/Spec lib/Filter/Util lib/Filter
1334 -rmdir lib/I18N/LangTags lib/IO/Socket lib/IO lib/IPC
1335 -rmdir lib/List/Util lib/List
1336 -rmdir lib/Locale/Maketext lib/Locale
1337 -rmdir lib/Log/Message lib/Log
1338 -rmdir lib/Math/Big* lib/Math
1339 -rmdir lib/Memoize lib/MIME
1340 -rmdir lib/Module/Build/Platform lib/Module/Build lib/Module/Load lib/Module
1341 -rmdir lib/Net/FTP lib/Object
1342 -rmdir lib/Parse/CPAN lib/Parse
1343 -rmdir lib/PerlIO/via lib/PerlIO
1344 -rmdir lib/Package lib/Params
1345 -rmdir lib/Pod/Perldoc lib/Pod/Simple lib/Pod/Text
1346 -rmdir lib/Sys lib/Scalar/Util lib/Scalar
1347 -rmdir lib/Term/UI lib/Thread lib/Tie/Hash
1348 -rmdir lib/Test/Builder/Tester lib/Test/Builder lib/Test
1349 -rmdir lib/Unicode/Collate
1350 -rmdir lib/XS/APItest lib/XS
1351 -rmdir lib/inc/latest lib/inc
1352 -rmdir lib/autodie/exception lib/autodie lib/encoding lib/threads
1353 -rm -f lib/ExtUtils/CBuilder/t/libcompilet.dll.a
1354 -rm -f lib/ExtUtils/ParseXS/t/libXSTest.dll.a
1357 @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=distclean
1358 @$(LDLIBPTH) $(MAKE) _cleaner2
1361 @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=veryclean
1362 @$(LDLIBPTH) $(MAKE) _cleaner2
1363 -rm -f *~ *.orig */*~ */*.orig */*/*~ */*/*.orig
1368 lint $(lintflags) -DPERL_CORE -D_REENTRANT -DDEBUGGING -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(c)
1372 splint $(splintflags) -DPERL_CORE -D_REENTRANT -DDEBUGGING -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(splintfiles)
1374 # Need to unset during recursion to go out of loop.
1375 # The README below ensures that the dependency list is never empty and
1376 # that when MAKEDEPEND is empty $(FIRSTMAKEFILE) doesn't need rebuilding.
1378 MAKEDEPEND = Makefile makedepend
1380 $(FIRSTMAKEFILE): README $(MAKEDEPEND)
1381 $(MAKE) depend MAKEDEPEND=
1383 config.h: config_h.SH config.sh
1384 $(SHELL) config_h.SH
1388 sh ./makedepend MAKE=$(MAKE)
1389 cd x2p; $(MAKE) depend
1391 # Cannot postpone this until $firstmakefile is ready ;-)
1392 makedepend: makedepend.SH config.sh
1395 runtests: runtests.SH config.sh
1398 .PHONY: test check test_prep test_prep_nodll test_prep_pre \
1399 test_prep_reonly test_tty test-tty test_notty test-notty \
1400 utest ucheck test.utf8 check.utf8 test.torture torturetest \
1401 test.utf16 check.utf16 utest.utf16 ucheck.utf16 \
1402 test.third check.third utest.third ucheck.third test_notty.third \
1403 test.deparse test_notty.deparse test_harness test_harness_notty \
1404 minitest coretest test.taintwarn test-reonly _test
1407 echo >&2 The _test target is deprecated. Please upgrade your smoker
1408 PERL=./perl $(RUN_TESTS) choose
1410 # Cannot delegate rebuilding of t/perl to make
1411 # to allow interlaced test and minitest
1413 # Architecture-neutral stuff:
1415 test_prep_pre: preplibrary utilities $(nonxs_ext)
1417 test_prep test-prep: test_prep_pre $(MINIPERL_EXE) $(unidatafiles) $(PERL_EXE) \
1418 $(dynamic_ext) $(TEST_PERL_DLL) runtests x2p/s2p x2p/find2perl \
1420 cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE))
1422 test_prep_reonly: $(MINIPERL_EXE) $(PERL_EXE) $(dynamic_ext_re) $(TEST_PERL_DLL)
1423 $(MINIPERL) make_ext.pl $(dynamic_ext_re) MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic
1424 cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE))
1426 test check: test_prep
1429 test_tty test-tty: test_prep
1432 test_notty test-notty: test_prep
1435 utest ucheck test.utf8 check.utf8: test_prep
1436 TEST_ARGS=-utf8 $(RUN_TESTS) choose
1439 TEST_ARGS=-core $(RUN_TESTS) choose
1443 test.torture torturetest: test_prep
1444 TEST_ARGS=-torture $(RUN_TESTS) choose
1446 # Targets for UTF16 testing:
1448 minitest.utf16: minitest.prep
1449 - cd t && (rm -f $(PERL_EXE); $(LNS) ../$(MINIPERL_EXE) $(PERL_EXE)) \
1450 && $(RUN_PERL) TEST -utf16 base/*.t comp/*.t cmd/*.t run/*.t io/*.t op/*.t uni/*.t </dev/tty
1452 test.utf16 check.utf16: test_prep
1453 TEST_ARGS=-utf16 $(RUN_TESTS) choose
1455 utest.utf16 ucheck.utf16: test_prep
1456 TEST_ARGS="-utf8 -utf16" $(RUN_TESTS) choose
1460 case "${osname}${osvers}" in
1462 $spitshell >>$Makefile <<'!NO!SUBS!'
1463 # Targets for valgrind testing:
1465 test_prep.valgrind: test_prep perl.valgrind
1467 test.valgrind check.valgrind: test_prep perl.valgrind.config
1468 PERL_VALGRIND=1 VALGRIND='$(VALGRIND)' $(RUN_TESTS) choose
1470 utest.valgrind ucheck.valgrind: test_prep.valgrind perl.valgrind.config
1471 PERL_VALGRIND=1 TEST_ARGS=-utf8 $(RUN_TESTS) choose
1473 test_notty.valgrind: test_prep.valgrind perl.valgrind.config
1474 PERL_VALGRIND=1 $(RUN_TESTS) no-tty
1479 $spitshell >>$Makefile <<'!NO!SUBS!'
1481 # Targets for Third Degree testing.
1483 test_prep.third: test_prep perl.third
1484 cd t && (rm -f ./perl.third$(EXE_EXT); $(LNS) ../perl.third$(EXE_EXT) perl.third(EXE_EXT))
1486 test.third check.third: test_prep.third perl.third
1487 PERL=./perl.third PERL_3LOG=1 $(RUN_TESTS) choose
1489 utest.third ucheck.third: test_prep.third perl.third
1490 PERL=./perl.third PERL_3LOG=1 TEST_ARGS=-utf8 $(RUN_TESTS) choose
1492 test_notty.third: test_prep.third perl.third
1493 PERL=./perl.third PERL_3LOG=1 $(RUN_TESTS) choose
1495 # Targets for Deparse testing.
1497 test.deparse: test_prep
1498 TEST_ARGS=-deparse $(RUN_TESTS) choose
1500 test_notty.deparse: test_prep
1501 TEST_ARGS=-deparse $(RUN_TESTS) no-tty
1503 # Targets to run the test suite with -t
1505 test.taintwarn: test_prep
1506 TEST_ARGS=-taintwarn $(RUN_TESTS) choose
1509 -@test -f lib/Config.pm || $(MAKE) lib/Config.pm $(unidatafiles)
1511 @echo "You may see some irrelevant test failures if you have been unable"
1512 @echo "to build lib/Config.pm, or the Unicode data files."
1515 # Can't depend on lib/Config.pm because that might be where miniperl
1517 minitest: $(MINIPERL_EXE) minitest.prep
1518 - cd t && (rm -f $(PERL_EXE); $(LNS) ../$(MINIPERL_EXE) $(PERL_EXE)) \
1519 && $(RUN_PERL) TEST base/*.t comp/*.t cmd/*.t run/*.t io/*.t re/*.t op/*.t uni/*.t </dev/tty
1523 test_harness test-harness: test_prep
1524 TESTFILE=harness $(RUN_TESTS) choose
1526 test_harness_notty: test_prep
1527 HARNESS_NOTTY=1 TESTFILE=harness $(RUN_TESTS) choose
1529 test_reonly test-reonly: test_prep_reonly
1530 TEST_ARGS='-re \bre\/' TESTFILE=harness $(RUN_TESTS) choose
1533 # Porting tests (well-formedness of pod, manifest, etc)
1535 test_porting test-porting: test_prep
1536 cd t && $(RUN_PERL) harness porting/*.t ../lib/diagnostics.t
1538 # Handy way to run perlbug -ok without having to install and run the
1539 # installed perlbug. We don't re-run the tests here - we trust the user.
1540 # Please *don't* use this unless all tests pass.
1541 # If you want to report test failures, use "make nok" instead.
1543 .PHONY: ok okfile oknack okfilenack nok nokfile noknack nokfilenack
1546 $(RUN_PERL) -Ilib utils/perlbug -ok -s '(UNINSTALLED)'
1549 $(RUN_PERL) -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -F perl.ok
1552 $(RUN_PERL) -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -A
1554 okfilenack: utilities
1555 $(RUN_PERL) -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -F perl.ok -A
1558 $(RUN_PERL) -Ilib utils/perlbug -nok -s '(UNINSTALLED)'
1561 $(RUN_PERL) -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok
1564 $(RUN_PERL) -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -A
1566 nokfilenack: utilities
1567 $(RUN_PERL) -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok -A
1569 .PHONY: clist hlist shlist
1572 echo $(c) | tr ' ' $(TRNL) >.clist
1575 echo $(h) | tr ' ' $(TRNL) >.hlist
1578 echo $(sh) | tr ' ' $(TRNL) >.shlist
1580 Makefile: Makefile.SH ./config.sh
1581 $(SHELL) Makefile.SH
1585 perl '-MExtUtils::Manifest=&fullcheck' -e 'fullcheck()'
1590 ctags -f Tags -N --totals --languages=c --langmap=c:+.h --exclude=opmini.c --exclude=perlmini.c *.c *.h
1592 # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
1593 # If this runs make out of memory, delete /usr/include lines.
1600 $ln Makefile ../Makefile
1603 $rm -f $firstmakefile
1605 # Now do any special processing required before building.
1610 echo "This is an EBCDIC system, checking if any parser files need regenerating." >&2
1615 rm -f y.tab.c y.tab.h
1618 # we are using two different yaccs in BS2000 Posix!
1619 byacc a2p.y >/dev/null 2>&1
1622 yacc a2p.y >/dev/null 2>&1
1625 if cmp -s y.tab.c a2p.c
1629 echo "a2p.y -> a2p.c" >&2
1632 sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
1633 -e 's|^static void __YY_YACC_MAIN.*BS2000.*|/*static main deleted*/|' \
1634 -e 's/y\.tab/a2p/g' a2p.c >a2p.tmp && mv a2p.tmp a2p.c
1637 # In case somebody yacc -d:ed the a2p.y.
1640 if cmp -s y.tab.h a2p.h
1644 echo "a2p.h -> a2p.h" >&2
1653 echo "'$osname' is an EBCDIC system I don't know that well." >&4
1657 '') echo "No parser files were regenerated. That's okay." >&2 ;;
1662 # ex: set ts=8 sts=4 sw=4 noet: