Patch: pp_system() bounces out of Cygwin subsystem
[p5sagit/p5-mst-13.2.git] / Makefile.SH
index 340303b..af19641 100644 (file)
@@ -26,7 +26,7 @@ ldlibpth=''
 DPERL_EXTERNAL_GLOB='-DPERL_EXTERNAL_GLOB'
 case "$useshrplib" in
 true)
-       # Prefix all runs of 'miniperl' and 'perl' with 
+       # Prefix all runs of 'miniperl' and 'perl' with
        # $ldlibpth so that ./perl finds *this* shared libperl.
        case "$LD_LIBRARY_PATH" in
        '')
@@ -48,7 +48,6 @@ true)
                             -compatibility_version 1 \
                             -current_version \
                                ${api_version}.${api_subversion} \
-                            -image_base 0x4be00000 \
                             -install_name \$(shrpdir)/\$@"
                ;;
        cygwin*)
@@ -210,7 +209,7 @@ FIRSTMAKEFILE = $firstmakefile
 # Any special object files needed by this architecture, e.g. os2/os2.obj
 ARCHOBJS = $archobjs
 
-.SUFFIXES: .c \$(OBJ_EXT)
+.SUFFIXES: .c \$(OBJ_EXT) .i .s
 
 # grrr
 SHELL = $sh
@@ -228,7 +227,9 @@ TRNL = '$trnl'
 ## In the following dollars and backticks do not need the extra backslash.
 $spitshell >>Makefile <<'!NO!SUBS!'
 
-CCCMD = `sh $(shellflags) cflags $(LIBPERL) $@`
+CCCMD    = `sh $(shellflags) cflags $(LIBPERL) $@`
+
+CCCMDSRC = `sh $(shellflags) cflags $(LIBPERL) $<`
 
 private = preplibrary lib/ExtUtils/Miniperl.pm lib/Config.pm
 
@@ -264,13 +265,13 @@ 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
+c4 = globals.c perlio.c perlapi.c numeric.c locale.c pp_pack.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)
+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)
 
 obj = $(obj1) $(obj2) $(obj3) $(ARCHOBJS)
 
@@ -289,6 +290,14 @@ lintflags = -hbvxac
 .c$(OBJ_EXT):
        $(CCCMD) $(PLDLFLAGS) $*.c
 
+.c.i:
+       $(CCCMDSRC) -E $*.c > $*.i
+
+.c.s:
+       $(CCCMDSRC) -S $*.c
+
+.PHONY: all compile translators utilities
+
 all: $(FIRSTMAKEFILE) miniperl extra.pods $(private) $(public) $(dynamic_ext) $(nonxs_ext)
        @echo " ";
        @echo " Everything is up to date. 'make test' to run test suite."
@@ -296,7 +305,7 @@ all: $(FIRSTMAKEFILE) miniperl extra.pods $(private) $(public) $(dynamic_ext) $(
 compile: all
        echo "testing compilation" > testcompile;
        cd utils;  $(MAKE) compile;
-       cd x2p; $(MAKE) compile; 
+       cd x2p; $(MAKE) compile;
        cd pod; $(MAKE) compile;
 
 translators:   miniperl lib/Config.pm FORCE
@@ -311,6 +320,7 @@ utilities:  miniperl lib/Config.pm $(plextract) lib/lib.pm FORCE
 
 # Phony target to force checking subdirectories.
 # Apparently some makes require an action for the FORCE target.
+.PHONY: FORCE
 FORCE:
        @sh -c true
 !NO!SUBS!
@@ -482,6 +492,7 @@ miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT)
        *)
                $spitshell >>Makefile <<'!NO!SUBS!'
 miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT)
+       -@rm -f miniperl.xok
        $(LDLIBPTH) $(CC) $(CLDFLAGS) -o miniperl \
            miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(LLIBPERL) $(libs)
        $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
@@ -492,6 +503,7 @@ miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT)
        $spitshell >>Makefile <<'!NO!SUBS!'
 
 perl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
+       -@rm -f miniperl.xok
        $(SHRPENV) $(LDLIBPTH) $(CC) -o perl$(PERL_SUFFIX) $(PERL_PROFILING) $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
 
 # Purify/Quantify Perls.
