From: Nicholas Clark Date: Sun, 20 Sep 2009 12:15:28 +0000 (+0100) Subject: Adopt Makefile macros MINIPERL_EXE and MINIPERL from VMS, to reduce copy&paste. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=199863e7695677ad5c17a1011983f3a2354d23b1;p=p5sagit%2Fp5-mst-13.2.git Adopt Makefile macros MINIPERL_EXE and MINIPERL from VMS, to reduce copy&paste. '$(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib' becomes '$(MINIPERL)' 'miniperl$(EXE_EXT)' becomes '$(MINIPERL_EXE)' --- diff --git a/Makefile.SH b/Makefile.SH index 8fd6a28..f9f9984 100644 --- a/Makefile.SH +++ b/Makefile.SH @@ -302,6 +302,11 @@ LIB_EXT = $_a OBJ_EXT = $_o PATH_SEP = $p_ +# Macros to invoke a copy of miniperl during the build. Targets which +# are built using these macros should depend on \$(MINIPERL_EXE) +MINIPERL_EXE = miniperl\$(EXE_EXT) +MINIPERL = \$(LDLIBPTH) \$(RUN) ./miniperl\$(EXE_EXT) -Ilib + # dynamic_ext = $dynamic_list static_ext = $static_list @@ -537,22 +542,22 @@ splintfiles = $(c1) .c.s: $(CCCMDSRC) -S $*.c -all: $(FIRSTMAKEFILE) miniperl$(EXE_EXT) miniperl $(generated_pods) $(private) $(unidatafiles) $(public) $(dynamic_ext) $(nonxs_ext) extras.make +all: $(FIRSTMAKEFILE) $(MINIPERL_EXE) miniperl $(generated_pods) $(private) $(unidatafiles) $(public) $(dynamic_ext) $(nonxs_ext) extras.make @echo " "; @echo " Everything is up to date. Type '$(MAKE) test' to run test suite." .PHONY: all translators utilities -lib/Config_git.pl git_version.h: miniperl$(EXE_EXT) make_patchnum.pl - $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_patchnum.pl +lib/Config_git.pl git_version.h: $(MINIPERL_EXE) make_patchnum.pl + $(MINIPERL) make_patchnum.pl # make sure that we recompile perl.c if the git version changes perl$(OBJ_EXT): git_version.h -translators: miniperl$(EXE_EXT) $(CONFIGPM) $(dynamic_ext) FORCE +translators: $(MINIPERL_EXE) $(CONFIGPM) $(dynamic_ext) FORCE @echo " "; echo " Making x2p stuff"; cd x2p; $(LDLIBPTH) $(MAKE) all -utilities: miniperl$(EXE_EXT) $(CONFIGPM) $(plextract) FORCE +utilities: $(MINIPERL_EXE) $(CONFIGPM) $(plextract) FORCE @echo " "; echo " Making utilities"; cd utils; $(LDLIBPTH) $(MAKE) all @@ -654,7 +659,7 @@ LIBPERLEXPORT = perl.exp ;; *) $spitshell >>$Makefile <<'!NO!SUBS!' -MINIPERLEXP = miniperl$(EXE_EXT) +MINIPERLEXP = $(MINIPERL_EXE) PERLEXPORT = perl.exp @@ -762,8 +767,8 @@ $(LIBPERL): $& $(obj) $(DYNALOADER) $(LIBPERLEXPORT) case "${osname}${osvers}" in aix*|beos*) $spitshell >>$Makefile <<'!NO!SUBS!' -miniperl$(EXE_EXT): $& miniperlmain$(OBJ_EXT) $(mini_obj) opmini$(OBJ_EXT) perlmini$(OBJ_EXT) - $(CC) -o miniperl$(EXE_EXT) $(CLDFLAGS) \ +$(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) $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '' || $(MAKE) minitest @@ -771,8 +776,8 @@ miniperl$(EXE_EXT): $& miniperlmain$(OBJ_EXT) $(mini_obj) opmini$(OBJ_EXT) perlm ;; next4*) $spitshell >>$Makefile <<'!NO!SUBS!' -miniperl$(EXE_EXT): $& miniperlmain$(OBJ_EXT) $(mini_obj) perlmini$(OBJ_EXT) opmini$(OBJ_EXT) - $(CC) -o miniperl$(EXE_EXT) $(mini_obj) \ +$(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) $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '' || $(MAKE) minitest !NO!SUBS! @@ -791,9 +796,9 @@ NAMESPACEFLAGS = -force_flat_namespace ;; esac $spitshell >>$Makefile <<'!NO!SUBS!' -miniperl$(EXE_EXT): $& miniperlmain$(OBJ_EXT) $(mini_obj) opmini$(OBJ_EXT) perlmini$(OBJ_EXT) +$(MINIPERL_EXE): $& miniperlmain$(OBJ_EXT) $(mini_obj) opmini$(OBJ_EXT) perlmini$(OBJ_EXT) -@rm -f miniperl.xok - $(CC) $(CLDFLAGS) $(NAMESPACEFLAGS) -o miniperl$(EXE_EXT) \ + $(CC) $(CLDFLAGS) $(NAMESPACEFLAGS) -o $(MINIPERL_EXE) \ $(mini_obj) \ miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perlmini$(OBJ_EXT) $(libs) $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '' || $(MAKE) minitest @@ -801,9 +806,9 @@ miniperl$(EXE_EXT): $& miniperlmain$(OBJ_EXT) $(mini_obj) opmini$(OBJ_EXT) perlm ;; *) $spitshell >>$Makefile <<'!NO!SUBS!' -miniperl$(EXE_EXT): $& miniperlmain$(OBJ_EXT) $(mini_obj) opmini$(OBJ_EXT) perlmini$(OBJ_EXT) +$(MINIPERL_EXE): $& miniperlmain$(OBJ_EXT) $(mini_obj) opmini$(OBJ_EXT) perlmini$(OBJ_EXT) -@rm -f miniperl.xok - $(LDLIBPTH) $(CC) $(CLDFLAGS) -o miniperl$(EXE_EXT) \ + $(LDLIBPTH) $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \ $(mini_obj) \ miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perlmini$(OBJ_EXT) $(libs) $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '' || $(MAKE) minitest @@ -928,9 +933,9 @@ case "${osname}" in catamount) $spitshell >>$Makefile <>$Makefile <<'!NO!SUBS!' .PHONY: makeppport -makeppport: miniperl$(EXE_EXT) $(CONFIGPM) $(nonxs_ext) - $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib $(Icwd) mkppport +makeppport: $(MINIPERL_EXE) $(CONFIGPM) $(nonxs_ext) + $(MINIPERL) $(Icwd) mkppport !NO!SUBS! ;; @@ -948,29 +953,29 @@ esac $spitshell >>$Makefile <<'!NO!SUBS!' .PHONY: preplibrary -preplibrary: miniperl$(EXE_EXT) $(CONFIGPM) lib/re.pm $(PREPLIBRARY_LIBPERL) +preplibrary: $(MINIPERL_EXE) $(CONFIGPM) lib/re.pm $(PREPLIBRARY_LIBPERL) -$(CONFIGPM_FROM_CONFIG_SH) $(CONFIGPOD): config.sh miniperl$(EXE_EXT) configpm Porting/Glossary lib/Config_git.pl - $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib configpm +$(CONFIGPM_FROM_CONFIG_SH) $(CONFIGPOD): config.sh $(MINIPERL_EXE) configpm Porting/Glossary lib/Config_git.pl + $(MINIPERL) configpm -lib/ExtUtils/Miniperl.pm: miniperlmain.c miniperl$(EXE_EXT) minimod.pl $(CONFIGPM) - $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) minimod.pl > lib/ExtUtils/Miniperl.pm +lib/ExtUtils/Miniperl.pm: miniperlmain.c $(MINIPERL_EXE) minimod.pl $(CONFIGPM) + $(MINIPERL) minimod.pl > lib/ExtUtils/Miniperl.pm lib/re.pm: ext/re/re.pm @-rm -f $@ cp ext/re/re.pm lib/re.pm -$(plextract): miniperl$(EXE_EXT) $(CONFIGPM) x2p/s2p $(dynamic_ext) +$(plextract): $(MINIPERL_EXE) $(CONFIGPM) x2p/s2p $(dynamic_ext) @-rm -f $@ - $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib $@.PL + $(MINIPERL) $@.PL -x2p/s2p: miniperl$(EXE_EXT) $(CONFIGPM) $(dynamic_ext) x2p/s2p.PL +x2p/s2p: $(MINIPERL_EXE) $(CONFIGPM) $(dynamic_ext) x2p/s2p.PL cd x2p; $(LDLIBPTH) $(MAKE) s2p unidatafiles $(unidatafiles): uni.data -uni.data: miniperl$(EXE_EXT) $(CONFIGPM) lib/unicore/mktables $(nonxs_ext) - $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib -Iext/Cwd/lib lib/unicore/mktables -C lib/unicore -w +uni.data: $(MINIPERL_EXE) $(CONFIGPM) lib/unicore/mktables $(nonxs_ext) + $(MINIPERL) -Iext/Cwd/lib lib/unicore/mktables -C lib/unicore -w touch uni.data # perl$(EXE_EXT) and ext because buildtoc uses Text::Wrap uses re @@ -979,16 +984,16 @@ uni.data: miniperl$(EXE_EXT) $(CONFIGPM) lib/unicore/mktables $(nonxs_ext) pod/perltoc.pod: $(perltoc_pod_prereqs) perl$(EXE_EXT) $(ext) pod/buildtoc $(LDLIBPTH) $(RUN) ./perl$(EXE_EXT) -f -Ilib pod/buildtoc --build-toc -q -pod/perlapi.pod pod/perlintern.pod: miniperl$(EXE_EXT) autodoc.pl embed.fnc - $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib autodoc.pl +pod/perlapi.pod pod/perlintern.pod: $(MINIPERL_EXE) autodoc.pl embed.fnc + $(MINIPERL) autodoc.pl -pod/perlmodlib.pod: miniperl$(EXE_EXT) pod/perlmodlib.PL MANIFEST - $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib $(Icwd) pod/perlmodlib.PL -q +pod/perlmodlib.pod: $(MINIPERL_EXE) pod/perlmodlib.PL MANIFEST + $(MINIPERL) $(Icwd) pod/perlmodlib.PL -q pod/perldelta.pod: pod/perl5110delta.pod $(LNS) perl5110delta.pod pod/perldelta.pod -extra.pods: miniperl$(EXE_EXT) +extra.pods: $(MINIPERL_EXE) -@test ! -f extra.pods || rm -f `cat extra.pods` -@rm -f extra.pods -@for x in `grep -l '^=[a-z]' README.* | grep -v README.vms` ; do \ @@ -1010,7 +1015,7 @@ extras.install: perl$(EXE_EXT) no-install install.perl install.man install.html META.yml: Porting/makemeta Porting/Maintainers.pl Porting/Maintainers.pm - $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib Porting/makemeta + $(MINIPERL) Porting/makemeta install-strip: $(MAKE) STRIPFLAGS=-s install DESTDIR="$(DESTDIR)" @@ -1132,17 +1137,17 @@ manicheck: FORCE # # DynaLoader may be needed for extensions that use Makefile.PL. -$(DYNALOADER): miniperl$(EXE_EXT) preplibrary FORCE $(nonxs_ext) - $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS) +$(DYNALOADER): $(MINIPERL_EXE) preplibrary FORCE $(nonxs_ext) + $(MINIPERL) make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS) -d_dummy $(dynamic_ext): miniperl$(EXE_EXT) preplibrary makeppport $(DYNALOADER) FORCE - $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic +d_dummy $(dynamic_ext): $(MINIPERL_EXE) preplibrary makeppport $(DYNALOADER) FORCE + $(MINIPERL) make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic -s_dummy $(static_ext): miniperl$(EXE_EXT) preplibrary makeppport $(DYNALOADER) FORCE - $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS) +s_dummy $(static_ext): $(MINIPERL_EXE) preplibrary makeppport $(DYNALOADER) FORCE + $(MINIPERL) make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS) -n_dummy $(nonxs_ext): miniperl$(EXE_EXT) preplibrary FORCE - $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) +n_dummy $(nonxs_ext): $(MINIPERL_EXE) preplibrary FORCE + $(MINIPERL) make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) !NO!SUBS! $spitshell >>$Makefile <