changeset 20389:456c7e4cb34d

use move-if-change for most rules that generate source files * libinterp/corefcn/module.mk, changed libinterp/module.mk: Use move-if-change for rules that generate source files.
author John W. Eaton <jwe@octave.org>
date Wed, 15 Jul 2015 16:57:40 -0400
parents 5e50f25f245a
children e365a34a1c5c
files libinterp/corefcn/module.mk libinterp/module.mk
diffstat 2 files changed, 29 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/module.mk	Wed Jul 15 16:56:50 2015 -0400
+++ b/libinterp/corefcn/module.mk	Wed Jul 15 16:57:40 2015 -0400
@@ -278,13 +278,14 @@
 ## Special rules for FreeType .df files so that not all .df files are built
 ## with FT2_CPPFLAGS, FONTCONFIG_CPPFLAGS
 $(COREFCN_FT2_DF) : libinterp/corefcn/%.df : libinterp/corefcn/%.cc $(GENERATED_MAKE_BUILTINS_INCS)
-	$(AM_V_GEN)rm -f $@-t $@ && \
+	$(AM_V_GEN)rm -f $@-t $@-t1 $@ && \
 	$(CXXCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	  $(libinterp_corefcn_libcorefcn_la_CPPFLAGS) $(CPPFLAGS) \
 	  $(libinterp_corefcn_libcorefcn_la_CXXFLAGS) \
-	  -DMAKE_BUILTINS $< > $@-t && \
-	$(srcdir)/libinterp/mkdefs $(srcdir)/libinterp $< < $@-t > $@ && \
-	rm $@-t
+	  -DMAKE_BUILTINS $< > $@-t1 && \
+	$(srcdir)/libinterp/mkdefs $(srcdir)/libinterp $< < $@-t1 > $@-t && \
+	rm -f $@-t1 && \
+	mv $@-t $@
 
 ## Special rules for sources which must be built before rest of compilation.
 
@@ -295,17 +296,17 @@
 	$(AM_V_GEN)$(do_subst_default_vals)
 
 libinterp/corefcn/graphics.h: libinterp/corefcn/graphics.in.h libinterp/genprops.awk Makefile
-	$(AM_V_GEN)rm -f $@-t $@ && \
+	$(AM_V_GEN)rm -f $@-t && \
 	$(AWK) -f $(srcdir)/libinterp/genprops.awk $< > $@-t && \
-	mv $@-t $@
+	$(simple_move_if_change_rule)
 
 libinterp/corefcn/graphics-props.cc: libinterp/corefcn/graphics.in.h libinterp/genprops.awk Makefile
-	$(AM_V_GEN)rm -f $@-t $@ && \
+	$(AM_V_GEN)rm -f $@-t && \
 	$(AWK) -v emit_graphics_props=1 -f $(srcdir)/libinterp/genprops.awk $< > $@-t && \
-	mv $@-t $@
+	$(simple_move_if_change_rule)
 
 libinterp/corefcn/oct-errno.cc: libinterp/corefcn/oct-errno.in.cc Makefile
-	$(AM_V_GEN)rm -f $@-t $@ && \
+	$(AM_V_GEN)rm -f $@-t && \
 	if test -n "$(PERL)"; then \
 	  $(srcdir)/libinterp/mk-errno-list --perl "$(PERL)" < $< > $@-t; \
 	elif test -n "$(PYTHON)"; then \
@@ -313,24 +314,24 @@
 	else \
 	  $(SED) '/@SYSDEP_ERRNO_LIST@/D' $< > $@-t; \
 	fi && \
-	mv $@-t $@
+	$(simple_move_if_change_rule)
 
 libinterp/corefcn/mxarray.h: libinterp/corefcn/mxarray.in.h Makefile
-	$(AM_V_GEN)rm -f $@-t $@ && \
+	$(AM_V_GEN)rm -f $@-t && \
 	$(SED) < $< \
 	  -e "s|%NO_EDIT_WARNING%|DO NOT EDIT!  Generated automatically from $(<F) by Make.|" \
 	  -e "s|%OCTAVE_IDX_TYPE%|${OCTAVE_IDX_TYPE}|" > $@-t && \
-	mv $@-t $@
+	$(simple_move_if_change_rule)
 
 libinterp/corefcn/oct-tex-lexer.ll: libinterp/corefcn/oct-tex-lexer.in.ll libinterp/corefcn/oct-tex-symbols.in Makefile.am
-	$(AM_V_GEN)rm -f $@-t $@ && \
+	$(AM_V_GEN)rm -f $@-t && \
 	$(AWK) 'BEGIN { print "/* DO NOT EDIT. AUTOMATICALLY GENERATED FROM oct-tex-lexer.in.ll and oct-tex-symbols.in. */"; } /^@SYMBOL_RULES@$$/ { count = 0; while (getline < "$(srcdir)/libinterp/corefcn/oct-tex-symbols.in") { if ($$0 !~ /^#.*/ && NF == 3) { printf("\"\\\\%s\" { yylval->sym = %d; return SYM; }\n", $$1, count); count++; } } getline } ! /^@SYMBOL_RULES@$$/ { print }' $< > $@-t && \
-	mv $@-t $@
+	$(simple_move_if_change_rule)
 
 libinterp/corefcn/oct-tex-symbols.cc: libinterp/corefcn/oct-tex-symbols.in Makefile.am
-	$(AM_V_GEN)rm -f $@-t $@ && \
+	$(AM_V_GEN)rm -f $@-t && \
 	$(AWK) 'BEGIN { print "// DO NOT EDIT. AUTOMATICALLY GENERATED FROM oct-tex-symbols.in."; print "static uint32_t symbol_codes[][2] = {"; count = 0; } END { print "};"; printf("static int num_symbol_codes = %d;\n", count); } !/^#/ && (NF == 3) { printf("  { %s, %s },\n", $$2, $$3); count++; }' $< > $@-t && \
-	mv $@-t $@
+	$(simple_move_if_change_rule)
 
 libinterp/corefcn/txt-eng.cc: libinterp/corefcn/oct-tex-symbols.cc
 libinterp/corefcn/oct-tex-lexer.cc: LEX_OUTPUT_ROOT := lex.octave_tex_
--- a/libinterp/module.mk	Wed Jul 15 16:56:50 2015 -0400
+++ b/libinterp/module.mk	Wed Jul 15 16:57:40 2015 -0400
@@ -222,8 +222,8 @@
 	  $(libinterp_liboctinterp_la_CXXFLAGS) \
 	  -DMAKE_BUILTINS $< > $@-t1 && \
 	$(srcdir)/libinterp/mkdefs $(srcdir)/libinterp $< < $@-t1 > $@-t && \
-	mv $@-t $@ && \
-	rm -f $@-t1
+	rm -f $@-t1 && \
+	mv $@-t $@
 
 ## Rules to build test files
 
@@ -252,12 +252,12 @@
 	$(AM_V_GEN)$(do_subst_config_vals)
 
 libinterp/oct-conf-features.h: $(top_builddir)/config.h libinterp/config-features.sh
-	$(AM_V_GEN)rm -f $@-t $@ && \
+	$(AM_V_GEN)rm -f $@-t && \
 	$(srcdir)/libinterp/config-features.sh $< > $@-t && \
-	mv $@-t $@
+	$(simple_move_if_change_rule)
 
 libinterp/version.h: libinterp/version.in.h Makefile
-	$(AM_V_GEN)rm -f $@-t $@ && \
+	$(AM_V_GEN)rm -f $@-t && \
 	$(SED) < $< \
 	  -e "s|%NO_EDIT_WARNING%|DO NOT EDIT!  Generated automatically from $(<F) by Make.|" \
 	  -e "s|%OCTAVE_API_VERSION%|\"${OCTAVE_API_VERSION}\"|" \
@@ -267,25 +267,25 @@
           -e "s|%OCTAVE_PATCH_VERSION%|${OCTAVE_PATCH_VERSION}|" \
 	  -e "s|%OCTAVE_RELEASE_DATE%|\"${OCTAVE_RELEASE_DATE}\"|" \
 	  -e "s|%OCTAVE_VERSION%|\"${OCTAVE_VERSION}\"|" > $@-t && \
-	mv $@-t $@
+	$(simple_move_if_change_rule)
 
 libinterp/builtins.cc: $(DEF_FILES) libinterp/mkbuiltins
-	$(AM_V_GEN)rm -f $@-t $@ && \
+	$(AM_V_GEN)rm -f $@-t && \
 	$(srcdir)/libinterp/mkbuiltins --source $(DEF_FILES) > $@-t && \
-	mv $@-t $@
+	$(simple_move_if_change_rule)
 
 libinterp/builtin-defun-decls.h: $(SRC_DEF_FILES) libinterp/mkbuiltins
-	$(AM_V_GEN)rm -f $@-t $@ && \
+	$(AM_V_GEN)rm -f $@-t && \
 	$(srcdir)/libinterp/mkbuiltins --header $(SRC_DEF_FILES) > $@-t && \
-	mv $@-t $@
+	$(simple_move_if_change_rule)
 
 if AMCOND_ENABLE_DYNAMIC_LINKING
 DLDFCN_PKG_ADD_FILE = libinterp/dldfcn/PKG_ADD
 
 libinterp/dldfcn/PKG_ADD: $(DLDFCN_DEF_FILES) libinterp/mk-pkg-add
-	$(AM_V_GEN)rm -f $@-t $@ && \
+	$(AM_V_GEN)rm -f $@-t && \
 	$(srcdir)/libinterp/mk-pkg-add $(DLDFCN_DEF_FILES) > $@-t && \
-	mv $@-t $@
+	$(simple_move_if_change_rule)
 endif
 
 if AMCOND_BUILD_DOCS