aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build/bootstrap.make17
-rw-r--r--odb/makefile4
2 files changed, 18 insertions, 3 deletions
diff --git a/build/bootstrap.make b/build/bootstrap.make
index 4eaa564..1372a1e 100644
--- a/build/bootstrap.make
+++ b/build/bootstrap.make
@@ -46,12 +46,27 @@ $(error dist_prefix is not set)
endif
endif
-# Don't include dependency info for certain targets.
+# If we don't have dependency auto-generation then we need to manually
+# make sure that generated files are generated before C++ file are
+# compiler. To do this we make the object files ($2) depend in order-
+# only on generated files ($3).
#
+ifeq ($(cxx_id),generic)
+
+define include-dep
+$(if $2,$(eval $2: | $3))
+endef
+
+else
+
define include-dep
$(call -include,$1)
endef
+endif
+
+# Don't include dependency info for certain targets.
+#
ifneq ($(filter $(MAKECMDGOALS),clean disfigure dist),)
include-dep =
endif
diff --git a/odb/makefile b/odb/makefile
index 15439da..6e8790f 100644
--- a/odb/makefile
+++ b/odb/makefile
@@ -56,8 +56,6 @@ $(odb.l): $(cxx_obj) -lpthread
$(cxx_obj) $(cxx_od): $(odb.l.cpp-options) $(out_base)/details/config.h
$(odb.l.cpp-options): value := -I$(out_root) -I$(src_root)
-$(call include-dep,$(cxx_od))
-
$(out_base)/details/config.h:
@echo '// file : odb/details/config.h' >$@
@echo '// author : automatically generated' >>$@
@@ -69,6 +67,8 @@ $(out_base)/details/config.h:
@echo '' >>$@
@echo '#endif // ODB_DETAILS_CONFIG_H' >>$@
+$(call include-dep,$(cxx_od),$(cxx_obj),$(out_base)/details/config.h)
+
# Convenience alias for default target.
#
$(out_base)/: $(odb.l)