summaryrefslogtreecommitdiff
path: root/Makefile.SH
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-01-07 15:17:15 +0000
committerNicholas Clark <nick@ccl4.org>2010-01-07 15:23:15 +0000
commit0f13ebd5d71f81771c1044e2c89aff29b408bfec (patch)
treee7905ed949213a202098819068aeb41dde20dc79 /Makefile.SH
parent7299ca586a6a78a40081a6e7e2e94c3b1a8aa538 (diff)
downloadperl-0f13ebd5d71f81771c1044e2c89aff29b408bfec.tar.gz
Correct errors in the use of multiple targets, which could break parallel make.
Where a single script (or program) generates multiple files, the Makefile rule was written with those multiple files as targets on the same line. This would be correct if that syntax meant "these $n things are built by these commands". However it doesn't - it means "to build any of these targets, run these commands", and hence to run them once for each of the targets. This can result in race conditions with parallel makes, with files being trampled on and strange failure modes. Hence the correct style is to give one of the targets on the rule, and rules that make all the other targets that are generated depend on that target.
Diffstat (limited to 'Makefile.SH')
-rw-r--r--Makefile.SH12
1 files changed, 9 insertions, 3 deletions
diff --git a/Makefile.SH b/Makefile.SH
index 97df05ad36..0fba695224 100644
--- a/Makefile.SH
+++ b/Makefile.SH
@@ -607,7 +607,9 @@ perlmini\$(OBJ_EXT): perlmini.c
globals\$(OBJ_EXT): uudmap.h bitcount.h
-uudmap.h bitcount.h: generate_uudmap\$(HOST_EXE_EXT)
+uudmap.h: bitcount.h
+
+bitcount.h: generate_uudmap\$(HOST_EXE_EXT)
\$(RUN) ./generate_uudmap\$(HOST_EXE_EXT) uudmap.h bitcount.h
generate_uudmap\$(HOST_EXE_EXT): generate_uudmap\$(OBJ_EXT)
@@ -970,7 +972,9 @@ $spitshell >>$Makefile <<'!NO!SUBS!'
.PHONY: preplibrary
preplibrary: $(MINIPERL_EXE) $(CONFIGPM) lib/re.pm $(PREPLIBRARY_LIBPERL)
-$(CONFIGPM_FROM_CONFIG_SH) $(CONFIGPOD): config.sh $(MINIPERL_EXE) configpm Porting/Glossary lib/Config_git.pl
+$(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)
@@ -1001,7 +1005,9 @@ uni.data: $(MINIPERL_EXE) $(CONFIGPM) lib/unicore/mktables $(nonxs_ext)
pod/perltoc.pod: $(perltoc_pod_prereqs) $(PERL_EXE) $(ext) pod/buildtoc
$(RUN_PERL) -f -Ilib pod/buildtoc --build-toc -q
-pod/perlapi.pod pod/perlintern.pod: $(MINIPERL_EXE) autodoc.pl embed.fnc
+pod/perlapi.pod: pod/perlintern.pod
+
+pod/perlintern.pod: $(MINIPERL_EXE) autodoc.pl embed.fnc
$(MINIPERL) autodoc.pl
pod/perlmodlib.pod: $(MINIPERL_EXE) pod/perlmodlib.PL MANIFEST