From b78ac7159b42a0e0bd59ab07411d2f5ef09e1d7e Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Wed, 12 Jun 2013 14:42:15 +0200 Subject: 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. --- Makefile.SH | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Makefile.SH') 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 -- cgit v1.2.1