diff options
author | David Tardon <dtardon@redhat.com> | 2012-01-16 14:55:57 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2012-01-16 14:59:27 +0100 |
commit | cf23f57ae6bb7af689a45e0a850c3c2f67a8f810 (patch) | |
tree | c8f69bce13af71e80fd0fcee227a5f668023e5c3 /solenv/gbuild | |
parent | 75e3bffa1006eeb91324eaeabd52182d25b28711 (diff) |
sort out dep problem with yacc-generated header (fdo#44707)
Diffstat (limited to 'solenv/gbuild')
-rw-r--r-- | solenv/gbuild/LinkTarget.mk | 19 | ||||
-rw-r--r-- | solenv/gbuild/TargetLocations.mk | 3 | ||||
-rw-r--r-- | solenv/gbuild/platform/WNT_INTEL_MSC.mk | 2 | ||||
-rw-r--r-- | solenv/gbuild/platform/com_GCC_defs.mk | 4 |
4 files changed, 19 insertions, 9 deletions
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk index e8f9babb4b54..227fe96f3c81 100644 --- a/solenv/gbuild/LinkTarget.mk +++ b/solenv/gbuild/LinkTarget.mk @@ -185,18 +185,28 @@ endif gb_GenCxxObject_GenCxxObject = # YaccTarget class + +# XXX: This is more complicated than necessary, but we cannot just use +# the generated C++ file as the main target, because we need to let the +# header depend on that to ensure the header is present before anything +# tries to use it. + gb_YaccTarget_get_source = $(1)/$(2).y .PHONY : $(call gb_YaccTarget_get_clean_target,%) $(call gb_YaccTarget_get_clean_target,%) : $(call gb_Output_announce,$(2),$(false),YAC,3) $(call gb_Helper_abbreviate_dirs,\ - rm -f $(call gb_YaccTarget_get_header_target,$*) $(call gb_YaccTarget_get_target,$*)) + rm -f $(call gb_YaccTarget_get_grammar_target,$*) $(call gb_YaccTarget_get_header_target,$*) $(call gb_YaccTarget_get_target,$*)) $(call gb_YaccTarget_get_target,%) : $(call gb_YaccTarget_get_source,$(SRCDIR),%) - $(call gb_YaccTarget__command,$<,$*,$@,$(call gb_YaccTarget_get_header_target,$*)) + $(call gb_YaccTarget__command,$<,$*,$@,$(call gb_YaccTarget_get_header_target,$*),$(call gb_YaccTarget_get_grammar_target,$*)) -gb_YaccTarget_YaccTarget = +define gb_YaccTarget_YaccTarget +$(call gb_YaccTarget_get_grammar_target,$(1)) :| $(call gb_YaccTarget_get_target,$(1)) +$(call gb_YaccTarget_get_header_target,$(1)) :| $(call gb_YaccTarget_get_target,$(1)) + +endef gb_YACC := bison @@ -791,13 +801,12 @@ endef # Add a bison grammar to the build. # gb_LinkTarget_add_grammar(<component>,<grammar file>) define gb_LinkTarget_add_grammar +$(call gb_YaccTarget_YaccTarget,$(2)) $(call gb_LinkTarget_add_generated_cxx_object,$(1),YaccTarget/$(2)) $(call gb_LinkTarget_get_clean_target,$(1)) : $(call gb_YaccTarget_get_clean_target,$(2)) $(call gb_LinkTarget__add_internal_headers,$(1),$(call gb_YaccTarget_get_header_target,$(2))) - endef -#$(call gb_YaccTarget_YaccTarget,$(2)) # Add bison grammars to the build. # gb_LinkTarget_add_grammars(<component>,<grammar file> [<grammar file>*]) diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk index 58b581a06380..59ad2390c31c 100644 --- a/solenv/gbuild/TargetLocations.mk +++ b/solenv/gbuild/TargetLocations.mk @@ -122,8 +122,9 @@ gb_UnoApiTarget_get_header_target = $(WORKDIR)/UnoApiHeaders/$(1) gb_WinResTarget_get_target = $(WORKDIR)/WinResTarget/$(1)$(gb_WinResTarget_POSTFIX) # workdir targets: $(1) is prefix/path gb_Configuration_get_target = $(WORKDIR)/Configuration/$(1).done +gb_YaccTarget_get_grammar_target = $(WORKDIR)/YaccTarget/$(1).cxx gb_YaccTarget_get_header_target = $(WORKDIR)/YaccTarget/$(1).hxx -gb_YaccTarget_get_target = $(WORKDIR)/YaccTarget/$(1).cxx +gb_YaccTarget_get_target = $(WORKDIR)/YaccTarget/$(1).done gb_XcsTarget_get_target = $(WORKDIR)/XcsTarget/$(1) gb_XcuDataTarget_get_target = $(WORKDIR)/XcuDataTarget/$(1) gb_XcuLangpackTarget_get_target = $(WORKDIR)/XcuLangpackTarget/$(1) diff --git a/solenv/gbuild/platform/WNT_INTEL_MSC.mk b/solenv/gbuild/platform/WNT_INTEL_MSC.mk index af5980776c19..b7b4e946926c 100644 --- a/solenv/gbuild/platform/WNT_INTEL_MSC.mk +++ b/solenv/gbuild/platform/WNT_INTEL_MSC.mk @@ -261,7 +261,7 @@ define gb_YaccTarget__command $(call gb_Output_announce,$(2),$(true),YAC,3) $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(3)) && \ - $(gb_YACC) $(T_YACCFLAGS) --defines=$(4) -o $(3) $(1) ) + $(gb_YACC) $(T_YACCFLAGS) --defines=$(4) -o $(5) $(1) && touch $(3) ) endef diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk index 9e055ed0e6bd..f2bf866e7046 100644 --- a/solenv/gbuild/platform/com_GCC_defs.mk +++ b/solenv/gbuild/platform/com_GCC_defs.mk @@ -40,7 +40,7 @@ define gb_YaccTarget__command $(call gb_Output_announce,$(2),$(true),YAC,3) $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(3)) && \ - $(gb_YACC) $(T_YACCFLAGS) -d -o $(3) $(1) && mv $(3).h $(4) ) + $(gb_YACC) $(T_YACCFLAGS) -d -o $(5) $(1) && mv $(5).h $(4) && touch $(3) ) endef @@ -49,7 +49,7 @@ define gb_YaccTarget__command $(call gb_Output_announce,$(2),$(true),YAC,3) $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(3)) && \ - $(gb_YACC) $(T_YACCFLAGS) --defines=$(4) -o $(3) $(1) ) + $(gb_YACC) $(T_YACCFLAGS) --defines=$(4) -o $(5) $(1) && touch $(3) ) endef endif |