summaryrefslogtreecommitdiff
path: root/solenv/gbuild/Library.mk
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-09-21 22:28:20 +0200
committerMichael Stahl <mstahl@redhat.com>2013-09-22 11:08:34 +0200
commitdab82360206549d7c4b8bee76ca55a909d390777 (patch)
tree1ea6c84d3f96cb0f7bf52d372d46f3d311acda4b /solenv/gbuild/Library.mk
parent3f0ee22ed76d59451ed014adc48185653e59c6a6 (diff)
gbuild: add consistent directory dependencies for LinkTargets
- StaticLibrary and CppunitTest have all files in one directory - Executable may have the executable itself in a different one - Library may have files in up to 3 directories ... so create 2 directories (which may be the same) in gb_LinkTarget_LinkTarget and a 3rd one in gb_Library__Library_impl. This allows to get rid of the "mkdir LinkTarget/pdb/..." thing in the header target rule, which was always ugly since it did not get rebuilt when deleting it (or whole LinkTarget dir) from workdir. Oh and the pattern dependency causes trouble: $(WORKDIR)/LinkTarget/% : $(call gb_LinkTarget_get_headers_target,%) ... for files in ExtensionLibrary; it would be possible to put ExtensionLibrary somewhere else of course but actually this pattern dependency is unnecessary since we get the same thing whenever any object is added to a link target and there shouldn't be link targets without objects anyway. Furthermore directory dependencies must be on the headers_target because MSVC will write a PDB file when compiling objects. Change-Id: Icd92e8768d6aafb094a4144f90165aa5ff233647
Diffstat (limited to 'solenv/gbuild/Library.mk')
-rw-r--r--solenv/gbuild/Library.mk13
1 files changed, 9 insertions, 4 deletions
diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk
index a8f3cae8f36b..a09f48aac4b6 100644
--- a/solenv/gbuild/Library.mk
+++ b/solenv/gbuild/Library.mk
@@ -76,6 +76,13 @@ $(call gb_Package_add_file,Library_Copy_$(1),$(2),$(2))
$(OUTDIR)/lib/$(notdir $(2)) : $(gb_INSTROOT)/$(2)
endef
+# Note: there may be targets in 3 different directories: the library itself,
+# the exports target (and other misc. MSVC files) (always in
+# $(WORKDIR)/LinkTarget), and the import library, which may be in SDK;
+# the first 2 are always created by gb_LinkTarget_LinkTarget
+# Also: the directory dependencies must be on the headers_target because
+# MSVC will write a PDB file when compiling objects.
+#
# call gb_Library__Library_impl,library,linktarget
define gb_Library__Library_impl
$(call gb_LinkTarget_LinkTarget,$(2),Library_$(1),$(call gb_Library_get_layer,$(1)))
@@ -86,10 +93,8 @@ $(call gb_LinkTarget_add_defs,$(2),\
)
$(call gb_Library__get_final_target,$(1)) : $(call gb_Library_get_target,$(1))
$(call gb_Library_get_exports_target,$(1)) : $(call gb_Library_get_target,$(1))
-$(call gb_Library_get_target,$(1)) : \
- | $(dir $(call gb_Library_get_target,$(1))).dir \
- $(dir $(call gb_Library_get_ilib_target,$(1))).dir \
- $(gb_Library_DLLDIR)/.dir
+$(call gb_LinkTarget_get_headers_target,$(2)) : \
+ | $(dir $(call gb_Library_get_ilib_target,$(1))).dir
$(call gb_Library_get_clean_target,$(1)) : $(call gb_LinkTarget_get_clean_target,$(2))
$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS :=
$(call gb_Library_Library_platform,$(1),$(2),$(call gb_Library_get_ilib_target,$(1)))