@@ -548,16 +560,25 @@ perl.pixie: /usr/bin/pixie perl.pixie.config perl
 perl.config.dashpg:
        @echo "Checking optimize='-pg' in config.sh..."
        @grep "^optimize="      config.sh
-       @grep "^optimize='-pg'" config.sh >/dev/null || exit 1
+       @grep "^optimize='.*-pg.*'" config.sh >/dev/null || exit 1
 
 perl.gprof.config: config.sh
        @echo "To build perl.gprof you must Configure -Doptimize=-pg, checking..."
        @$(MAKE) perl.config.dashpg
 
 perl.gprof: /usr/bin/gprof perl.gprof.config
+       @-rm -f perl
        $(MAKE) PERL_SUFFIX=.gprof PERL_PROFILING=-pg perl
        @echo "Now you may run perl.gprof and then run gprof perl.gprof."
 
+# Microperl.  This is just a convenience thing if one happens to
+# build also the full Perl and therefore the real big Makefile:
+# usually one should manually explicitly issue the below command.
+
+.PHONY: microperl
+microperl:
+       $(MAKE) -f Makefile.micro
+
 # This version, if specified in Configure, does ONLY those scripts which need
 # set-id emulation.  Suidperl must be setuid root.  It contains the "taint"
 # checks as well as the special code to validate that the script in question
@@ -581,6 +602,7 @@ sperl$(OBJ_EXT): perl.c $(h)
 # We have to call our ./makedir because Ultrix 4.3 make can't handle the line
 #      test -d lib/auto || mkdir lib/auto
 #
+.PHONY: preplibrary
 preplibrary: miniperl lib/Config.pm lib/lib.pm lib/re.pm
        @sh ./makedir lib/auto
        @echo " AutoSplitting perl library"
@@ -588,7 +610,7 @@ preplibrary: miniperl lib/Config.pm lib/lib.pm lib/re.pm
                autosplit_lib_modules(@ARGV)' lib/*.pm lib/*/*.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, 
+# (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
        $(LDLIBPTH) ./miniperl configpm configpm.tmp
@@ -620,6 +642,9 @@ extra.pods: miniperl
        done
        -@test -f vms/perlvms.pod && cd pod && $(LNS) ../vms/perlvms.pod perlvms.pod && cd .. && echo "pod/perlvms.pod" >> extra.pods
 
+.PHONY: install install-strip install-all install-verbose install-silent \
+       no-install install.perl install.man installman install.html installhtml
+
 install-strip:
        $(MAKE) STRIPFLAGS=-s install
 
@@ -669,7 +694,12 @@ install.html: all installhtml
 # to run with precisely the same version of byacc as I use.  You
 # normally shouldn't remake perly.[ch].
 
-run_byacc:     FORCE
+.PHONY: check_byacc run_byacc
+
+check_byacc:
+       @$(BYACC) -V 2>&1 | grep 'version 1\.8\.2'
+
+run_byacc:     FORCE check_byacc
        $(BYACC) -d perly.y
        -chmod 664 perly.c perly.h
        sh $(shellflags) ./perly.fixer y.tab.c perly.c
@@ -677,6 +707,7 @@ run_byacc:  FORCE
            -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c
        sed -e '/^extern YYSTYPE yy/D' y.tab.h >yh.tmp && mv yh.tmp y.tab.h
        cmp -s y.tab.h perly.h && rm -f y.tab.h || mv y.tab.h perly.h
+       perl -i perlyline.pl perly.c
        chmod 664 vms/perly_c.vms vms/perly_h.vms
        perl vms/vms_yfix.pl perly.c perly.h vms/perly_c.vms vms/perly_h.vms
 
@@ -750,6 +781,8 @@ AUTOGEN_FILES = keywords.h opcode.h opnames.h pp_proto.h pp.sym proto.h \
                ext/ByteLoader/byterun.c ext/B/B/Asmdata.pm regnodes.h \
                warnings.h lib/warnings.pm
 
+.PHONY: regen_headers regen_pods regen_all
+
 regen_headers: FORCE
        -$(CHMOD_W) $(AUTOGEN_FILES)
        -perl keywords.pl
@@ -786,12 +819,17 @@ s_dummy $(static_ext):    miniperl preplibrary $(DYNALOADER) FORCE
 n_dummy $(nonxs_ext):  miniperl preplibrary $(DYNALOADER) FORCE
        @$(LDLIBPTH) sh ext/util/make_ext nonxs $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
 
