Kaydet (Commit) 520c7dc9 authored tarafından Michael Stahl's avatar Michael Stahl

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
üst f33c8644
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # 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))) $(eval $(call gb_Package_set_outdir,odk_lib,$(INSTDIR)))
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
# Static Library class # Static Library class
# defined globally in gbuild.mk # defined globally in gbuild.mk
# gb_StaticLibrary_OUTDIRLOCATION := $(OUTDIR)/lib
# defined by platform # defined by platform
# gb_StaticLibrary_get_filename # gb_StaticLibrary_get_filename
# gb_StaticLibrary_PLAINEXT # gb_StaticLibrary_PLAINEXT
...@@ -29,11 +28,10 @@ ...@@ -29,11 +28,10 @@
# EVIL: gb_StaticLibrary and gb_Library need the same deliver rule because they are indistinguishable on windows # 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) .PHONY : $(WORKDIR)/Clean/StaticLibrary/%
$(WORKDIR)/Clean/OutDir/lib/%$(gb_StaticLibrary_PLAINEXT) : $(WORKDIR)/Clean/StaticLibrary/% :
$(call gb_Helper_abbreviate_dirs,\ $(call gb_Helper_abbreviate_dirs,\
rm -f $(OUTDIR)/lib/$*$(gb_StaticLibrary_PLAINEXT) \ rm -f $(AUXTARGETS))
$(AUXTARGETS))
define gb_StaticLibrary_StaticLibrary define gb_StaticLibrary_StaticLibrary
$(call gb_StaticLibrary__StaticLibrary_impl,$(1),$(call gb_StaticLibrary_get_linktarget,$(1))) $(call gb_StaticLibrary__StaticLibrary_impl,$(1),$(call gb_StaticLibrary_get_linktarget,$(1)))
...@@ -44,14 +42,13 @@ endef ...@@ -44,14 +42,13 @@ endef
define gb_StaticLibrary__StaticLibrary_impl define gb_StaticLibrary__StaticLibrary_impl
$(call gb_LinkTarget_LinkTarget,$(2),StaticLibrary_$(1),NONE) $(call gb_LinkTarget_LinkTarget,$(2),StaticLibrary_$(1),NONE)
$(call gb_LinkTarget_set_targettype,$(2),StaticLibrary) $(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 | $(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)) : $(call gb_LinkTarget_get_clean_target,$(2))
$(call gb_StaticLibrary_get_clean_target,$(1)) : AUXTARGETS := $(call gb_StaticLibrary_get_clean_target,$(1)) : AUXTARGETS :=
$(call gb_StaticLibrary_StaticLibrary_platform,$(1),$(2)) $(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)))) $$(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_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 endef
......
...@@ -53,9 +53,7 @@ gb_Executable_get_target_for_build = $(gb_Executable__get_linktarget_target) ...@@ -53,9 +53,7 @@ gb_Executable_get_target_for_build = $(gb_Executable__get_linktarget_target)
# FIXME: cleanup? # FIXME: cleanup?
gb_Library_get_target = $(gb_Library__get_linktarget_target) gb_Library_get_target = $(gb_Library__get_linktarget_target)
define gb_StaticLibrary_get_target gb_StaticLibrary_get_target = $(gb_StaticLibrary__get_linktarget_target)
$(gb_StaticLibrary_OUTDIRLOCATION)/$(call gb_StaticLibrary_get_filename,$(1))
endef
# workdir target patterns # workdir target patterns
...@@ -296,6 +294,7 @@ $(eval $(call gb_Helper_make_clean_targets,\ ...@@ -296,6 +294,7 @@ $(eval $(call gb_Helper_make_clean_targets,\
SdiTarget \ SdiTarget \
SrsTarget \ SrsTarget \
SrsTemplateTarget \ SrsTemplateTarget \
StaticLibrary \
ThesaurusIndexTarget \ ThesaurusIndexTarget \
CppunitTest \ CppunitTest \
CppunitTestFakeExecutable \ CppunitTestFakeExecutable \
...@@ -327,7 +326,6 @@ $(eval $(call gb_Helper_make_outdir_clean_targets,\ ...@@ -327,7 +326,6 @@ $(eval $(call gb_Helper_make_outdir_clean_targets,\
CliNativeLibrary \ CliNativeLibrary \
CliUnoApi \ CliUnoApi \
InstallScript \ InstallScript \
StaticLibrary \
UnoApi \ UnoApi \
)) ))
...@@ -434,7 +432,6 @@ gb_Executable_BINDIR_FOR_BUILD = $(WORKDIR_FOR_BUILD)/LinkTarget/Executable ...@@ -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_OUTDIRLOCATION = $(if $(filter WNT,$(OS)),$(OUTDIR)/bin,$(OUTDIR)/lib)
gb_Library_DLLDIR = $(WORKDIR)/LinkTarget/Library gb_Library_DLLDIR = $(WORKDIR)/LinkTarget/Library
gb_CppunitTest_DLLDIR = $(WORKDIR)/LinkTarget/CppunitTest gb_CppunitTest_DLLDIR = $(WORKDIR)/LinkTarget/CppunitTest
gb_StaticLibrary_OUTDIRLOCATION = $(OUTDIR)/lib
# static variables declared here because they are used globally # static variables declared here because they are used globally
......
...@@ -220,6 +220,7 @@ gb_StaticLibrary_PLAINEXT := .a ...@@ -220,6 +220,7 @@ gb_StaticLibrary_PLAINEXT := .a
gb_StaticLibrary_StaticLibrary_platform := gb_StaticLibrary_StaticLibrary_platform :=
gb_LinkTarget_get_linksearchpath_for_layer = \ gb_LinkTarget_get_linksearchpath_for_layer = \
-L$(WORKDIR)/LinkTarget/StaticLibrary \
-L$(INSTDIR)/$(gb_Package_SDKDIRNAME)/lib \ -L$(INSTDIR)/$(gb_Package_SDKDIRNAME)/lib \
$(foreach layer,\ $(foreach layer,\
$(subst +, ,$(patsubst $(1):%.,%,\ $(subst +, ,$(patsubst $(1):%.,%,\
......
...@@ -147,6 +147,7 @@ gb_LinkTarget_get_manifestfile = \ ...@@ -147,6 +147,7 @@ gb_LinkTarget_get_manifestfile = \
$(WORKDIR)/LinkTarget/$(call gb_LinkTarget__get_workdir_linktargetname,$(1)).manifest $(WORKDIR)/LinkTarget/$(call gb_LinkTarget__get_workdir_linktargetname,$(1)).manifest
gb_LinkTarget_get_linksearchpath_for_layer = \ gb_LinkTarget_get_linksearchpath_for_layer = \
-LIBPATH:$(WORKDIR)/LinkTarget/StaticLibrary \
-LIBPATH:$(INSTDIR)/$(gb_Package_SDKDIRNAME)/lib \ -LIBPATH:$(INSTDIR)/$(gb_Package_SDKDIRNAME)/lib \
$(if $(filter OXT,$(1)),\ $(if $(filter OXT,$(1)),\
-LIBPATH:$(WORKDIR)/LinkTarget/ExtensionLibrary, \ -LIBPATH:$(WORKDIR)/LinkTarget/ExtensionLibrary, \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment