diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-09-19 10:55:26 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-09-22 11:08:33 +0200 |
commit | 520c7dc9e8860e506145e879182ca32853617097 (patch) | |
tree | 733835cbe9a51e0dfe6bf264677b453133900dd2 /solenv | |
parent | f33c8644c052bf9d69157224500ca7887075c7da (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
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/gbuild/StaticLibrary.mk | 11 | ||||
-rw-r--r-- | solenv/gbuild/TargetLocations.mk | 7 | ||||
-rw-r--r-- | solenv/gbuild/platform/com_GCC_class.mk | 1 | ||||
-rw-r--r-- | solenv/gbuild/platform/com_MSC_class.mk | 1 |
4 files changed, 8 insertions, 12 deletions
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, \ |