summaryrefslogtreecommitdiff
path: root/Makefile.SH
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2013-06-12 14:42:15 +0200
committerNicholas Clark <nick@ccl4.org>2013-06-13 15:19:21 +0200
commitb78ac7159b42a0e0bd59ab07411d2f5ef09e1d7e (patch)
tree402f6c1ac5e8d7abfa1ae5a6d81f06d06506cdf9 /Makefile.SH
parentf6b3c354c9a2b091250502d4d877969b8a1185a0 (diff)
downloadperl-b78ac7159b42a0e0bd59ab07411d2f5ef09e1d7e.tar.gz
write_buildcustomize.pl no longer writes to STDOUT
write_buildcustomize.pl now opens lib/buildcustomize.pl itself, instead of writing to STDOUT and relying on the Makefile to set up redirection. This means that an empty lib/buildcustomize.pl is not created if write_buildcustomize.pl fails to compile (for whatever reason), and permits write_buildcustomize.pl to delete (or attempt to delete) the output file if it detects an error. Hard code the output file name (lib/buildcustomize.pl), as it's the same on all platforms, and @ARGV is already used to optionally pass a directory for write_buildcustomize.pl to change to before running. Experimentation suggests that various make utilities don't delete a file created by redirection even if an error occurs. Hence this should be more robust. Add -f to the miniperl commandline when running write_buildcustomize.pl to avoid reading in any existing lib/buildcustomize.pl. write_buildcustomize.pl doesn't need the setup provided by lib/buildcustomize.pl, and running it might cause errors which prevents writing out a correct version, making an incomplete build harder to recover from.
Diffstat (limited to 'Makefile.SH')
-rwxr-xr-xMakefile.SH14
1 files changed, 7 insertions, 7 deletions
diff --git a/Makefile.SH b/Makefile.SH
index 17707a1f70..cac96e72e4 100755
--- a/Makefile.SH
+++ b/Makefile.SH
@@ -866,15 +866,15 @@ $(MINIPERL_EXE): lib/buildcustomize.pl
lib/buildcustomize.pl: $& $(mini_obj)
$(CC) -o $(MINIPERL_EXE) $(CLDFLAGS) $(mini_obj) $(libs)
$(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
- $(MINIPERL) write_buildcustomize.pl >lib/buildcustomize.pl
+ $(MINIPERL) -f write_buildcustomize.pl
!NO!SUBS!
;;
next4*)
$spitshell >>$Makefile <<'!NO!SUBS!'
-lib/buildcustomize.pl: $& $(mini_obj) write_buildcustomize.pl
- $(CC) -o $(MINIPERL_EXE) $(mini_obj) $(libs)
- $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
- $(MINIPERL) write_buildcustomize.pl >lib/buildcustomize.pl
+lib/buildcustomize.pl: $& $(mini_obj) write ldcustomize.pl
+ $(CC) -o $(MINIPERL_EXE) $(mini_obj libs)
+ $(LDLIBPTH) $(RUN) ./miniperl$(HOST _EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
+ $(MINIPERL) -f write_buildcustomize.pl
!NO!SUBS!
;;
darwin*)
@@ -896,7 +896,7 @@ lib/buildcustomize.pl: $& $(mini_obj) write_buildcustomize.pl
$(CC) $(CLDFLAGS) $(NAMESPACEFLAGS) -o $(MINIPERL_EXE) \
$(mini_obj) $(libs)
$(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
- $(MINIPERL) write_buildcustomize.pl >lib/buildcustomize.pl
+ $(MINIPERL) -f write_buildcustomize.pl
!NO!SUBS!
;;
*)
@@ -906,7 +906,7 @@ lib/buildcustomize.pl: $& $(mini_obj) write_buildcustomize.pl
$(LDLIBPTH) $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
$(mini_obj) $(libs)
$(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
- $(MINIPERL) write_buildcustomize.pl >lib/buildcustomize.pl
+ $(MINIPERL) -f write_buildcustomize.pl
!NO!SUBS!
;;
esac