This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Avoid an unused temp scalar in sv.c:S_sv_unglob
[perl5.git] / Makefile.SH
index b4955ad..7b050fa 100755 (executable)
@@ -331,10 +331,21 @@ $make_set_make
 
 # Mention $gmake here so it gets probed for by Configure.
 
+!GROK!THIS!
+
+case "${osname}" in
+linux*|darwin)
+$spitshell >>$Makefile <<!GROK!THIS!
 # If you're going to use valgrind and it can't be invoked as plain valgrind
 # then you'll need to change this, or override it on the make command line.
-VALGRIND=valgrind
+VALGRIND ?= valgrind
+VG_TEST  ?= ./perl -e 1 2>/dev/null
+
+!GROK!THIS!
+       ;;
+esac
 
+$spitshell >>$Makefile <<!GROK!THIS!
 DTRACE = $dtrace
 DTRACE_H = $dtrace_h
 DTRACE_O = $dtrace_o
@@ -436,6 +447,7 @@ addedbyconf = UU $(shextract) pstruct
 # Unicode data files generated by mktables
 unidatafiles = lib/unicore/Decomposition.pl lib/unicore/TestProp.pl \
        lib/unicore/CombiningClass.pl lib/unicore/Name.pl \
+       lib/unicore/UCD.pl lib/unicore/Name.pm \
        lib/unicore/Heavy.pl lib/unicore/mktables.lst
 
 # Directories of Unicode data files generated by mktables
@@ -457,19 +469,21 @@ c5 = $(madlysrc) $(mallocsrc)
 c = $(c1) $(c2) $(c3) $(c4) $(c5) miniperlmain.c opmini.c perlmini.c
 
 obj0 = op$(OBJ_EXT) perl$(OBJ_EXT)
+obj0mini = perlmini$(OBJ_EXT) opmini$(OBJ_EXT) miniperlmain$(OBJ_EXT)
 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)
 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)
 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)
 
-minindt_obj = $(obj1) $(obj2) $(obj3) $(ARCHOBJS)
+minindt_obj = $(obj0mini) $(obj1) $(obj2) $(obj3) $(ARCHOBJS)
 mini_obj = $(minindt_obj) $(MINIDTRACE_O)
 ndt_obj = $(obj0) $(obj1) $(obj2) $(obj3) $(ARCHOBJS)
 obj = $(ndt_obj) $(DTRACE_O)
 
-perltoc_pod_prereqs = extra.pods pod/perl5150delta.pod pod/perlapi.pod pod/perlintern.pod pod/perlmodlib.pod pod/perluniprops.pod
+perltoc_pod_prereqs = extra.pods pod/perl5156delta.pod pod/perlapi.pod pod/perlintern.pod pod/perlmodlib.pod pod/perluniprops.pod
 generated_pods = pod/perltoc.pod $(perltoc_pod_prereqs)
+generated_headers = uudmap.h bitcount.h mg_data.h
 
-Icwd = -Idist/Cwd -Idist/Cwd/lib
+Icwd = -Idist/Cwd -Idist/Cwd/lib -Idist/Carp/lib
 
 lintflags = \
     -b \
@@ -630,12 +644,12 @@ done
 
 $spitshell >>$Makefile <<'!NO!SUBS!'
 
-globals$(OBJ_EXT): uudmap.h bitcount.h mg_data.h
+globals$(OBJ_EXT): $(generated_headers)
 
 uudmap.h mg_data.h: bitcount.h
 
 bitcount.h: generate_uudmap$(HOST_EXE_EXT)
-       $(RUN) ./generate_uudmap$(HOST_EXE_EXT) uudmap.h bitcount.h mg_data.h
+       $(RUN) ./generate_uudmap$(HOST_EXE_EXT) $(generated_headers)
 
 generate_uudmap$(OBJ_EXT): mg_raw.h
 
@@ -709,8 +723,8 @@ PERLEXPORT          = perl.exp
        ;;
        esac
        $spitshell >>$Makefile <<'!NO!SUBS!'
