summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-01-14 21:01:10 +0100
committerMichael Stahl <mstahl@redhat.com>2012-01-14 21:31:33 +0100
commit5a25394f397634d1f11df28171727a578354e56c (patch)
tree61549796b7469820962c49b0f0a4a6e164dd342a /solenv
parent4c4ea76c78ceb0003d7049e1c6eb81c6999eba44 (diff)
gbuild: UnoApiTarget: fix dependencies
This should fix the bug, probably introduced with the per-directory performance enhancements, that after a change to an IDL file 2 builds are required to rebuild everything. (cherry picked from commit 26450b3136979db86577591ef380040972d111fc)
Diffstat (limited to 'solenv')
-rw-r--r--solenv/gbuild/UnoApiTarget.mk32
1 files changed, 25 insertions, 7 deletions
diff --git a/solenv/gbuild/UnoApiTarget.mk b/solenv/gbuild/UnoApiTarget.mk
index e5415df056f9..e5575775a833 100644
--- a/solenv/gbuild/UnoApiTarget.mk
+++ b/solenv/gbuild/UnoApiTarget.mk
@@ -76,8 +76,10 @@ endef
# for interfaces, exceptions, structs, enums, constant groups
define gb_UnoApiTarget_add_idlfile
-$(call gb_UnoApiTarget_get_target,$(1)) : $(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd)
-$(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd) : $(call gb_UnoApiPartTarget_get_target,$(2)/idl.done)
+$(call gb_UnoApiTarget_get_target,$(1)) : \
+ $(call gb_UnoApiPartTarget_get_target,$(2)/idl.done)
+$(call gb_UnoApiPartTarget_get_target,$(2)/idl.done) : \
+ $(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd)
gb_UnoApiTarget_HPPFILES_$(1) += $(2)/$(3).hdl
gb_UnoApiTarget_HPPFILES_$(1) += $(2)/$(3).hpp
gb_UnoApiTarget_IDLFILES_$(1) += $(2)/$(3).idl
@@ -97,8 +99,10 @@ endef
# for old-style services and modules
define gb_UnoApiTarget_add_idlfile_noheader
-$(call gb_UnoApiTarget_get_target,$(1)) : $(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd)
-$(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd) : $(call gb_UnoApiPartTarget_get_target,$(2)/idl_noheader.done)
+$(call gb_UnoApiTarget_get_target,$(1)) : \
+ $(call gb_UnoApiPartTarget_get_target,$(2)/idl_noheader.done)
+$(call gb_UnoApiPartTarget_get_target,$(2)/idl_noheader.done) : \
+ $(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd)
gb_UnoApiTarget_IDLFILES_$(1) += $(2)/$(3).idl
endef
@@ -113,8 +117,10 @@ endef
# for new-style services
define gb_UnoApiTarget_add_idlfile_nohdl
-$(call gb_UnoApiTarget_get_target,$(1)) : $(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd)
-$(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd) : $(call gb_UnoApiPartTarget_get_target,$(2)/idl_nohdl.done)
+$(call gb_UnoApiTarget_get_target,$(1)) : \
+ $(call gb_UnoApiPartTarget_get_target,$(2)/idl_nohdl.done)
+$(call gb_UnoApiPartTarget_get_target,$(2)/idl_nohdl.done) : \
+ $(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd)
gb_UnoApiTarget_HPPFILES_$(1) += $(2)/$(3).hpp
gb_UnoApiTarget_IDLFILES_$(1) += $(2)/$(3).idl
@@ -170,11 +176,23 @@ $(call gb_UnoApiTarget_get_clean_target,%) :
-rm -rf $(call gb_UnoApiTarget_get_header_target,$*)\
$(call gb_UnoApiPartTarget_get_target,$*)
+# The .urd files are actually created by the gb_UnoApiPartTarget__command,
+# invoked for the per-directory .done files.
+# The reason why .urd files are tracked is so new files that are added are
+# picked up and cause a rebuild, even if older than the .done file (also, as a
+# convenience for users who delete them from the workdir by hand; this dummy
+# rule plus the dependency from the .done target to the .urd file plus the
+# sort/patsubst call in gb_UnoApiPartTarget__command cause command to be
+# invoked with the .idl file corresponding to the .urd in that case.
+$(call gb_UnoApiPartTarget_get_target,%.urd) :
+ @true
+
define gb_UnoApiPartTarget__command
$$(call gb_Output_announce,$(2),$(true),IDL,2)
mkdir -p $(call gb_UnoApiPartTarget_get_target,$(2)) && \
RESPONSEFILE=$$(call var2file,$$(shell $(gb_MKTEMP)),500,\
- $$(call gb_Helper_convert_native,$$(INCLUDE) $$(DEFS) -O $(call gb_UnoApiPartTarget_get_target,$(2)) -verbose -C $$?)) && \
+ $$(call gb_Helper_convert_native,$$(INCLUDE) $$(DEFS) -O $(call gb_UnoApiPartTarget_get_target,$(2)) -verbose -C \
+ $$(sort $$(patsubst $$(call gb_UnoApiPartTarget_get_target,%.urd),$(SRCDIR)/%.idl,$$?)))) && \
$(gb_UnoApiTarget_IDLCCOMMAND) @$$$${RESPONSEFILE} > /dev/null && \
rm -f $$$${RESPONSEFILE} && \
touch $$@