In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/31a53e79025eb5944553e671a615e60f384fe743?hp=9e7945ee50c30a17a84968fb0c7e5c38223af6f9>
- Log ----------------------------------------------------------------- commit 31a53e79025eb5944553e671a615e60f384fe743 Merge: 9e7945e 8ca91d3 Author: Nicholas Clark <[email protected]> Date: Tue May 21 07:49:29 2013 +0200 Merge the refactoring of x2p's Makefile to blead. commit 8ca91d39a4a96434bc909d710b033c8505e2cde3 Author: Nicholas Clark <[email protected]> Date: Wed May 15 21:48:12 2013 +0200 Simplify x2p's Makefile. Eliminate plexe and plc, which relate to tests for the compiler and were added as part of commit 52cebf5efc9883c7 in May 1988. The compiler was removed by commit de1254415ffeb03b in Sept 2006. The files a2p.man and s2p.man were removed with Perl 5.000. The macros 'public', 'private' and 'util' mirror the structure of the top level Makefile.SH. However, x2p only ever used 'public', so simplify things by inlining the value of 'public' in the only place that uses it. 'addedbyconf' now only contains the value of 'plextract', so use the latter directly in the one place that had used 'addedbyconf'. M x2p/Makefile.SH commit e1da83eac92e1d2253d6b03218386b36cb4bb0af Author: Nicholas Clark <[email protected]> Date: Wed May 15 21:34:21 2013 +0200 Remove rules to delete *.loadmap and *.prelmap files, generated on VM/ESA These rules to clean up properly on VM/ESA were added in Oct 1998 by perforce changes 1961, 1962 and 1963 in the confperl branch. VM/ESA support was removed by commit 043fec90e88a2e23 in Aug 2012. M Cross/Makefile-cross-SH M Makefile.SH M x2p/Makefile.SH commit 6105164f37e277ea0eb5dec4a432b86b49489be1 Author: Nicholas Clark <[email protected]> Date: Wed May 15 21:26:59 2013 +0200 Add x2p/Makefile.SH to the *.SH files processed by the top level Makefile. This makes the top level Makefile responsible for deleting x2p/Makefile. With this, we can eliminate the 'sh' and 'shextract' from x2p's Makefile. M Makefile.SH M x2p/Makefile.SH commit 655e5c9e391de4eef96d3ad88908a53cddbf53e3 Author: Nicholas Clark <[email protected]> Date: Wed May 15 21:17:31 2013 +0200 Remove the now unused 'shlist' Makefile targets. M Makefile.SH M x2p/Makefile.SH commit 9719c95bf27185afc59c14150d4f052f92217540 Author: Nicholas Clark <[email protected]> Date: Wed May 15 20:57:37 2013 +0200 Programmatically generate dependencies for all *.SH files. Previously dependencies for Makefile, config.h and makedepend were explicitly coded into verbatim sections of Makefile.SH, with most of the others being generated by makedepend.SH M Makefile.SH M makedepend.SH commit fc40bd89f80e1d94b62f08a3ab57f39ea3333029 Author: Nicholas Clark <[email protected]> Date: Wed May 15 20:25:47 2013 +0200 Add runtests.SH to the code that generates the targets sh and shextract. The generated Makefile is functionally identical. M Makefile.SH commit c0d271fb2cf4e67f892e8f1b575439d13b73a01f Author: Nicholas Clark <[email protected]> Date: Wed May 15 17:14:50 2013 +0200 Eliminate x2p/cflags.SH. x2p's Makefile can use ../cflags x2p/Makefile is only used on *nix, so this should not present a problem. M MANIFEST M Porting/exec-bit.txt M x2p/Makefile.SH D x2p/cflags.SH commit 3ae7e562a2ff05c27052670c20b7ba3b7005bf7b Author: Nicholas Clark <[email protected]> Date: Wed May 15 19:40:46 2013 +0200 Pass in to makedepend the name(s) of files that all objects depend on. M Makefile.SH M makedepend.SH M x2p/Makefile.SH commit 0ff64a71c493f41b23ddd052a465c3d40c3264f2 Author: Nicholas Clark <[email protected]> Date: Wed May 15 16:54:40 2013 +0200 In the Makefile, generate the value of shextract programmatically. shextract lists the files generated by shell scripts named *.SH which need deleting. Instead of maintaining it by hand, generate it in Makefile.SH from the list of *.SH files. This indirectly eliminates the last reference to F<makedir>. makedir.SH was eliminated by commit ebca06e95b02d1a8 and the reference to makedir.SH in Makefile.SH eliminated by commit 847471027aa42997 (both Sept 2009), but that commit missed that the reference to makedir a few lines later was related. M Makefile.SH commit 417de989d3cb17f83d8a6af00ff4b171a8682c8c Author: Nicholas Clark <[email protected]> Date: Wed May 15 13:01:22 2013 +0200 Defer running makedepend in x2p/ until it's needed. We can run makedepend in x2p/ as part of the regular build process, which means that it can run as part of a parallel make. This gets a slight speedup (0.2s on this system), and increases flexibility on how x2p/Makefile is generated. M Makefile.SH commit 2fea0471858664126bb4c23b75f6bf15c262cd8b Author: Nicholas Clark <[email protected]> Date: Wed May 15 12:49:44 2013 +0200 Add x2p/makefile to the dependencies for targets within x2p/ This will give us more flexibility in when and how we generate it. [x2p/makefile is x2p/GNUmakefile on OS X] M Makefile.SH commit d730c2986a70e4fa953cb2f352b7b5ebf41ea580 Author: Nicholas Clark <[email protected]> Date: Wed May 15 12:33:05 2013 +0200 Remove vestigial *.SH code which can link the extracted file into ../ 4 of the *.SH files have code which links the extracted file into the parent directory if the current directory ends SH. This code dates from Perl 1. It seems that the intent was that the *.SH files could live in a SH/ directory, but that feature was neither used or mentioned in the documentation in Perl 1, and hasn't been used since. M Cross/Makefile-cross-SH M Makefile.SH M makedepend.SH M x2p/Makefile.SH ----------------------------------------------------------------------- Summary of changes: Cross/Makefile-cross-SH | 7 --- MANIFEST | 1 - Makefile.SH | 68 ++++++++++++++++--------------- Porting/exec-bit.txt | 1 - makedepend.SH | 39 +---------------- x2p/Makefile.SH | 35 ++------------- x2p/cflags.SH | 104 ----------------------------------------------- 7 files changed, 43 insertions(+), 212 deletions(-) delete mode 100755 x2p/cflags.SH diff --git a/Cross/Makefile-cross-SH b/Cross/Makefile-cross-SH index e5a14b4..e83cd4c 100644 --- a/Cross/Makefile-cross-SH +++ b/Cross/Makefile-cross-SH @@ -957,7 +957,6 @@ _mopup: -@test -f vms/README_vms.pod && rm -f vms/README_vms.pod -rm -f perl.exp ext.libs extra.pods uni.data opmini.o -rm -f perl.export perl.dll perl.libexp perl.map perl.def - -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 *perl.xok @@ -1281,12 +1280,6 @@ ctags: !NO!SUBS! $eunicefix $Makefile -case `pwd` in -*SH) - $rm -f ../$Makefile - $ln $Makefile ../$Makefile - ;; -esac $rm -f $firstmakefile # Now do any special processing required before building. diff --git a/MANIFEST b/MANIFEST index 7115372..5916b98 100644 --- a/MANIFEST +++ b/MANIFEST @@ -5493,7 +5493,6 @@ x2p/a2p.h Global declarations x2p/a2p.pod Pod for awk to perl translator x2p/a2p.y A yacc grammar for awk x2p/a2py.c Awk compiler, sort of -x2p/cflags.SH A script that emits C compilation flags per file x2p/EXTERN.h Same as above x2p/find2perl.PL A find to perl translator x2p/hash.c Hashes again diff --git a/Makefile.SH b/Makefile.SH index ddb9be1..7502235 100755 --- a/Makefile.SH +++ b/Makefile.SH @@ -443,16 +443,27 @@ xconfig.h: config_h.SH Cross/config-\$(CROSS_NAME).sh ;; esac +SH_to_target() { + echo $@ | sed -e s/\\\.SH//g -e s/_/./g +} + +SH='Makefile.SH cflags.SH config_h.SH makedepend.SH myconfig.SH runtests.SH pod/Makefile.SH x2p/Makefile.SH' +shextract=`SH_to_target $SH` + ## In the following dollars and backticks do not need the extra backslash. -$spitshell >>$Makefile <<'!NO!SUBS!' +$spitshell >>$Makefile <<!GROK!THIS! -private = preplibrary $(CONFIGPM) $(CONFIGPOD) lib/ExtUtils/Miniperl.pm git_version.h lib/buildcustomize.pl +private = preplibrary \$(CONFIGPM) \$(CONFIGPOD) lib/ExtUtils/Miniperl.pm git_version.h lib/buildcustomize.pl # Files to be built with variable substitution before miniperl # is available. -sh = Makefile.SH cflags.SH config_h.SH makedepend.SH myconfig.SH pod/Makefile.SH +sh = $SH + +shextract = $shextract +!GROK!THIS! -shextract = Makefile cflags config.h makedepend makedir myconfig pod/Makefile +## In the following dollars and backticks do not need the extra backslash. +$spitshell >>$Makefile <<'!NO!SUBS!' addedbyconf = UU $(shextract) pstruct @@ -589,18 +600,21 @@ perl$(OBJ_EXT): git_version.h case "$usedl$static_cwd" in defineundef) util_deps='$(MINIPERL_EXE) $(CONFIGPM) lib/auto/Cwd/Cwd$(DLSUFFIX) FORCE' - x2p_deps='$(MINIPERL_EXE) $(CONFIGPM) $(dynamic_ext) FORCE' + x2p_deps="\$(MINIPERL_EXE) \$(CONFIGPM) \$(dynamic_ext) x2p/$firstmakefile FORCE" ;; definedefine) util_deps='$(PERL_EXE) $(CONFIGPM) FORCE' - x2p_deps='$(PERL_EXE) $(CONFIGPM) $(dynamic_ext) FORCE' + x2p_deps="\$(PERL_EXE) \$(CONFIGPM) \$(dynamic_ext) x2p/$firstmakefile FORCE" ;; *) util_deps='$(PERL_EXE) $(CONFIGPM) FORCE' - x2p_deps='$(PERL_EXE) $(CONFIGPM) FORCE' + x2p_deps="\$(PERL_EXE) \$(CONFIGPM) x2p/$firstmakefile FORCE" ;; esac $spitshell >>$Makefile <<!GROK!THIS! +x2p/$firstmakefile: makedepend + cd x2p; \$(MAKE) depend + translators: $x2p_deps @echo " "; echo " Making x2p stuff"; cd x2p; \$(LDLIBPTH) \$(MAKE) all @@ -1271,13 +1285,12 @@ _mopup: -@test -f vms/README_vms.pod && rm -f vms/README_vms.pod -rm -f perl.exp ext.libs $(generated_pods) uni.data opmini.o perlmini.o pod/roffitall -rm -f perl.export perl.dll perl.libexp perl.map perl.def - -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 *perl.xok -rm -f cygwin.c libperl*.def libperl*.dll cygperl*.dll *.exe.stackdump -rm -f $(PERL_EXE) $(MINIPERL_EXE) $(LIBPERL) libperl.* microperl - -rm -f config.arch config.over $(DTRACE_H) runtests + -rm -f config.arch config.over $(DTRACE_H) # Do not 'make _tidy' directly. _tidy: @@ -1389,21 +1402,22 @@ MAKEDEPEND = Makefile makedepend $(FIRSTMAKEFILE): README $(MAKEDEPEND) $(MAKE) depend MAKEDEPEND= +!NO!SUBS! -config.h: config_h.SH config.sh - $(SHELL) config_h.SH +for f in $SH; do + file=`SH_to_target $f` + $spitshell >>$Makefile <<!GROK!THIS! -.PHONY: depend -depend: makedepend - sh ./makedepend MAKE=$(MAKE) - cd x2p; $(MAKE) depend +$file: $f config.sh + \$(SHELL) $f +!GROK!THIS! +done -# Cannot postpone this until $firstmakefile is ready ;-) -makedepend: makedepend.SH config.sh - sh ./makedepend.SH +$spitshell >>$Makefile <<'!NO!SUBS!' -runtests: runtests.SH config.sh - sh ./runtests.SH +.PHONY: depend +depend: makedepend + 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 \ @@ -1576,7 +1590,7 @@ noknack: utilities nokfilenack: utilities $(RUN_PERL) -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok -A -.PHONY: clist hlist shlist +.PHONY: clist hlist clist: $(c) echo $(c) | tr ' ' $(TRNL) >.clist @@ -1584,12 +1598,6 @@ clist: $(c) hlist: $(h) echo $(h) | tr ' ' $(TRNL) >.hlist -shlist: $(sh) - echo $(sh) | tr ' ' $(TRNL) >.shlist - -Makefile: Makefile.SH ./config.sh - $(SHELL) Makefile.SH - .PHONY: distcheck distcheck: FORCE perl '-MExtUtils::Manifest=&fullcheck' -e 'fullcheck()' @@ -1604,12 +1612,6 @@ ctags: !NO!SUBS! $eunicefix Makefile -case `pwd` in -*SH) - $rm -f ../Makefile - $ln Makefile ../Makefile - ;; -esac $rm -f $firstmakefile # Now do any special processing required before building. diff --git a/Porting/exec-bit.txt b/Porting/exec-bit.txt index e2f445b..0073e77 100644 --- a/Porting/exec-bit.txt +++ b/Porting/exec-bit.txt @@ -27,7 +27,6 @@ runtests.SH t/TEST vms/ext/filespec.t x2p/Makefile.SH -x2p/cflags.SH Porting/Maintainers.pl Porting/add-package.pl Porting/bisect.pl diff --git a/makedepend.SH b/makedepend.SH index 5669b8d..f992af3 100755 --- a/makedepend.SH +++ b/makedepend.SH @@ -39,7 +39,7 @@ mkdir .depending # This script should be called with # sh ./makedepend MAKE=$(MAKE) case "$1" in - MAKE=*) eval $1 ;; + MAKE=*) eval $1; shift ;; esac export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh \$0; kill \$\$) @@ -206,35 +206,12 @@ for file in `$cat .clist`; do -e 's|\.c\.c|.c|' $uwinfix .cout .cerr| \ $uniq | $sort | $uniq >> .deptmp fi - echo "$filebase\$(OBJ_EXT): cflags" >> .deptmp + echo "$filebase\$(OBJ_EXT): $@" >> .deptmp done $sed <$mf >$mf.new -e '1,/^# AUTOMATICALLY/!d' -$MAKE shlist || ($echo "Searching for .SH files..."; \ - $echo *.SH | $tr ' ' $trnl | $egrep -v '\*' >.shlist) - -# Now extract the dependencies on makedepend.SH and Makefile.SH -# (they should reside in the main Makefile): -rm -f .shlist.old -mv .shlist .shlist.old -$egrep -v '^makedepend\.SH' <.shlist.old >.shlist -rm -f .shlist.old -mv .shlist .shlist.old -$egrep -v '^Makefile\.SH' <.shlist.old >.shlist -rm -f .shlist.old -mv .shlist .shlist.old -$egrep -v '^perl_exp\.SH' <.shlist.old >.shlist -rm -f .shlist.old -mv .shlist .shlist.old -$egrep -v '^config_h\.SH' <.shlist.old >.shlist -rm .shlist.old - if $test -s .deptmp; then - for file in `cat .shlist`; do - $echo `$expr X$file : 'X\(.*\).SH'`: $file $TOP/config.sh \; \ - $sh $file >> .deptmp - done $echo "Updating $mf..." $echo "# If this runs make out of memory, delete /usr/include lines." \ >> $mf.new @@ -262,10 +239,6 @@ else $sed -f .hsed >> $mf.new <.deptmp $sed -n 's|h:#include "\(.*\)".*$|h: \1|p' | \ $sed -f .hsed >> $mf.new - for file in `$cat .shlist`; do - $echo `$expr X$file : 'X\(.*\).SH'`: $file $TOP/config.sh \; \ - $sh $file >> $mf.new - done fi $rm -f $mf.old $cp $mf $mf.old @@ -273,15 +246,9 @@ $rm -f $mf $cp $mf.new $mf $rm $mf.new $echo "# WARNING: Put nothing here or make depend will gobble it up!" >> $mf -$rm -rf .deptmp UU .shlist .clist .hlist .hsed .cout .cerr +$rm -rf .deptmp UU .clist .hlist .hsed .cout .cerr rmdir .depending !NO!SUBS! $eunicefix makedepend chmod +x makedepend -case `pwd` in -*SH) - $rm -f ../makedepend - ln makedepend ../makedepend - ;; -esac diff --git a/x2p/Makefile.SH b/x2p/Makefile.SH index 3f16623..ae017b6 100755 --- a/x2p/Makefile.SH +++ b/x2p/Makefile.SH @@ -77,26 +77,10 @@ PERL = $perl cat >>Makefile <<'!NO!SUBS!' REALPERL = ../perl -CCCMD = `sh $(shellflags) cflags "optimize='$(OPTIMIZE)'" $@` - -public = a2p$(EXE_EXT) s2p find2perl - -private = - -manpages = a2p.man s2p.man - -util = - -sh = Makefile.SH cflags.SH -shextract = Makefile cflags +CCCMD = `sh $(shellflags) ../cflags "optimize='$(OPTIMIZE)'" $@` pl = find2perl.PL s2p.PL plextract = find2perl s2p -plexe = find2perl.exe s2p.exe -plc = find2perl.c s2p.c -plm = a2p.loadmap - -addedbyconf = $(shextract) $(plextract) h = EXTERN.h INTERN.h ../config.h ../handy.h hash.h a2p.h str.h util.h @@ -110,7 +94,7 @@ lintflags = -phbvxac .c$(OBJ_EXT): $(CCCMD) -DPERL_FOR_X2P $*.c -all: $(public) $(private) $(util) +all: a2p$(EXE_EXT) s2p find2perl @echo " " a2p$(EXE_EXT): $(obj) a2p$(OBJ_EXT) @@ -149,13 +133,13 @@ a2p$(OBJ_EXT): a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h \ $(CCCMD) a2p.c clean: - rm -f a2p$(EXE_EXT) psed *$(OBJ_EXT) $(plexe) $(plc) $(plm) + rm -f a2p$(EXE_EXT) psed *$(OBJ_EXT) $(plexe) $(plc) distclean: veryclean realclean: clean -rmdir .depending - rm -f core $(addedbyconf) all + rm -f core $(plextract) all rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old makefile.old veryclean: realclean @@ -170,7 +154,7 @@ lint: lint $(lintflags) $(defs) $(c) > a2p.fuzz depend: ../makedepend - sh ../makedepend MAKE=$(MAKE) + sh ../makedepend MAKE=$(MAKE) ../cflags clist: echo $(c) | tr ' ' $(TRNL) >.clist @@ -178,9 +162,6 @@ clist: hlist: echo $(h) | tr ' ' $(TRNL) >.hlist -shlist: - echo $(sh) | tr ' ' $(TRNL) >.shlist - $(plextract): $(RUN) $(PERL) -I../lib [email protected] @@ -194,10 +175,4 @@ $(obj): makedepend: depend !NO!SUBS! $eunicefix Makefile -case `pwd` in -*SH) - $rm -f ../Makefile - $ln Makefile ../Makefile - ;; -esac rm -f $firstmakefile diff --git a/x2p/cflags.SH b/x2p/cflags.SH deleted file mode 100755 index caeb336..0000000 --- a/x2p/cflags.SH +++ /dev/null @@ -1,104 +0,0 @@ -#!/bin/sh - -case $PERL_CONFIG_SH in -'') - if test -f config.sh; then TOP=.; - elif test -f ../config.sh; then TOP=..; - elif test -f ../../config.sh; then TOP=../..; - elif test -f ../../../config.sh; then TOP=../../..; - elif test -f ../../../../config.sh; then TOP=../../../..; - else - echo "Can't find config.sh."; exit 1 - fi - . $TOP/config.sh - ;; -esac -: 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. -case "$0" in -*/cflags.SH) cd `expr X$0 : 'X\(.*\)/'` ;; -cflags.SH) ;; -*) case `pwd` in - */x2p) ;; - *) if test -d x2p; then cd x2p - else echo "Can't figure out where to write output."; exit 1 - fi;; - esac;; -esac -echo "Extracting x2p/cflags (with variable substitutions)" -: This section of the file will have variable substitutions done on it. -: Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!. -: Protect any dollar signs and backticks that you do not want interpreted -: by putting a backslash in front. You may delete these comments. -rm -f cflags -$spitshell >cflags <<!GROK!THIS! -!GROK!THIS! - -: In the following dollars and backticks do not need the extra backslash. -$spitshell >>cflags <<'!NO!SUBS!' -case $PERL_CONFIG_SH in -'') - if test -f config.sh; then TOP=.; - elif test -f ../config.sh; then TOP=..; - elif test -f ../../config.sh; then TOP=../..; - elif test -f ../../../config.sh; then TOP=../../..; - elif test -f ../../../../config.sh; then TOP=../../../..; - else - echo "Can't find config.sh."; exit 1 - fi - . $TOP/config.sh - ;; -esac - -case "X$1" in -Xoptimize=*|X"optimize=*") - eval "$1" - shift - ;; -esac - -also=': ' -case $# in -1) also='echo 1>&2 " CCCMD = "' -esac - -case $# in -0) set *.c; echo "The current C flags are:" ;; -esac - -set `echo "$* " | sed -e 's/\.[oc] / /g' -e 's/\.obj / /g' -e "s/\\$obj_ext / /g"` - -for file do - - case "$#" in - 1) ;; - *) echo $n " $file.c $c" ;; - esac - - : allow variables like str_cflags to be evaluated - - eval 'eval ${'"${file}_cflags"'-""}' - - : or customize here - - case "$file" in - a2p) ;; - a2py) ;; - hash) ;; - str) ;; - util) ;; - walk) ;; - *) ;; - esac - - ccflags="`echo $ccflags | sed -e 's/-DMULTIPLICITY//'`" - - echo "$cc -c $ccflags $optimize" - eval "$also "'"$cc -c $ccflags $optimize"' - - . $TOP/config.sh - -done -!NO!SUBS! -chmod 755 cflags -$eunicefix cflags -- Perl5 Master Repository
