gbuild: copy shared libs into $(INSTDIR)

Change-Id: I20612a93a25d1748725a792cfae0bce8c3ef262b
This commit is contained in:
David Tardon 2013-04-27 09:04:19 +02:00
parent 488d0de6f8
commit f48a576ff2

View file

@ -38,6 +38,10 @@
# gb_Library_FILENAMES
# gb_Library_Library_platform
gb_Library_LAYER_DIRS := \
OOO:program \
URELIB:ure/$(notdir $(gb_Helper_OUTDIRLIBDIR))
# doesn't do anything, just used for hooking up component target
.PHONY: $(call gb_Library__get_final_target,%)
@ -48,6 +52,11 @@ $(WORKDIR)/Clean/OutDir/lib/%$(gb_Library_PLAINEXT) :
rm -f $(OUTDIR)/lib/$*$(gb_Library_PLAINEXT) \
$(AUXTARGETS))
gb_Library_get_packagename = Library/$(1)
gb_Library__get_dir_for_layer = $(patsubst $(1):%,%,$(filter $(1):%,$(gb_Library_LAYER_DIRS)))
gb_Library__get_instdir = $(call gb_Library__get_dir_for_layer,$(call gb_Library_get_layer,$(1)))
define gb_Library_Library
$(call gb_Postprocess_get_target,AllLibraries) : $(call gb_Library_get_target,$(1))
ifeq (,$$(findstring $(1),$$(gb_Library_KNOWNLIBS)))
@ -72,12 +81,31 @@ $(call gb_Library_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2)) \
$(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),$(gb_Library_DLLDIR)/$(call gb_Library_get_dllname,$(1)))
ifneq ($(gb_RUNNABLE_INSTDIR),)
$(if $(filter $(call gb_Library_get_layer,$(1)):%,$(gb_Library_LAYER_DIRS)),\
$(call gb_Library__Library_package,$(1),$(call gb_Library_get_packagename,$(1)),$(call gb_Library_get_runtime_filename,$(1))) \
)
endif
$$(eval $$(call gb_Module_register_target,$(call gb_Library__get_final_target,$(1)),$(call gb_Library_get_clean_target,$(1))))
$(call gb_Helper_make_userfriendly_targets,$(1),Library,$(call gb_Library__get_final_target,$(1)))
$(call gb_Deliver_add_deliverable,$(call gb_Library_get_target,$(1)),$(call gb_LinkTarget_get_target,$(2)),$(1))
endef
# gb_Library__Library_package library package filename
define gb_Library__Library_package
$(call gb_Package_Package,$(2),$(gb_Helper_OUTDIRLIBDIR))
$(call gb_Package_set_outdir,$(2),$(INSTDIR))
$(call gb_Package_add_file,$(2),$(call gb_Library__get_instdir,$(1))/$(3),$(3))
$(call gb_Library__get_final_target,$(1)) : $(call gb_Package_get_target,$(2))
$(call gb_Package_get_target,$(2)) : $(call gb_Library_get_target,$(1))
$(call gb_Library_get_clean_target,$(1)) : $(call gb_Package_get_clean_target,$(2))
endef
# Custom definition that does not simply forward to LinkTarget,
# because there are cases where the auxtargets are not delivered to solver...
# The auxtarget is delivered via the rule in Package.mk.
@ -95,10 +123,19 @@ $(foreach aux,$(2),$(call gb_Library_add_auxtarget,$(1),$(aux)))
endef
# gb_Library__add_soversion_link library package linkname
define gb_Library__add_soversion_link
$(call gb_Library_add_auxtarget,$(1),$(3))
ifneq ($(gb_RUNNABLE_INSTDIR),)
$(call gb_Package_add_file,$(2),$(call gb_Library__get_instdir,$(1))/$(notdir $(3)),$(notdir $(3)))
endif
endef
define gb_Library__set_soversion_script
$(call gb_LinkTarget_set_soversion_script,$(call gb_Library_get_linktargetname,$(1)),$(2),$(3))
$(call gb_Library_get_target,$(1)) : SOVERSION := $(2)
$(call gb_Library_add_auxtarget,$(1),$(call gb_Library_get_target,$(1)).$(2))
$(call gb_Library__add_soversion_link,$(1),$(call gb_Library_get_packagename,$(1)),$(call gb_Library_get_target,$(1)).$(2))
endef