From 11f040de1c8bfd258e805159a223aeafb2706fa6 Mon Sep 17 00:00:00 2001 From: hanwen Date: Thu, 22 May 2014 09:21:53 +0200 Subject: [PATCH] Make object files depend on out/config.hh. This is needed to ensure that out/config.h is copied there before C++ compilation starts. Most of lilypond already depends on config.h, through std-vector.h. --- stepmake/stepmake/executable-rules.make | 4 +++- stepmake/stepmake/help2man-rules.make | 1 + stepmake/stepmake/library-rules.make | 4 +++- stepmake/stepmake/shared-library-rules.make | 3 ++- stepmake/stepmake/test-rules.make | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/stepmake/stepmake/executable-rules.make b/stepmake/stepmake/executable-rules.make index d2950ed0cd..785be9ef6f 100644 --- a/stepmake/stepmake/executable-rules.make +++ b/stepmake/stepmake/executable-rules.make @@ -6,6 +6,8 @@ endef $(foreach a, $(MODULE_LIBS), $(eval $(call MODULE_LIB_template,$(a)))) -$(EXECUTABLE): $(outdir)/config.hh $(O_FILES) $(outdir)/version.hh $(MODULE_LIBS:%=%/$(outdir)/library.a) +$(O_FILES): $(outdir)/config.hh + +$(EXECUTABLE): $(O_FILES) $(outdir)/version.hh $(MODULE_LIBS:%=%/$(outdir)/library.a) $(foreach a, $(MODULE_LIBS), $(MAKE) -C $(a) && ) true $(LD) -o $@ $(O_FILES) $(LOADLIBES) $(ALL_LDFLAGS) diff --git a/stepmake/stepmake/help2man-rules.make b/stepmake/stepmake/help2man-rules.make index 6c176bac5e..9e2f042128 100644 --- a/stepmake/stepmake/help2man-rules.make +++ b/stepmake/stepmake/help2man-rules.make @@ -23,6 +23,7 @@ endif ifeq ($(strip $(CROSS)),no) $(outdir)/%.1: $(outdir)/% $(buildscript-dir)/help2man + echo $(buildscript-dir)/help2man $(HELP2MAN_COMMAND) else # When cross building, some manpages will not build because the diff --git a/stepmake/stepmake/library-rules.make b/stepmake/stepmake/library-rules.make index 942c4f01df..18b1066e2b 100644 --- a/stepmake/stepmake/library-rules.make +++ b/stepmake/stepmake/library-rules.make @@ -1,5 +1,7 @@ -$(LIBRARY): $(outdir)/config.hh $(O_FILES) +$(O_FILES): $(outdir)/config.hh + +$(LIBRARY): $(O_FILES) $(AR) $(ARFLAGS) $@ $(O_FILES) # thanks to Nelson Beebe for this trick. $(RANLIB) $@ || $(AR) ts $@ || true diff --git a/stepmake/stepmake/shared-library-rules.make b/stepmake/stepmake/shared-library-rules.make index 62b2db26d2..3c80a08de4 100644 --- a/stepmake/stepmake/shared-library-rules.make +++ b/stepmake/stepmake/shared-library-rules.make @@ -1,4 +1,5 @@ +$(O_FILES): $(outdir)/config.hh -$(SHARED_LIBRARY): $(outdir)/config.hh $(LO_FILES) +$(SHARED_LIBRARY): $(LO_FILES) $(LD) $(SHARED_FLAGS) -o $@ $(LO_FILES) $(ALL_LDFLAGS) diff --git a/stepmake/stepmake/test-rules.make b/stepmake/stepmake/test-rules.make index d733dbbe69..e10e83c7d8 100644 --- a/stepmake/stepmake/test-rules.make +++ b/stepmake/stepmake/test-rules.make @@ -6,6 +6,6 @@ endef $(foreach a, $(MODULE_LIBS), $(eval $(call MODULE_LIB_template,$(a)))) -$(TEST_EXECUTABLE): $(outdir)/config.hh $(TEST_O_FILES) $(TEST_MODULE_LIBS:%=%/$(outdir)/library.a) +$(TEST_EXECUTABLE): $(TEST_O_FILES) $(TEST_MODULE_LIBS:%=%/$(outdir)/library.a) $(foreach a, $(TEST_MODULE_LIBS), $(MAKE) -C $(a) && ) true $(LD) -o $@ $(TEST_O_FILES) $(TEST_LOADLIBES) $(ALL_LDFLAGS) -- 2.39.2