+.PHONY: clean _tidy _mopup _cleaner1 _cleaner2 \
+       realclean _realcleaner clobber _clobber \
+       distclean veryclean _verycleaner
+
 clean:         _tidy _mopup
 
 realclean:     _realcleaner _mopup
        @echo "Note that make realclean does not delete config.sh or Policy.sh"
 
 _clobber:
+       -@rm -f Cross/run-* Cross/to-* Cross/from-*
        rm -f config.sh cppstdin Policy.sh
 
 clobber:       _realcleaner _mopup _clobber
@@ -812,7 +850,7 @@ _mopup:
        -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
        -rm -f perl.pixie lib*.so.perl.pixie lib*.so.Addrs
-       -rm -f perl.Addrs perl.Counts t/perl.Addrs t/perl.Counts
+       -rm -f perl.Addrs perl.Counts t/perl.Addrs t/perl.Counts *perl.xok
        rm -f perl suidperl miniperl $(LIBPERL) libperl.* microperl
 
 # Do not 'make _tidy' directly.
@@ -846,11 +884,11 @@ _cleaner2:
        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
 
-_realcleaner: 
+_realcleaner:
        @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=realclean
        @$(LDLIBPTH) $(MAKE) _cleaner2
 
-_verycleaner: 
+_verycleaner:
        @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=veryclean
        @$(LDLIBPTH) $(MAKE) _cleaner2
        -rm -f *~ *.orig */*~ */*.orig */*/*~ */*/*.orig
@@ -860,6 +898,7 @@ _verycleaner:
 # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
 # for that spot.
 
+.PHONY: lint
 lint: $(c)
        lint $(lintflags) $(defs) perly.c $(c) > perl.fuzz
 
@@ -876,6 +915,7 @@ config.h: config_h.SH config.sh
        $(SHELL) config_h.SH
 
 # When done, touch perlmain.c so that it doesn't get remade each time.
+.PHONY: depend
 depend: makedepend
        sh ./makedepend MAKE=$(MAKE)
        - test -s perlmain.c && touch perlmain.c
@@ -885,6 +925,13 @@ depend: makedepend
 makedepend: makedepend.SH config.sh
        sh ./makedepend.SH
 
+.PHONY: test check test_prep _test_prep \
+       test_tty test-tty _test_tty test_notty test-notty _test_notty \
+       utest ucheck test.utf8 check.utf8 \
+       test.third check.third utest.third ucheck.third test_notty.third \
+       test.deparse test_notty.deparse \
+       minitest
+
 # Cannot delegate rebuilding of t/perl to make
 # to allow interlaced test and minitest
 
@@ -962,6 +1009,9 @@ minitest: miniperl lib/re.pm
 # installed perlbug. We don't re-run the tests here - we trust the user.
 # Please *don't* use this unless all tests pass.
 # If you want to report test failures, use "make nok" instead.
+
+.PHONY: ok okfile oknack okfilenack nok nokfile noknack nokfilenack
+
 ok:    utilities
        $(LDLIBPTH) ./perl -Ilib utils/perlbug -ok -s '(UNINSTALLED)'
 
@@ -986,6 +1036,8 @@ noknack:   utilities
 nokfilenack:   utilities
        $(LDLIBPTH) ./perl -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok -A
 
+.PHONY: clist hlist shlist pllist
+
 clist: $(c)
        echo $(c) | tr ' ' $(TRNL) >.clist
 
@@ -1001,14 +1053,18 @@ pllist: $(pl)
 Makefile: Makefile.SH ./config.sh
        $(SHELL) Makefile.SH
 
+.PHONY: distcheck
 distcheck: FORCE
        perl '-MExtUtils::Manifest=&fullcheck' -e 'fullcheck()'
 
+.PHONY: elc
 elc:   emacs/cperl-mode.elc
 
 emacs/cperl-mode.elc: emacs/cperl-mode.el
        -cd emacs; emacs -batch -q -no-site-file -f batch-byte-compile cperl-mode.el
 
+.PHONY: etags ctags tags
+
 etags: TAGS
 
 TAGS: emacs/cperl-mode.elc