summaryrefslogtreecommitdiff
path: root/Makefile.SH
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2013-05-15 20:57:37 +0200
committerNicholas Clark <nick@ccl4.org>2013-05-20 21:50:45 +0200
commit9719c95bf27185afc59c14150d4f052f92217540 (patch)
treecf5f154c527a7ba02b54e3d02a5a503b18e3e606 /Makefile.SH
parentfc40bd89f80e1d94b62f08a3ab57f39ea3333029 (diff)
downloadperl-9719c95bf27185afc59c14150d4f052f92217540.tar.gz
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
Diffstat (limited to 'Makefile.SH')
-rwxr-xr-xMakefile.SH27
1 files changed, 16 insertions, 11 deletions
diff --git a/Makefile.SH b/Makefile.SH
index ee9ea47600..5c9904766a 100755
--- a/Makefile.SH
+++ b/Makefile.SH
@@ -443,9 +443,12 @@ xconfig.h: config_h.SH Cross/config-\$(CROSS_NAME).sh
;;
esac
-SH='Makefile.SH cflags.SH config_h.SH makedepend.SH myconfig.SH runtests.SH pod/Makefile.SH'
-shextract=`echo $SH | sed -e s/\\\.SH//g -e s/_/./g`
+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'
+shextract=`SH_to_target $SH`
## In the following dollars and backticks do not need the extra backslash.
$spitshell >>$Makefile <<!GROK!THIS!
@@ -1400,18 +1403,23 @@ MAKEDEPEND = Makefile makedepend
$(FIRSTMAKEFILE): README $(MAKEDEPEND)
$(MAKE) depend MAKEDEPEND=
+!NO!SUBS!
+
+for f in $SH; do
+ file=`SH_to_target $f`
+ $spitshell >>$Makefile <<!GROK!THIS!
-config.h: config_h.SH config.sh
- $(SHELL) config_h.SH
+$file: $f config.sh
+ \$(SHELL) $f
+!GROK!THIS!
+done
+
+$spitshell >>$Makefile <<'!NO!SUBS!'
.PHONY: depend
depend: makedepend
sh ./makedepend MAKE=$(MAKE) cflags
-# Cannot postpone this until $firstmakefile is ready ;-)
-makedepend: makedepend.SH config.sh
- sh ./makedepend.SH
-
.PHONY: test check test_prep test_prep_nodll test_prep_pre \
test_prep_reonly test_tty test-tty test_notty test-notty \
utest ucheck test.utf8 check.utf8 test.torture torturetest \
@@ -1594,9 +1602,6 @@ hlist: $(h)
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()'