-perl.exp: $(MINIPERLEXP) makedef.pl config.sh $(SYM) $(SYMH)
-       ./$(MINIPERLEXP) makedef.pl PLATFORM=aix CC_FLAGS="$(OPTIMIZE)" | sort -u | sort -f > perl.exp
+perl.exp: $(MINIPERLEXP) makedef.pl $(CONFIGPM) $(SYM) $(SYMH)
+       ./$(MINIPERLEXP) makedef.pl --sort-fold PLATFORM=aix CC_FLAGS="$(OPTIMIZE)" > perl.exp
 
 !NO!SUBS!
        ;;
@@ -718,7 +732,7 @@ os2)
        $spitshell >>$Makefile <<'!NO!SUBS!'
 MINIPERLEXP            = miniperl
 
-perl5.def: $(MINIPERLEXP) makedef.pl config.sh $(SYM) $(SYMH) miniperl.map
+perl5.def: $(MINIPERLEXP) makedef.pl $(CONFIGPM) $(SYM) $(SYMH) miniperl.map
        ./$(MINIPERLEXP) makedef.pl PLATFORM=os2 -DPERL_DLL=$(PERL_DLL) CC_FLAGS="$(OPTIMIZE)" > perl5.def
 
 !NO!SUBS!
@@ -748,8 +762,11 @@ else
        case "$dtrace_h" in
        ?*)
                $spitshell >>$Makefile <<'!NO!SUBS!'
+# dtrace dicards const qualifiers from arguments, put them back
 $(DTRACE_H): perldtrace.d
-       $(DTRACE) -h -s perldtrace.d -o $(DTRACE_H)
+       $(DTRACE) -h -s perldtrace.d -o $(DTRACE_H).in
+       sed -e '/const/!s/char \*/const char */g' $(DTRACE_H).in >$(DTRACE_H)
+       $(RMS) $(DTRACE_H).in
 
 mydtrace.h: $(DTRACE_H)
 
@@ -762,8 +779,8 @@ mydtrace.h: $(DTRACE_H)
 $(DTRACE_O): perldtrace.d $(ndt_obj)
        $(DTRACE) -G -s perldtrace.d -o $(DTRACE_O) $(ndt_obj)
 
-$(MINIDTRACE_O): perldtrace.d $(minindt_obj)
-       $(DTRACE) -G -s perldtrace.d -o $(MINIDTRACE_O) $(minindt_obj)
+$(MINIDTRACE_O): perldtrace.d $(minindt_obj) perlmini$(OBJ_EXT)
+       $(DTRACE) -G -s perldtrace.d -o $(MINIDTRACE_O) $(minindt_obj) perlmini$(OBJ_EXT)
 
 !NO!SUBS!
                ;;
@@ -812,18 +829,15 @@ $(LIBPERL): $& $(obj) $(DYNALOADER) $(LIBPERLEXPORT)
        case "${osname}${osvers}" in
        aix*|beos*)
                $spitshell >>$Makefile <<'!NO!SUBS!'
-$(MINIPERL_EXE): $& miniperlmain$(OBJ_EXT) $(mini_obj) opmini$(OBJ_EXT) perlmini$(OBJ_EXT)
-       $(CC) -o $(MINIPERL_EXE) $(CLDFLAGS) \
-           $(mini_obj) \
-           miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perlmini$(OBJ_EXT) $(libs)
+$(MINIPERL_EXE): $& $(mini_obj)
+       $(CC) -o $(MINIPERL_EXE) $(CLDFLAGS) $(mini_obj) $(libs)
        $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
 !NO!SUBS!
                ;;
        next4*)
                $spitshell >>$Makefile <<'!NO!SUBS!'
-$(MINIPERL_EXE): $& miniperlmain$(OBJ_EXT) $(mini_obj) perlmini$(OBJ_EXT) opmini$(OBJ_EXT)
-       $(CC) -o $(MINIPERL_EXE) $(mini_obj) \
-           miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perlmini$(OBJ_EXT) $(libs)
+$(MINIPERL_EXE): $& $(mini_obj)
+       $(CC) -o $(MINIPERL_EXE) $(mini_obj) $(libs)
        $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
 !NO!SUBS!
                ;;
