summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-09-19 10:55:26 +0200
committerMichael Stahl <mstahl@redhat.com>2013-09-21 19:23:46 +0200
commitad4b542b34f802b44af330a5df2e3e35238e48a7 (patch)
treec6538a592f09e0f1e2074e391c163dc8f1c7ad1d
parent425d8fd12e5f782739a970871ec8f9832dea720c (diff)
gbuild: remove static libraries from OUTDIR
Refactor to find and link static libraries directly in WORKDIR. - gb_StaticLibrary_get_target is now same as the gb_LinkTarget_get_target - fix the StaticLibrary clean target Change-Id: Icf29d32d6487747a2e39d4599ceebccfead04667
-rw-r--r--odk/Package_lib.mk2
-rw-r--r--solenv/gbuild/StaticLibrary.mk11
-rw-r--r--solenv/gbuild/TargetLocations.mk7
-rw-r--r--solenv/gbuild/platform/com_GCC_class.mk1
-rw-r--r--solenv/gbuild/platform/com_MSC_class.mk1
5 files changed, 9 insertions, 13 deletions
diff --git a/odk/Package_lib.mk b/odk/Package_lib.mk
index d1dc1d6a2aab..c9758f8ca44a 100644
--- a/odk/Package_lib.mk
+++ b/odk/Package_lib.mk
@@ -7,7 +7,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-$(eval $(call gb_Package_Package,odk_lib,$(OUTDIR)/lib))
+$(eval $(call gb_Package_Package,odk_lib,$(WORKDIR)/LinkTarget/StaticLibrary))
$(eval $(call gb_Package_set_outdir,odk_lib,$(INSTDIR)))
diff --git a/solenv/gbuild/StaticLibrary.mk b/solenv/gbuild/StaticLibrary.mk
index 0cc7177f76f5..2b3e6c7daaf5 100644
--- a/solenv/gbuild/StaticLibrary.mk
+++ b/solenv/gbuild/StaticLibrary.mk
@@ -21,7 +21,6 @@
# Static Library class
# defined globally in gbuild.mk
-# gb_StaticLibrary_OUTDIRLOCATION := $(OUTDIR)/lib
# defined by platform
# gb_StaticLibrary_get_filename
# gb_StaticLibrary_PLAINEXT
@@ -29,11 +28,10 @@
# EVIL: gb_StaticLibrary and gb_Library need the same deliver rule because they are indistinguishable on windows
-.PHONY : $(WORKDIR)/Clean/OutDir/lib/%$(gb_StaticLibrary_PLAINEXT)
-$(WORKDIR)/Clean/OutDir/lib/%$(gb_StaticLibrary_PLAINEXT) :
+.PHONY : $(WORKDIR)/Clean/StaticLibrary/%
+$(WORKDIR)/Clean/StaticLibrary/% :
$(call gb_Helper_abbreviate_dirs,\
- rm -f $(OUTDIR)/lib/$*$(gb_StaticLibrary_PLAINEXT) \
- $(AUXTARGETS))
+ rm -f $(AUXTARGETS))
define gb_StaticLibrary_StaticLibrary
$(call gb_StaticLibrary__StaticLibrary_impl,$(1),$(call gb_StaticLibrary_get_linktarget,$(1)))
@@ -44,14 +42,13 @@ endef
define gb_StaticLibrary__StaticLibrary_impl
$(call gb_LinkTarget_LinkTarget,$(2),StaticLibrary_$(1),NONE)
$(call gb_LinkTarget_set_targettype,$(2),StaticLibrary)
-$(call gb_StaticLibrary_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2)) \
+$(call gb_StaticLibrary_get_target,$(1)) : \
| $(dir $(call gb_StaticLibrary_get_target,$(1))).dir
$(call gb_StaticLibrary_get_clean_target,$(1)) : $(call gb_LinkTarget_get_clean_target,$(2))
$(call gb_StaticLibrary_get_clean_target,$(1)) : AUXTARGETS :=
$(call gb_StaticLibrary_StaticLibrary_platform,$(1),$(2))
$$(eval $$(call gb_Module_register_target,$(call gb_StaticLibrary_get_target,$(1)),$(call gb_StaticLibrary_get_clean_target,$(1))))
$(call gb_Helper_make_userfriendly_targets,$(1),StaticLibrary)
-$(call gb_Deliver_add_deliverable,$(call gb_StaticLibrary_get_target,$(1)),$(call gb_LinkTarget_get_target,$(2)),$(1))
endef
diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk
index e892815d13bd..a0287a3fe33f 100644
--- a/solenv/gbuild/TargetLocations.mk
+++ b/solenv/gbuild/TargetLocations.mk
@@ -53,9 +53,7 @@ gb_Executable_get_target_for_build = $(gb_Executable__get_linktarget_target)
# FIXME: cleanup?
gb_Library_get_target = $(gb_Library__get_linktarget_target)
-define gb_StaticLibrary_get_target
-$(gb_StaticLibrary_OUTDIRLOCATION)/$(call gb_StaticLibrary_get_filename,$(1))
-endef
+gb_StaticLibrary_get_target = $(gb_StaticLibrary__get_linktarget_target)
# workdir target patterns
@@ -296,6 +294,7 @@ $(eval $(call gb_Helper_make_clean_targets,\
SdiTarget \
SrsTarget \
SrsTemplateTarget \
+ StaticLibrary \
ThesaurusIndexTarget \
CppunitTest \
CppunitTestFakeExecutable \
@@ -327,7 +326,6 @@ $(eval $(call gb_Helper_make_outdir_clean_targets,\
CliNativeLibrary \
CliUnoApi \
InstallScript \
- StaticLibrary \
UnoApi \
))
@@ -434,7 +432,6 @@ gb_Executable_BINDIR_FOR_BUILD = $(WORKDIR_FOR_BUILD)/LinkTarget/Executable
gb_Library_OUTDIRLOCATION = $(if $(filter WNT,$(OS)),$(OUTDIR)/bin,$(OUTDIR)/lib)
gb_Library_DLLDIR = $(WORKDIR)/LinkTarget/Library
gb_CppunitTest_DLLDIR = $(WORKDIR)/LinkTarget/CppunitTest
-gb_StaticLibrary_OUTDIRLOCATION = $(OUTDIR)/lib
# static variables declared here because they are used globally
diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk
index a8cd146f715e..6fef56eb0a65 100644
--- a/solenv/gbuild/platform/com_GCC_class.mk
+++ b/solenv/gbuild/platform/com_GCC_class.mk
@@ -220,6 +220,7 @@ gb_StaticLibrary_PLAINEXT := .a
gb_StaticLibrary_StaticLibrary_platform :=
gb_LinkTarget_get_linksearchpath_for_layer = \
+ -L$(WORKDIR)/LinkTarget/StaticLibrary \
-L$(INSTDIR)/$(gb_Package_SDKDIRNAME)/lib \
$(foreach layer,\
$(subst +, ,$(patsubst $(1):%.,%,\
diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk
index bf5a79c4c2cc..f4cec3becf45 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -147,6 +147,7 @@ gb_LinkTarget_get_manifestfile = \
$(WORKDIR)/LinkTarget/$(call gb_LinkTarget__get_workdir_linktargetname,$(1)).manifest
gb_LinkTarget_get_linksearchpath_for_layer = \
+ -LIBPATH:$(WORKDIR)/LinkTarget/StaticLibrary \
-LIBPATH:$(INSTDIR)/$(gb_Package_SDKDIRNAME)/lib \
$(if $(filter OXT,$(1)),\
-LIBPATH:$(WORKDIR)/LinkTarget/ExtensionLibrary, \