Pod whitespace cleanup, round 0.
[p5sagit/p5-mst-13.2.git] / Makefile.SH
index 2de7fe6..63f7417 100644 (file)
@@ -198,6 +198,8 @@ shellflags = $shellflags
 # do it for you.
 $make_set_make
 
+# Mention $gmake here so it gets probed for by Configure.
+
 # These variables may need to be manually set for non-Unix systems.
 AR = $full_ar
 EXE_EXT = $_exe
@@ -230,6 +232,21 @@ INSTALLPREFIXEXP = $prefix
 # $installusrbinperl
 # $versiononly
 
+case "${osname}:${osvers}" in
+darwin:*)
+$spitshell >>Makefile <<EOF
+
+# Your locales are broken (osname $osname, osvers $osvers)
+# and to avoid the numerous
+# perl: warning: Setting locale failed.
+# warnings during the build process we reset the locale variables.
+
+LC_ALL=C
+LANG=C
+LANGUAGE=C
+EOF
+       ;;
+esac
 
 ## In the following dollars and backticks do not need the extra backslash.
 $spitshell >>Makefile <<'!NO!SUBS!'
@@ -238,7 +255,7 @@ CCCMD    = `sh $(shellflags) cflags "optimize='$(OPTIMIZE)'" $(LIBPERL) $@`
 
 CCCMDSRC = `sh $(shellflags) cflags "optimize='$(OPTIMIZE)'" $(LIBPERL) $<`
 
-private = preplibrary lib/ExtUtils/Miniperl.pm lib/Config.pm
+private = preplibrary lib/Config.pm lib/ExtUtils/Miniperl.pm
 
 # Files to be built with variable substitution before miniperl
 # is available.
@@ -266,19 +283,19 @@ h1 = EXTERN.h INTERN.h XSUB.h av.h config.h cop.h cv.h dosish.h
 h2 = embed.h form.h gv.h handy.h hv.h keywords.h mg.h op.h
 h3 = opcode.h patchlevel.h perl.h perlapi.h perly.h pp.h proto.h regcomp.h
 h4 = regexp.h scope.h sv.h unixish.h util.h iperlsys.h thread.h
-h5 = utf8.h warnings.h
+h5 = utf8.h warnings.h sharedsv.h
 h = $(h1) $(h2) $(h3) $(h4) $(h5)
 
 c1 = $(mallocsrc) av.c scope.c op.c doop.c doio.c dump.c hv.c mg.c
 c2 = perl.c perly.c pp.c pp_hot.c pp_ctl.c pp_sys.c regcomp.c regexec.c utf8.c
 c3 = gv.c sv.c taint.c toke.c util.c deb.c run.c universal.c xsutils.c
-c4 = globals.c perlio.c perlapi.c numeric.c locale.c pp_pack.c
+c4 = globals.c perlio.c perlapi.c numeric.c locale.c pp_pack.c pp_sort.c sharedsv.c
 
 c = $(c1) $(c2) $(c3) $(c4) miniperlmain.c perlmain.c
 
 obj1 = $(mallocobj) gv$(OBJ_EXT) toke$(OBJ_EXT) perly$(OBJ_EXT) op$(OBJ_EXT) regcomp$(OBJ_EXT) dump$(OBJ_EXT) util$(OBJ_EXT) mg$(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) xsutils$(OBJ_EXT) globals$(OBJ_EXT) perlio$(OBJ_EXT) perlapi$(OBJ_EXT) numeric$(OBJ_EXT) locale$(OBJ_EXT) pp_pack$(OBJ_EXT)
+obj3 = 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) locale$(OBJ_EXT) pp_pack$(OBJ_EXT) pp_sort$(OBJ_EXT) sharedsv$(OBJ_EXT)
 
 obj = $(obj1) $(obj2) $(obj3) $(ARCHOBJS)
 
@@ -479,19 +496,19 @@ $(LIBPERL): $& perl$(OBJ_EXT) $(obj) $(LIBPERLEXPORT)
 !NO!SUBS!
 
        case "${osname}${osvers}" in
-       next4*)
+       aix*)
                $spitshell >>Makefile <<'!NO!SUBS!'
 miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT)
-       $(CC) -o miniperl `echo $(obj) | sed 's/ op$(OBJ_EXT) / /'` \
+       $(CC) -o miniperl $(CLDFLAGS) \
+           `echo $(obj) | sed 's/ op$(OBJ_EXT) / /'` \
            miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perl$(OBJ_EXT) $(libs)
        $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
 !NO!SUBS!
                ;;