@@ -841,21 +855,19 @@ NAMESPACEFLAGS = -force_flat_namespace
                    ;;
                esac
                $spitshell >>$Makefile <<'!NO!SUBS!'
-$(MINIPERL_EXE): $& miniperlmain$(OBJ_EXT) $(mini_obj) opmini$(OBJ_EXT) perlmini$(OBJ_EXT)
+$(MINIPERL_EXE): $& $(mini_obj)
        -@rm -f miniperl.xok
        $(CC) $(CLDFLAGS) $(NAMESPACEFLAGS) -o $(MINIPERL_EXE) \
-           $(mini_obj) \
-           miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perlmini$(OBJ_EXT) $(libs)
+           $(mini_obj) $(libs)
        $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
 !NO!SUBS!
                ;;
        *)
                $spitshell >>$Makefile <<'!NO!SUBS!'
-$(MINIPERL_EXE): $& miniperlmain$(OBJ_EXT) $(mini_obj) opmini$(OBJ_EXT) perlmini$(OBJ_EXT)
+$(MINIPERL_EXE): $& $(mini_obj)
        -@rm -f miniperl.xok
        $(LDLIBPTH) $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
-           $(mini_obj) \
-           miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perlmini$(OBJ_EXT) $(libs)
+           $(mini_obj) $(libs)
        $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
 !NO!SUBS!
                ;;
@@ -878,7 +890,12 @@ purecov$(PERL_EXE): $& perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs $(PE
 quant$(PERL_EXE): $& perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT)
        $(SHRPENV) $(LDLIBPTH) quantify $(CC) -o quantperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
 
-# Valgrind perl (currently Linux only)
+!NO!SUBS!
+
+case "${osname}${osvers}" in
+linux*|darwin*)
+       $spitshell >>$Makefile <<'!NO!SUBS!'
+# Valgrind perl (currently Linux, Darwin only)
 
 perl.valgrind.config: config.sh
        @echo "To build perl.valgrind you must Configure -Doptimize=-g -Uusemymalloc, checking..."
@@ -887,7 +904,12 @@ perl.valgrind.config: config.sh
        @grep "^usemymalloc="    config.sh
        @grep "^usemymalloc='n'" config.sh >/dev/null || exit 1
        @echo "And of course you have to have valgrind..."
-       $(VALGRIND) ./perl -e 1 2>/dev/null || exit 1
+       $(VALGRIND) $(VG_TEST) || exit 1
+!NO!SUBS!
+       ;;
+esac   
+
+$spitshell >>$Makefile <<'!NO!SUBS!'
 
 # Third Degree Perl (Tru64 only)
 
@@ -1023,7 +1045,7 @@ uni.data: $(MINIPERL_EXE) $(CONFIGPM) lib/unicore/mktables $(nonxs_ext)
 # But also this ensures that all extensions are built before we try to scan
 # them, which picks up Devel::PPPort's documentation.
 pod/perltoc.pod: $(perltoc_pod_prereqs)  $(PERL_EXE) $(ext) pod/buildtoc
-       $(RUN_PERL) -f -Ilib pod/buildtoc --build-toc -q
+       $(RUN_PERL) -f -Ilib pod/buildtoc -q
 
 pod/perlapi.pod: pod/perlintern.pod
 
@@ -1033,8 +1055,8 @@ pod/perlintern.pod: $(MINIPERL_EXE) autodoc.pl embed.fnc
 pod/perlmodlib.pod: $(MINIPERL_EXE) pod/perlmodlib.PL MANIFEST
        $(MINIPERL) $(Icwd) pod/perlmodlib.PL -q
 
-pod/perl5150delta.pod: pod/perldelta.pod
-       $(LNS) perldelta.pod pod/perl5150delta.pod
+pod/perl5156delta.pod: pod/perldelta.pod
+       $(LNS) perldelta.pod pod/perl5156delta.pod
 
 extra.pods: $(MINIPERL_EXE)
        -@test ! -f extra.pods || rm -f `cat extra.pods`
@@ -1057,19 +1079,19 @@ extras.install: $(PERL_EXE)
 .PHONY: install install-strip install-all install-verbose install-silent \
        no-install install.perl install.man install.html
 
