changeset 19913:7575048a555b

build: Declare dependencies between generated sources (bug #44383) * libinterp/Makefile.am (GENERATED_MAKE_BUILTINS_INCS): New variable containing a subset of BUILT_SOURCES. (BUILT_SOURCES): Factor out files in GENERATED_MAKE_BUILTINS_INCS and sort remaining list. (%.df:%.cc): Depend on GENERATED_MAKE_BUILTINS_INCS. * libinterp/corefcn/module.mk (COREFCN_FT2_DF): Likewise. * libinterp/octave-value/module.mk (OV_JAVA_DF): Likewise.
author Mike Miller <mtmiller@ieee.org>
date Fri, 27 Feb 2015 23:54:17 -0500
parents 12ecb7212b44
children 2350fc8ba960
files libinterp/Makefile.am libinterp/corefcn/module.mk libinterp/octave-value/module.mk
diffstat 3 files changed, 19 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/Makefile.am	Fri Feb 27 19:44:28 2015 -0500
+++ b/libinterp/Makefile.am	Fri Feb 27 23:54:17 2015 -0500
@@ -41,27 +41,30 @@
 
 octlib_LTLIBRARIES = liboctinterp.la
 
-## Order matters here.  Leave builtins.cc last, because it depends on
-## $(DEF_FILES), and building those requires all the sources
-## (except builtins.cc) to be available.
-BUILT_SOURCES = \
-  corefcn/mxarray.h \
-  corefcn/oct-errno.cc \
+## This is the subset of $(BUILT_SOURCES) that may be included by source
+## files that are preprocessed to make $(DEF_FILES).  This ensures that
+## files in $(BUILT_SOURCES) are built in the right dependency order.
+GENERATED_MAKE_BUILTINS_INCS = \
   corefcn/defaults.h \
   corefcn/graphics-props.cc \
   corefcn/graphics.h \
+  corefcn/mxarray.h \
+  oct-conf-features.h \
+  oct-conf.h \
+  parse-tree/oct-gperf.h \
+  version.h
+
+BUILT_SOURCES = \
+  $(GENERATED_MAKE_BUILTINS_INCS) \
+  builtin-defun-decls.h \
+  builtins.cc \
+  corefcn/oct-errno.cc \
   corefcn/oct-tex-lexer.cc \
   corefcn/oct-tex-parser.cc \
   corefcn/oct-tex-symbols.cc \
   operators/ops.cc \
   parse-tree/lex.cc \
-  parse-tree/oct-gperf.h \
-  parse-tree/oct-parse.cc \
-  oct-conf.h \
-  oct-conf-features.h \
-  version.h \
-  builtin-defun-decls.h \
-  builtins.cc
+  parse-tree/oct-parse.cc
 
 ULT_PARSER_SRC := \
   corefcn/oct-tex-lexer.in.ll \
@@ -238,7 +241,7 @@
 ## Rule to build a DEF file from a .cc file
 ## See also module.mk files for overrides when speciall CPPFLAGS are needed.
 ## FIXME: Shouldn't the build stop if CPP fails here?  Yes (10/31/2013)
-%.df: %.cc
+%.df: %.cc $(GENERATED_MAKE_BUILTINS_INCS)
 	$(AM_V_GEN)rm -f $@-t $@-t1 $@ && \
 	$(CXXCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	  $(AM_CPPFLAGS) $(LLVM_CPPFLAGS) $(CPPFLAGS) \
--- a/libinterp/corefcn/module.mk	Fri Feb 27 19:44:28 2015 -0500
+++ b/libinterp/corefcn/module.mk	Fri Feb 27 23:54:17 2015 -0500
@@ -286,7 +286,7 @@
 
 ## Special rules for FreeType .df files so that not all .df files are built
 ## with FT2_CPPFLAGS, FONTCONFIG_CPPFLAGS
-$(COREFCN_FT2_DF) : corefcn/%.df : corefcn/%.cc
+$(COREFCN_FT2_DF) : corefcn/%.df : corefcn/%.cc $(GENERATED_MAKE_BUILTINS_INCS)
 	$(AM_V_GEN)rm -f $@-t $@ && \
 	$(CXXCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	  $(AM_CPPFLAGS) $(FONTCONFIG_CPPFLAGS) $(FT2_CPPFLAGS) $(CPPFLAGS) \
--- a/libinterp/octave-value/module.mk	Fri Feb 27 19:44:28 2015 -0500
+++ b/libinterp/octave-value/module.mk	Fri Feb 27 23:54:17 2015 -0500
@@ -137,7 +137,7 @@
 
 ## Special rules for Java .df files so that not all .df files are built with
 ## JAVA_CPPFLAGS
-$(OV_JAVA_DF) : octave-value/%.df : octave-value/%.cc
+$(OV_JAVA_DF) : octave-value/%.df : octave-value/%.cc $(GENERATED_MAKE_BUILTINS_INCS)
 	$(AM_V_GEN)rm -f $@-t $@-t1 $@ && \
 	$(CXXCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	  $(AM_CPPFLAGS) $(JAVA_CPPFLAGS) $(CPPFLAGS) \