-       aix*)
+       beos*|next4*)
                $spitshell >>Makefile <<'!NO!SUBS!'
 miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT)
-       $(CC) -o miniperl $(CLDFLAGS) \
-           `echo $(obj) | sed 's/ op$(OBJ_EXT) / /'` \
+       $(CC) -o miniperl `echo $(obj) | sed 's/ op$(OBJ_EXT) / /'` \
            miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perl$(OBJ_EXT) $(libs)
        $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
 !NO!SUBS!
@@ -627,26 +644,27 @@ sperl$(OBJ_EXT): perl.c $(h)
 #      test -d lib/auto || mkdir lib/auto
 #
 .PHONY: preplibrary
-preplibrary: miniperl lib/Config.pm lib/lib.pm lib/re.pm
+preplibrary: miniperl lib/Config.pm lib/lib.pm
        @sh ./makedir lib/auto
        @echo " AutoSplitting perl library"
        $(LDLIBPTH) ./miniperl -Ilib -e 'use AutoSplit; \
                autosplit_lib_modules(@ARGV)' lib/*.pm lib/*/*.pm
+       $(MAKE) lib/re.pm
 
 # Take care to avoid modifying lib/Config.pm without reason
 # (If trying to create a new port and having problems with the configpm script,
 # try 'make minitest' and/or commenting out the tests at the end of configpm.)
-lib/Config.pm: config.sh miniperl configpm lib/re.pm
+lib/Config.pm: config.sh miniperl configpm
        $(LDLIBPTH) ./miniperl configpm configpm.tmp
        sh mv-if-diff configpm.tmp $@
 
 lib/ExtUtils/Miniperl.pm: miniperlmain.c miniperl minimod.pl lib/Config.pm
        $(LDLIBPTH) ./miniperl minimod.pl > minimod.tmp
        sh mv-if-diff minimod.tmp $@
+       -touch lib/ExtUtils/Miniperl.pm
 
 lib/re.pm: ext/re/re.pm
-       @-rm -f $@
-       cat ext/re/re.pm > $@
+       cp ext/re/re.pm ext/re/re.tmp && sh mv-if-diff ext/re/re.tmp lib/re.pm
 
 $(plextract):  miniperl lib/Config.pm
        @-rm -f $@
@@ -772,7 +790,7 @@ CHMOD_W = chmod +w
 #      keywords.pl:    keywords.h
 #      opcode.pl:      opcode.h opnames.h pp_proto.h pp.sym
 # [* embed.pl needs pp.sym generated by opcode.pl! *]
-#      embed.pl:       proto.h embed.h embedvar.h global.sym objXSUB.h
+#      embed.pl:       proto.h embed.h embedvar.h global.sym
 #                      perlapi.h perlapi.c pod/perlintern.pod
 #                      pod/perlapi.pod
 #      bytecode.pl:    ext/ByteLoader/byterun.h ext/ByteLoader/byterun.c
@@ -784,35 +802,10 @@ CHMOD_W = chmod +w
 # To force them to be regenerated, type
 #      make regen_headers
 
-keywords.h:    keywords.pl
-       -perl keywords.pl
-
-OPCODE_PL_OUTPUT = opcode.h opnames.h pp_proto.h pp.sym
-
-$(OPCODE_PL_OUTPUT): opcode.pl
-       -perl opcode.pl
-
-# Really the prerequisites for the next rule  should only be "embed.pl pp.sym"
-# Writing it this way gives make a big hint to always run opcode.pl before
-# embed.pl. The alternative - running embed.pl then opcode.pl causes embed.pl
-# to be re-run next make invocation, and then all object files get recompiled.
-
-proto.h embed.h embedvar.h global.sym objXSUB.h perlapi.h perlapi.c pod/perlintern.pod pod/perlapi.pod: embed.pl $(OPCODE_PL_OUTPUT)
-       -perl embed.pl
-
-ext/ByteLoader/byterun.h ext/ByteLoader/byterun.c ext/B/B/Asmdata.pm: bytecode.pl
-       -perl bytecode.pl
-
-regnodes.h:    regcomp.pl
-       -perl regcomp.pl
-
-warnings.h lib/warnings.pm: warnings.pl
-       -perl warnings.pl
-
 AUTOGEN_FILES = keywords.h opcode.h opnames.h pp_proto.h pp.sym proto.h \
                embed.h embedvar.h global.sym \
                pod/perlintern.pod pod/perlapi.pod \