-install-strip:
+install_strip install-strip:
        $(MAKE) STRIPFLAGS=-s install DESTDIR="$(DESTDIR)"
 
-install install-all:
+install install_all install-all:
        $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) DESTDIR="$(DESTDIR)"
 
-install-verbose:
+install_verbose install-verbose:
        $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-V DESTDIR="$(DESTDIR)"
 
-install-silent:
+install_silent install-silent:
        $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-S DESTDIR="$(DESTDIR)"
 
-no-install:
+no_install no-install:
        $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-n DESTDIR="$(DESTDIR)"
 
 # Set this to an empty string to avoid an attempt of rebuild before install
@@ -1104,11 +1126,11 @@ install.html: all installhtml
 
 .PHONY: regen_perly
 
-run_byacc:
+run_byacc run-byacc:
        @echo "run_byacc is obsolete; try 'make regen_perly' instead"
 
 # this outputs perly.h, perly.act and perly.tab
-regen_perly:
+regen_perly regen-perly:
        perl regen_perly.pl
 
 # We don't want to regenerate perly.c and perly.h, but they might
@@ -1120,15 +1142,14 @@ perly.c: perly.y
 perly.h: perly.y
        -@sh -c true
 
-SYM  = global.sym globvar.sym perlio.sym
+SYM  = globvar.sym perlio.sym
 
 SYMH = perlvars.h intrpvar.h
 
 CHMOD_W = chmod +w
 
 # The following files are generated automatically
-#      embed.pl:       proto.h embed.h embedvar.h global.sym
-#                      perlapi.h perlapi.c 
+#      embed.pl:       proto.h embed.h embedvar.h perlapi.h perlapi.c
 #      opcode.pl:      opcode.h opnames.h pp_proto.h
 #      regcomp.pl:     regnodes.h
 #      warnings.pl:    warnings.h lib/warnings.pm
@@ -1139,26 +1160,26 @@ CHMOD_W = chmod +w
 # with your existing copy of perl
 # (make regen_headers is kept for backwards compatibility)
 
-AUTOGEN_FILES = opcode.h opnames.h pp_proto.h proto.h \
-               embed.h embedvar.h global.sym \
-               perlapi.h perlapi.c regnodes.h \
-               warnings.h lib/warnings.pm
+AUTOGEN_FILES = opcode.h opnames.h pp_proto.h proto.h embed.h embedvar.h \
+               perlapi.h perlapi.c regnodes.h warnings.h lib/warnings.pm
 
 .PHONY: regen_headers regen_all
 
 regen: FORCE
        -perl regen.pl
+       -perl regen/uconfig_h.pl
 
-regen_headers: FORCE
+regen_headers regen-headers:   FORCE
        -perl regen.pl -v
+       -perl regen/uconfig_h.pl -v
 
-regen_meta:  META.yml
+regen_meta regen-meta:  META.yml
 
 META.yml:   FORCE
        PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -Ilib Porting/makemeta
 
 
-regen_all: regen regen_meta
+regen_all regen-all: regen regen_meta
 
 .PHONY:        manisort manicheck
 
@@ -1226,11 +1247,11 @@ veryclean:      _verycleaner _mopup _clobber
 
 # Do not 'make _mopup' directly.
 _mopup:
-       rm -f *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c opmini.c perlmini.c uudmap.h generate_uudmap$(EXE_EXT) bitcount.h mg_data.h
+       rm -f *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c opmini.c perlmini.c generate_uudmap$(EXE_EXT) $(generated_headers)
        -rmdir .depending
        -@test -f extra.pods && rm -f `cat extra.pods`
        -@test -f vms/README_vms.pod && rm -f vms/README_vms.pod
-       -rm -f perl.exp ext.libs $(generated_pods) uni.data opmini.o perlmini.o
+       -rm -f perl.exp ext.libs $(generated_pods) uni.data opmini.o perlmini.o pod/roffitall
        -rm -f perl.export perl.dll perl.libexp perl.map perl.def
        -rm -f perl.loadmap miniperl.loadmap perl.prelmap miniperl.prelmap
        -rm -f perl.third lib*.so.perl.third perl.3log t/perl.third t/perl.3log
