This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #117223] Remove IO::File example from perlfunc
[perl5.git] / Makefile.SH
index ccc857c..ef30479 100755 (executable)
@@ -453,7 +453,7 @@ shextract=`SH_to_target $SH`
 ## In the following dollars and backticks do not need the extra backslash.
 $spitshell >>$Makefile <<!GROK!THIS!
 
-private = preplibrary \$(CONFIGPM) \$(CONFIGPOD) lib/ExtUtils/Miniperl.pm git_version.h lib/buildcustomize.pl
+private = preplibrary \$(CONFIGPM) \$(CONFIGPOD) git_version.h lib/buildcustomize.pl
 
 # Files to be built with variable substitution before miniperl
 # is available.
@@ -684,8 +684,8 @@ generate_uudmap$(OBJ_EXT): mg_raw.h
 generate_uudmap$(HOST_EXE_EXT): generate_uudmap$(OBJ_EXT)
        $(CC) -o generate_uudmap$(EXE_EXT) $(LDFLAGS) generate_uudmap$(OBJ_EXT) $(libs)
 
-perlmain.c: $(MINIPERL_EXE) lib/ExtUtils/Miniperl.pm
-       $(MINIPERL) -Ilib -MExtUtils::Miniperl -e 'writemain(@ARGV)' DynaLoader $(static_ext) > perlmain.c
+perlmain.c: $(MINIPERL_EXE) ext/ExtUtils-Miniperl/pm_to_blib
+       $(MINIPERL) -Ilib -MExtUtils::Miniperl -e 'writemain(\"perlmain.c", @ARGV)' DynaLoader $(static_ext)
 
 # The file ext.libs is a list of libraries that must be linked in
 # for static extensions, e.g. -lm -lgdbm, etc.  The individual
@@ -914,25 +914,6 @@ $(PERL_EXE): $& perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPOR
        -@rm -f miniperl.xok
        $(SHRPENV) $(LDLIBPTH) $(CC) -o perl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
 
-!NO!SUBS!
-
-case "${osname}${osvers}" in
-linux*|darwin*)
-       $spitshell >>$Makefile <<'!NO!SUBS!'
-# Valgrind perl (currently Linux, Darwin only)
-
-perl.valgrind.config: config.sh
-       @echo "Checking usemymalloc='n' in 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) $(VG_TEST) || exit 1
-!NO!SUBS!
-       ;;
-esac   
-
-$spitshell >>$Makefile <<'!NO!SUBS!'
-
 # 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.
@@ -978,9 +959,6 @@ $(CONFIGPM_FROM_CONFIG_SH): $(CONFIGPOD)
 $(CONFIGPOD): config.sh $(MINIPERL_EXE) configpm Porting/Glossary lib/Config_git.pl
        $(MINIPERL) configpm
 
-lib/ExtUtils/Miniperl.pm: miniperlmain.c $(MINIPERL_EXE) minimod.pl $(CONFIGPM)
-       $(MINIPERL) minimod.pl > lib/ExtUtils/Miniperl.pm
-
 unidatafiles $(unidatafiles) pod/perluniprops.pod: uni.data
 
 uni.data: $(MINIPERL_EXE) $(CONFIGPM) lib/unicore/mktables $(nonxs_ext)
@@ -1028,27 +1006,31 @@ 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:
-       $(MAKE) STRIPFLAGS=-s install DESTDIR="$(DESTDIR)"
+# Set this to an empty string to avoid an attempt of rebuild before install
+INSTALL_DEPENDENCE = all
 
-install install_all install-all:
-       $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) DESTDIR="$(DESTDIR)"
+no_install no-install: install-notify
+
+install: install-all
+!NO!SUBS!
 
-install_verbose install-verbose:
-       $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-V DESTDIR="$(DESTDIR)"
+for name in all notify silent strip verbose; do
+    flags="--$name";
+    $spitshell >>$Makefile <<EOT
 
-install_silent install-silent:
-       $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-S DESTDIR="$(DESTDIR)"
+install_$name install-$name: \$(INSTALL_DEPENDENCE) installperl all installman
+       \$(RUN_PERL) installperl --destdir=\$(DESTDIR) ${flags%--all} \$(INSTALLFLAGS) \$(STRIPFLAGS)
+       \$(RUN_PERL) installman --destdir=\$(DESTDIR) ${flags%--all}
+EOT
 
-no_install no-install:
-       $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-n DESTDIR="$(DESTDIR)"
+    test $name = notify || echo '      -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -Ilib -MCPAN -e '\''@ARGV&&install(@ARGV)'\'' `cat extras.lst`' >>$Makefile
+done
 
-# Set this to an empty string to avoid an attempt of rebuild before install
-INSTALL_DEPENDENCE = all
+$spitshell >>$Makefile <<'!NO!SUBS!'
 
 install.perl:  $(INSTALL_DEPENDENCE) installperl
        $(RUN_PERL) installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) $(STRIPFLAGS)
-       -@test ! -s extras.lst || $(MAKE) extras.install
+       -@test ! -s extras.lst || PATH="`pwd`:\${PATH}" PERL5LIB="`pwd`/lib" \$(RUN_PERL) -Ilib -MCPAN -e '@ARGV&&install(@ARGV)' `cat extras.lst`
 
 install.man:   all installman
        $(RUN_PERL) installman --destdir=$(DESTDIR) $(INSTALLFLAGS)
@@ -1247,7 +1229,7 @@ _cleaner2:
        rm -rf t/tmp*
        rm -f so_locations $(LIBPERL_NONSHR) $(MINIPERL_NONSHR)
        rm -rf $(addedbyconf)
-       rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old makefile.old
+       rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old makefile.old utils/Makefile
        rm -f $(private)
        rm -rf $(unidatafiles) $(unidatadirs)
        rm -rf lib/auto
@@ -1378,13 +1360,13 @@ linux*|darwin*)
        $spitshell >>$Makefile <<'!NO!SUBS!'
 # Targets for valgrind testing:
 
-test_prep.valgrind: test_prep perl.valgrind
-
-test.valgrind check.valgrind:  test_prep perl.valgrind.config
+test.valgrind check.valgrind:  test_prep
+       @echo "Checking usemymalloc='n' in 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) $(VG_TEST) || exit 1
        PERL_VALGRIND=1 VALGRIND='$(VALGRIND)' $(RUN_TESTS) choose
-
-test_notty.valgrind: test_prep.valgrind perl.valgrind.config
-       PERL_VALGRIND=1 $(RUN_TESTS) no-tty
 !NO!SUBS!
        ;;
 esac