-               objXSUB.h perlapi.h perlapi.c ext/ByteLoader/byterun.h \
+               perlapi.h perlapi.c ext/ByteLoader/byterun.h \
                ext/ByteLoader/byterun.c ext/B/B/Asmdata.pm regnodes.h \
                warnings.h lib/warnings.pm
 
@@ -846,13 +839,9 @@ $(DYNALOADER):     miniperl preplibrary FORCE
        @$(LDLIBPTH) sh ext/util/make_ext static $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
 
 d_dummy $(dynamic_ext):        miniperl preplibrary $(DYNALOADER) FORCE
-       @-rm -f lib/re.pm
-       @cat ext/re/re.pm > lib/re.pm
        @$(LDLIBPTH) sh ext/util/make_ext dynamic $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
 
 s_dummy $(static_ext): miniperl preplibrary $(DYNALOADER) FORCE
-       @-rm -f lib/re.pm
-       @cat ext/re/re.pm > lib/re.pm
        @$(LDLIBPTH) sh ext/util/make_ext static $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
 
 n_dummy $(nonxs_ext):  miniperl preplibrary $(DYNALOADER) FORCE
@@ -890,7 +879,8 @@ _mopup:
        -rm -f perl.third lib*.so.perl.third perl.3log t/perl.third t/perl.3log
        -rm -f perl.pixie lib*.so.perl.pixie lib*.so.Addrs
        -rm -f perl.Addrs perl.Counts t/perl.Addrs t/perl.Counts *perl.xok
-       rm -f perl suidperl miniperl $(LIBPERL) libperl.* microperl
+       -rm -f perlld cygwin.c ld2 libperl*.def libperl*.dll
+       rm -f perl$(EXE_EXT) suidperl$(EXE_EXT) miniperl$(EXE_EXT) $(LIBPERL) libperl.* microperl
 
 # Do not 'make _tidy' directly.
 _tidy:
@@ -912,7 +902,7 @@ _cleaner1:
        done
 
 _cleaner2:
-       rm -f core core.*perl.*.? *perl.core t/core t/core.perl.*.? t/*perl.core t/misctmp* t/forktmp* t/tmp* t/c t/perl t/rantests .?*.c so_locations $(LIBPERL_NONSHR) $(MINIPERL_NONSHR)
+       rm -f core core.*perl.*.? *perl.core t/core t/core.perl.*.? t/*perl.core t/misctmp* t/forktmp* t/tmp* t/c t/perl$(EXE_EXT) t/rantests .?*.c so_locations $(LIBPERL_NONSHR) $(MINIPERL_NONSHR)
        rm -rf $(addedbyconf)
        rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old
        rm -f $(private)
@@ -921,7 +911,9 @@ _cleaner2:
        rm -f h2ph.man pstruct
        rm -rf .config
        rm -f testcompile compilelog
-       -rmdir lib/B lib/Data lib/Digest lib/Encode lib/IO/Socket lib/IO lib/Filter/Util lib/List lib/MIME lib/PerlIO lib/Scalar lib/Sys lib/Thread lib/XS
+       -rmdir lib/B lib/Data lib/Digest lib/Encode lib/IO/Socket lib/IO/t lib/IO
+       -rmdir lib/Filter/Util lib/List lib/MIME lib/PerlIO lib/Scalar lib/Sys
+       -rmdir lib/Thread lib/XS
 
 _realcleaner:
        @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=realclean
@@ -969,7 +961,7 @@ makedepend: makedepend.SH config.sh
        utest ucheck test.utf8 check.utf8 \
        test.third check.third utest.third ucheck.third test_notty.third \
        test.deparse test_notty.deparse \
-       minitest
+       minitest coretest
 
 # Cannot delegate rebuilding of t/perl to make
 # to allow interlaced test and minitest
@@ -983,7 +975,7 @@ _test_prep:
 
 test_prep_pre: preplibrary utilities $(nonxs_ext)
 
-test_prep: test_prep_pre miniperl ./perl$(EXE_EXT) $(dynamic_ext) $(TEST_PERL_DLL)
+test_prep: test_prep_pre miniperl perl$(EXE_EXT) $(dynamic_ext) $(TEST_PERL_DLL)
        PERL=./perl $(MAKE) _test_prep
 
 _test_tty:
@@ -1014,6 +1006,9 @@ test_notty: test_prep
 utest ucheck test.utf8 check.utf8: test_prep
        PERL=./perl TEST_ARGS=-utf8 $(MAKE) _test
 
+coretest: test_prep
+       PERL=./perl TEST_ARGS=-core $(MAKE) _test
+
 test-prep:     test_prep
 
 test-tty:      test_tty