@@ -1297,7 +1318,7 @@ _cleaner2:
        -rmdir cpan/CPANPLUS-Dist-Build/t/dummy-cpanplus cpan/CPANPLUS/t/dummy-cpanplus cpan/CPANPLUS/t/dummy-localmirror
        -rmdir ext/B/lib
        -rmdir lib/Archive/Tar lib/Archive lib/Attribute
-       -rmdir lib/CGI
+       -rmdir lib/CGI lib/Carp
        -rmdir lib/Data lib/Devel lib/Digest
        -rmdir lib/ExtUtils/Command lib/ExtUtils/Constant lib/ExtUtils/Liblist lib/ExtUtils/MakeMaker
        -rmdir lib/File/Spec lib/Filter/Util lib/Filter
@@ -1384,7 +1405,7 @@ _test:
 
 test_prep_pre: preplibrary utilities $(nonxs_ext)
 
-test_prep: test_prep_pre $(MINIPERL_EXE) $(unidatafiles) $(PERL_EXE) \
+test_prep test-prep: test_prep_pre $(MINIPERL_EXE) $(unidatafiles) $(PERL_EXE) \
        $(dynamic_ext) $(TEST_PERL_DLL) runtests x2p/s2p x2p/find2perl \
        $(generated_pods)
        cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE))
@@ -1396,10 +1417,10 @@ test_prep_reonly: $(MINIPERL_EXE) $(PERL_EXE) $(dynamic_ext_re) $(TEST_PERL_DLL)
 test check: test_prep
        $(RUN_TESTS) choose
 
-test_tty: test_prep
+test_tty test-tty: test_prep
        $(RUN_TESTS) tty
 
-test_notty: test_prep
+test_notty test-notty: test_prep
        $(RUN_TESTS) no-tty
 
 utest ucheck test.utf8 check.utf8: test_prep
@@ -1408,12 +1429,6 @@ utest ucheck test.utf8 check.utf8: test_prep
 coretest: test_prep
        TEST_ARGS=-core $(RUN_TESTS) choose
 
-test-prep:     test_prep
-
-test-tty:      test_tty
-
-test-notty:    test_notty
-
 # Torture testing
 
 test.torture torturetest:      test_prep
@@ -1431,6 +1446,11 @@ test.utf16 check.utf16: test_prep
 utest.utf16 ucheck.utf16: test_prep
        TEST_ARGS="-utf8 -utf16" $(RUN_TESTS) choose
 
+!NO!SUBS!
+
+case "${osname}${osvers}" in
+linux*|darwin*)
+       $spitshell >>$Makefile <<'!NO!SUBS!'
 # Targets for valgrind testing:
 
 test_prep.valgrind: test_prep perl.valgrind
@@ -1443,6 +1463,11 @@ utest.valgrind ucheck.valgrind: test_prep.valgrind perl.valgrind.config
 
 test_notty.valgrind: test_prep.valgrind perl.valgrind.config
        PERL_VALGRIND=1 $(RUN_TESTS) no-tty
+!NO!SUBS!
+       ;;
+esac
+
+$spitshell >>$Makefile <<'!NO!SUBS!'
 
 # Targets for Third Degree testing.
 
@@ -1486,19 +1511,19 @@ minitest: $(MINIPERL_EXE) minitest.prep
 
 # Test via harness
 
-test_harness: test_prep
+test_harness test-harness: test_prep
        TESTFILE=harness $(RUN_TESTS) choose
 
 test_harness_notty: test_prep
        HARNESS_NOTTY=1 TESTFILE=harness $(RUN_TESTS) choose
 
-test-reonly: test_prep_reonly
+test_reonly test-reonly: test_prep_reonly
        TEST_ARGS='-re \bre\/' TESTFILE=harness $(RUN_TESTS) choose
 
 
 # Porting tests (well-formedness of pod, manifest, etc)
 
-test_porting: test_prep
+test_porting test-porting: test_prep
        cd t && $(RUN_PERL) harness porting/*.t ../lib/diagnostics.t
 
 # Handy way to run perlbug -ok without having to install and run the