X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/6aafa45657d45f6f5bcdea1cda584a7f87e45cd2..13eda8264d04d22cbdba7702b7454d8640d811a4:/Makefile.SH?ds=sidebyside diff --git a/Makefile.SH b/Makefile.SH index 0cfb0a9..ff0b513 100755 --- a/Makefile.SH +++ b/Makefile.SH @@ -20,16 +20,7 @@ case $PERL_CONFIG_SH in ;; esac -case $CROSS_NAME in -'') - Makefile=Makefile - ;; -*) - # if cross-compilation, the Makefile named accordingly - Makefile=Makefile-cross-$CROSS_NAME - . Cross/config-${CROSS_NAME}.sh - ;; -esac +Makefile=Makefile : This forces SH files to create target in same directory as SH file. : This is so that make depend always knows where to find SH derivatives. @@ -257,8 +248,6 @@ CLDFLAGS = $ldflags mallocsrc = $mallocsrc mallocobj = $mallocobj -madlysrc = $madlysrc -madlyobj = $madlyobj LNS = $lns # NOTE: some systems don't grok "cp -f". XXX Configure test needed? CPS = $cp @@ -307,6 +296,7 @@ RUN = # When cross-compiling we want to use a (mini)perl built for the host, not the target HOST_PERL = $hostperl HOST_GENERATE = $hostgenerate +SYSTEM_PERL = $perl # These variables may need to be manually set for non-Unix systems. AR = $full_ar @@ -321,10 +311,26 @@ PATH_SEP = $p_ MINIPERL_EXE = miniperl\$(EXE_EXT) MINIPERL = \$(LDLIBPTH) ./miniperl\$(EXE_EXT) -Ilib +!GROK!THIS! + +case "$usecrosscompile$perl" in +define?*) + $spitshell >>$Makefile <>$Makefile <>$Makefile <>$Makefile <<'!NO!SUBS!' @@ -424,34 +428,12 @@ CONFIGPOD = lib/Config.pod CONFIGH = config.h !NO!SUBS! - ;; -*) - # if cross-compilation -$spitshell >>$Makefile <>$Makefile <>$Makefile <<'!NO!SUBS!' +# If hostgerenate isn't defined, then we have to build +# generate_uudmap and run it. This can potentially mean running +# it on the target system if we're cross-compiling. +# If it is defined, then we just run it locally. +case "$hostgenerate" in +'') +$spitshell >>$Makefile <>$Makefile <<'!NO!SUBS!' generate_uudmap$(HOST_EXE_EXT): generate_uudmap$(OBJ_EXT) - -@rm generate_uudmap$(HOST_EXE_EXT) - $(LNS) $(HOST_GENERATE) generate_uudmap$(HOST_EXE_EXT) + $(CC) -o generate_uudmap$(EXE_EXT) $(LDFLAGS) generate_uudmap$(OBJ_EXT) $(libs) !NO!SUBS! -else - $spitshell >>$Makefile <<'!NO!SUBS!' +;; +*) +$spitshell >>$Makefile <<'!NO!SUBS!' +bitcount.h: generate_uudmap$(HOST_EXE_EXT) + ./generate_uudmap$(HOST_EXE_EXT) $(generated_headers) + generate_uudmap$(HOST_EXE_EXT): generate_uudmap$(OBJ_EXT) - $(CC) -o generate_uudmap$(EXE_EXT) $(LDFLAGS) generate_uudmap$(OBJ_EXT) $(libs) + -@rm generate_uudmap$(HOST_EXE_EXT) + $(LNS) $(HOST_GENERATE) generate_uudmap$(HOST_EXE_EXT) !NO!SUBS! -fi +;; +esac + $spitshell >>$Makefile <<'!NO!SUBS!' perlmain.c: $(MINIPERL_EXE) ext/ExtUtils-Miniperl/pm_to_blib @@ -873,7 +857,7 @@ $(LIBPERL): $& $(obj) $(DYNALOADER) $(LIBPERLEXPORT) # lib/buildcustomize.pl despite the reality that lib/buildcustomize.pl needs # miniperl to exist first permits us to # a) have one rule generate both miniperl and lib/buildcustomize.pl -# (so that lib/buildcustomise.pl is always available. This simplifies things) +# (so that lib/buildcustomize.pl is always available. This simplifies things) # b) have the rest of the Makefile depend on the more obvious $(MINIPERL_EXE) $(MINIPERL_EXE): lib/buildcustomize.pl @@ -921,13 +905,14 @@ lib/buildcustomize.pl: $& $(mini_obj) write_buildcustomize.pl ;; *) if test "X$hostperl" != X; then - $spitshell >>$Makefile <<'!NO!SUBS!' -lib/buildcustomize.pl: $& $(mini_obj) write_buildcustomize.pl + $spitshell >>$Makefile <' || $(MAKE) minitest -!NO!SUBS! + -@rm \$(MINIPERL_EXE) + \$(LNS) \$(HOST_PERL) \$(MINIPERL_EXE) + \$(LDLIBPTH) ./miniperl\$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1' + \$(MINIPERL) -f write_buildcustomize.pl 'osname' "$osname" +!GROK!THIS! else $spitshell >>$Makefile <<'!NO!SUBS!' lib/buildcustomize.pl: $& $(mini_obj) write_buildcustomize.pl @@ -1004,7 +989,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 -q + $(RUN_PERL) -f pod/buildtoc -q pod/perlapi.pod: pod/perlintern.pod @@ -1014,9 +999,9 @@ pod/perlintern.pod: $(MINIPERL_EXE) autodoc.pl embed.fnc pod/perlmodlib.pod: $(MINIPERL_EXE) pod/perlmodlib.PL MANIFEST $(MINIPERL) pod/perlmodlib.PL -q -pod/perl5199delta.pod: pod/perldelta.pod - $(RMS) pod/perl5199delta.pod - $(LNS) perldelta.pod pod/perl5199delta.pod +pod/perl5213delta.pod: pod/perldelta.pod + $(RMS) pod/perl5213delta.pod + $(LNS) perldelta.pod pod/perl5213delta.pod extra.pods: $(MINIPERL_EXE) -@test ! -f extra.pods || rm -f `cat extra.pods` @@ -1028,13 +1013,13 @@ extra.pods: $(MINIPERL_EXE) done extras.make: $(PERL_EXE) - -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -Ilib -MCPAN -e '@ARGV&&make(@ARGV)' `cat extras.lst` + -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -MCPAN -e '@ARGV&&make(@ARGV)' `cat extras.lst` extras.test: $(PERL_EXE) - -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -Ilib -MCPAN -e '@ARGV&&test(@ARGV)' `cat extras.lst` + -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -MCPAN -e '@ARGV&&test(@ARGV)' `cat extras.lst` extras.install: $(PERL_EXE) - -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -Ilib -MCPAN -e '@ARGV&&install(@ARGV)' `cat extras.lst` + -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -MCPAN -e '@ARGV&&install(@ARGV)' `cat extras.lst` .PHONY: install install-strip install-all install-verbose install-silent \ no-install install.perl install.man install.html @@ -1047,20 +1032,53 @@ no_install no-install: install-notify install: install-all !NO!SUBS! + for name in all notify silent strip verbose; do flags="--$name"; - $spitshell >>$Makefile <>$Makefile <>$Makefile <>$Makefile done -$spitshell >>$Makefile <<'!NO!SUBS!' +if test "X$hostperl" != X; then + $spitshell >>$Makefile <<'!NO!SUBS!' +install.perl: $(INSTALL_DEPENDENCE) installperl + $(HOST_PERL) installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) $(STRIPFLAGS) + -@test ! -s extras.lst || $(MAKE) extras.install + +install.man: all installman + $(HOST_PERL) installman --destdir=$(DESTDIR) $(INSTALLFLAGS) +# XXX Experimental. Hardwired values, but useful for testing. +# Eventually Configure could ask for some of these values. +install.html: all installhtml + -@test -f README.vms && cd vms && $(LNS) ../README.vms README_vms.pod && cd .. + $(HOST_PERL) installhtml \ + --podroot=. --podpath=. --recurse \ + --htmldir=$(privlib)/html \ + --htmlroot=$(privlib)/html \ + --splithead=pod/perlipc \ + --splititem=pod/perlfunc \ + --ignore=Porting/Maintainers.pm,Porting/pumpkin.pod,Porting/repository.pod \ + --verbose +!NO!SUBS! +else + $spitshell >>$Makefile <<'!NO!SUBS!' install.perl: $(INSTALL_DEPENDENCE) installperl $(RUN_PERL) installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) $(STRIPFLAGS) -@test ! -s extras.lst || PATH="`pwd`:\${PATH}" PERL5LIB="`pwd`/lib" \$(RUN_PERL) -Ilib -MCPAN -e '@ARGV&&install(@ARGV)' `cat extras.lst` @@ -1080,7 +1098,10 @@ install.html: all installhtml --splititem=pod/perlfunc \ --ignore=Porting/Maintainers.pm,Porting/pumpkin.pod,Porting/repository.pod \ --verbose +!NO!SUBS! +fi +$spitshell >>$Makefile <<'!NO!SUBS!' # I now supply perly.c with the kits, so the following section is # used only if you force bison to run by saying @@ -1141,10 +1162,10 @@ regen_headers regen-headers: FORCE regen_meta regen-meta: META.yml META.json META.yml: FORCE - PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -Ilib Porting/makemeta -y + PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) Porting/makemeta -y META.json: FORCE - PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -Ilib Porting/makemeta -j + PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) Porting/makemeta -j regen_all regen-all: regen regen_meta @@ -1169,16 +1190,16 @@ manicheck: FORCE # DynaLoader may be needed for extensions that use Makefile.PL. $(DYNALOADER): $(MINIPERL_EXE) lib/buildcustomize.pl preplibrary FORCE $(nonxs_ext) - $(MINIPERL) make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS) + $(MINIPERL) make_ext.pl $@ $(MAKE_EXT_ARGS) MAKE="$(MAKE)" LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS) d_dummy $(dynamic_ext): $(MINIPERL_EXE) lib/buildcustomize.pl preplibrary makeppport $(DYNALOADER) FORCE $(PERLEXPORT) $(LIBPERL) - $(MINIPERL) make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic + $(MINIPERL) make_ext.pl $@ $(MAKE_EXT_ARGS) MAKE="$(MAKE)" LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic s_dummy $(static_ext): $(MINIPERL_EXE) lib/buildcustomize.pl preplibrary makeppport $(DYNALOADER) FORCE - $(MINIPERL) make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS) + $(MINIPERL) make_ext.pl $@ $(MAKE_EXT_ARGS) MAKE="$(MAKE)" LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS) n_dummy $(nonxs_ext): $(MINIPERL_EXE) lib/buildcustomize.pl preplibrary FORCE - $(MINIPERL) make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) + $(MINIPERL) make_ext.pl $@ $(MAKE_EXT_ARGS) MAKE="$(MAKE)" LIBPERL_A=$(LIBPERL) !NO!SUBS! $spitshell >>$Makefile <>$Makefile <<'!NO!SUBS!' .PHONY: printconfig printconfig: - @eval `$(RUN_PERL) -Ilib -V:$(CONFIGVAR)`; echo $$$(CONFIGVAR) + @eval `$(RUN_PERL) -V:$(CONFIGVAR)`; echo $$$(CONFIGVAR) .PHONY: clean _tidy _mopup _cleaner1 _cleaner2 \ realclean _realcleaner clobber _clobber \ @@ -1201,7 +1222,7 @@ 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 Cross/run-* Cross/to-* Cross/from-* Cross/mkdir -rm -rf host rm -f t/test_state rm -f config.sh cppstdin Policy.sh extras.lst @@ -1231,20 +1252,18 @@ _mopup: _tidy: -cd pod; $(LDLIBPTH) $(MAKE) clean -cd utils; $(LDLIBPTH) $(MAKE) clean - -cd x2p; $(LDLIBPTH) $(MAKE) clean -rm -f lib/Config_git.pl git_version.h -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \ - $(MINIPERL) make_ext.pl --target=clean $$x MAKE=$(MAKE) ; \ + $(MINIPERL) make_ext.pl --target=clean $$x MAKE="$(MAKE)" ; \ done _cleaner1: -cd os2; rm -f Makefile -cd pod; $(LDLIBPTH) $(MAKE) $(CLEAN) -cd utils; $(LDLIBPTH) $(MAKE) $(CLEAN) - -cd x2p; $(LDLIBPTH) $(MAKE) $(CLEAN) -@if test -f $(MINIPERL_EXE) ; then \ for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \ - $(MINIPERL) make_ext.pl --target=$(CLEAN) $$x MAKE=$(MAKE) ; \ + $(MINIPERL) make_ext.pl --target=$(CLEAN) $$x MAKE="$(MAKE)" ; \ done ; \ else \ sh $(CLEAN).sh ; \ @@ -1274,8 +1293,8 @@ _cleaner2: rm -rf pod/perlfunc pod/perlipc -rmdir ext/B/lib rm -f so_locations $(LIBPERL_NONSHR) $(MINIPERL_NONSHR) - -rmdir lib/version lib/threads lib/inc/latest lib/inc lib/encoding - -rmdir lib/autodie/exception lib/autodie lib/XS lib/Win32API lib/VMS + -rmdir lib/version lib/threads lib/encoding lib/autodie/exception + -rmdir lib/autodie/Scope lib/autodie lib/XS lib/Win32API lib/VMS -rmdir lib/Unicode/Collate/Locale lib/Unicode/Collate/CJK -rmdir lib/Unicode/Collate lib/Tie/Hash lib/Thread lib/Text -rmdir lib/Test/Builder/Tester lib/Test/Builder lib/Test lib/Term @@ -1286,8 +1305,7 @@ _cleaner2: -rmdir lib/TAP/Formatter lib/TAP lib/Sys/Syslog lib/Sys lib/Search -rmdir lib/Scalar lib/Pod/Text lib/Pod/Simple lib/Pod/Perldoc -rmdir lib/PerlIO/via lib/PerlIO lib/Perl lib/Parse/CPAN lib/Parse - -rmdir lib/Params lib/Package lib/Net/FTP lib/Module/Load - -rmdir lib/Module/CoreList lib/Module/Build/Platform lib/Module/Build + -rmdir lib/Params lib/Net/FTP lib/Module/Load lib/Module/CoreList -rmdir lib/Module lib/Memoize lib/Math/BigInt lib/Math/BigFloat -rmdir lib/Math lib/MIME lib/Locale/Maketext lib/Locale/Codes -rmdir lib/Locale lib/List/Util lib/List lib/JSON/PP lib/JSON lib/IPC @@ -1306,7 +1324,7 @@ _cleaner2: -rmdir lib/Encode lib/Digest lib/Devel lib/Data lib/Config/Perl -rmdir lib/Compress/Raw lib/Compress lib/Carp lib/CPAN/Meta -rmdir lib/CPAN/LWP lib/CPAN/Kwalify lib/CPAN/HTTP lib/CPAN/FTP - -rmdir lib/CPAN/Exception lib/CPAN/API lib/CPAN lib/CGI lib/Attribute + -rmdir lib/CPAN/Exception lib/CPAN/API lib/CPAN lib/Attribute -rmdir lib/Archive/Tar lib/Archive lib/App/Prove/State/Result -rmdir lib/App/Prove/State lib/App/Prove lib/App @@ -1350,8 +1368,8 @@ done $spitshell >>$Makefile <<'!NO!SUBS!' .PHONY: depend -depend: makedepend - sh ./makedepend MAKE=$(MAKE) cflags +depend: makedepend $(DTRACE_H) + sh ./makedepend MAKE="$(MAKE)" cflags .PHONY: test check test_prep test_prep_nodll test_prep_pre \ test_prep_reonly test_tty test-tty test_notty test-notty \ @@ -1367,19 +1385,88 @@ _test: # Architecture-neutral stuff: test_prep_pre: preplibrary utilities $(nonxs_ext) +!NO!SUBS! +case "$targethost" in +'') $spitshell >>$Makefile <<'!NO!SUBS!' test_prep test-prep: test_prep_pre $(MINIPERL_EXE) $(unidatafiles) $(PERL_EXE) \ - $(dynamic_ext) $(TEST_PERL_DLL) runtests x2p/s2p x2p/find2perl \ - $(generated_pods) + $(dynamic_ext) $(TEST_PERL_DLL) runtests $(generated_pods) cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE)) +!NO!SUBS! +;; +*) $spitshell >>$Makefile <>$Makefile <<'!NO!SUBS!' test_prep_reonly: $(MINIPERL_EXE) $(PERL_EXE) $(dynamic_ext_re) $(TEST_PERL_DLL) - $(MINIPERL) make_ext.pl $(dynamic_ext_re) MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic + $(MINIPERL) make_ext.pl $(dynamic_ext_re) MAKE="$(MAKE)" LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE)) +!NO!SUBS! + +case "$targethost" in +'') $spitshell >>$Makefile <<'!NO!SUBS!' test check: test_prep $(RUN_TESTS) choose +!NO!SUBS! +;; +*) $spitshell >>$Makefile <>$Makefile <<'!NO!SUBS!' test_tty test-tty: test_prep $(RUN_TESTS) tty @@ -1399,7 +1486,7 @@ test.valgrind check.valgrind: test_prep @grep "^usemymalloc='n'" config.sh >/dev/null || exit 1 @echo "And of course you have to have valgrind..." $(VALGRIND) $(VG_TEST) || exit 1 - PERL_VALGRIND=1 VALGRIND='$(VALGRIND)' $(RUN_TESTS) choose + PERL_VALGRIND=1 VALGRIND='$(VALGRIND)' TESTFILE=harness $(RUN_TESTS) choose !NO!SUBS! ;; esac @@ -1442,28 +1529,28 @@ test_porting test-porting: test_prep .PHONY: ok okfile oknack okfilenack nok nokfile noknack nokfilenack ok: utilities - $(RUN_PERL) -Ilib utils/perlbug -ok -s '(UNINSTALLED)' + $(RUN_PERL) utils/perlbug -ok -s '(UNINSTALLED)' okfile: utilities - $(RUN_PERL) -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -F perl.ok + $(RUN_PERL) utils/perlbug -ok -s '(UNINSTALLED)' -F perl.ok oknack: utilities - $(RUN_PERL) -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -A + $(RUN_PERL) utils/perlbug -ok -s '(UNINSTALLED)' -A okfilenack: utilities - $(RUN_PERL) -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -F perl.ok -A + $(RUN_PERL) utils/perlbug -ok -s '(UNINSTALLED)' -F perl.ok -A nok: utilities - $(RUN_PERL) -Ilib utils/perlbug -nok -s '(UNINSTALLED)' + $(RUN_PERL) utils/perlbug -nok -s '(UNINSTALLED)' nokfile: utilities - $(RUN_PERL) -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok + $(RUN_PERL) utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok noknack: utilities - $(RUN_PERL) -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -A + $(RUN_PERL) utils/perlbug -nok -s '(UNINSTALLED)' -A nokfilenack: utilities - $(RUN_PERL) -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok -A + $(RUN_PERL) utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok -A .PHONY: clist hlist @@ -1497,44 +1584,6 @@ define) echo "This is an EBCDIC system, checking if any parser files need regenerating." >&2 case "$osname" in os390|posix-bc) - if cd x2p - then - rm -f y.tab.c y.tab.h - case "$osname" in - posix-bc) - # we are using two different yaccs in BS2000 Posix! - byacc a2p.y >/dev/null 2>&1 - ;; - *) # e.g. os390 - yacc a2p.y >/dev/null 2>&1 - ;; - esac - if cmp -s y.tab.c a2p.c - then - rm -f y.tab.c - else - echo "a2p.y -> a2p.c" >&2 - mv -f y.tab.c a2p.c - chmod u+w a2p.c - sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \ - -e 's|^static void __YY_YACC_MAIN.*BS2000.*|/*static main deleted*/|' \ - -e 's/y\.tab/a2p/g' a2p.c >a2p.tmp && mv a2p.tmp a2p.c - xxx="$xxx a2p.c" - fi - # In case somebody yacc -d:ed the a2p.y. - if test -f y.tab.h - then - if cmp -s y.tab.h a2p.h - then - rm -f y.tab.h - else - echo "a2p.h -> a2p.h" >&2 - mv -f y.tab.h a2p.h - xxx="$xxx a2p.h" - fi - fi - cd .. - fi ;; *) echo "'$osname' is an EBCDIC system I don't know that well." >&4