Kaydet (Commit) 5905dfea authored tarafından Michael Stahl's avatar Michael Stahl

gbuild: refactor LinkTarget representation

If the link targets are not in workdir then 2 different aspects are
needed: the previously used location relative to workdir's LinkTarget
dir (for all the misc. related targets), and the full target file.

Adding an additional parameter to all LinkTarget functions would be
quite annoying, especially since it would need passing through all the
gb_LinkTarget__use functions in RepositoryExternal.mk; instead encode
both into the linktarget itself, and modify the functions
gb_LinkTarget_get_target to return the target and all others to return
the workdir linktargetname.

- replace gb_Library_get_linktargetname with either:
  * gb_Library__get_workdir_linktargetname
  * gb_Library__get_linktarget_target
  * gb_Library_get_linktarget
- similar for gb_Executable_get_linktargetname
- similar for gb_StaticLibrary_get_linktargetname
- similar for gb_CppunitTest__get_linktargetname
- add calls to gb_LinkTarget__get_workdir_linktargetname where needed

Change-Id: I917ad7957fee50ec2517a9f9cc9ff452c8d97d1b
üst 031fca3a
...@@ -229,7 +229,7 @@ endif ...@@ -229,7 +229,7 @@ endif
# etc., try to prevent linking these in parallel by adding artificial build # etc., try to prevent linking these in parallel by adding artificial build
# order dependencies here. # order dependencies here.
define repositorymodule_serialize1 define repositorymodule_serialize1
$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,$(1))) \ $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,$(1))) \
:| $(foreach lib,$(2),$(call gb_Library_get_target,$(lib))) :| $(foreach lib,$(2),$(call gb_Library_get_target,$(lib)))
endef endef
......
...@@ -29,9 +29,9 @@ else ifneq ($(filter LINUX ANDROID,$(OS)),) ...@@ -29,9 +29,9 @@ else ifneq ($(filter LINUX ANDROID,$(OS)),)
bridges_SELECTED_BRIDGE := gcc3_linux_arm bridges_SELECTED_BRIDGE := gcc3_linux_arm
bridge_noopt_objects := cpp2uno except uno2cpp bridge_noopt_objects := cpp2uno except uno2cpp
# HACK # HACK
$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,gcc3_uno)) : \ $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,gcc3_uno)) : \
$(call gb_CustomTarget_get_workdir,bridges/source/cpp_uno/gcc3_linux_arm)/armhelper.objectlist $(call gb_CustomTarget_get_workdir,bridges/source/cpp_uno/gcc3_linux_arm)/armhelper.objectlist
$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,gcc3_uno)) : \ $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,gcc3_uno)) : \
EXTRAOBJECTLISTS += $(call gb_CustomTarget_get_workdir,bridges/source/cpp_uno/gcc3_linux_arm)/armhelper.objectlist EXTRAOBJECTLISTS += $(call gb_CustomTarget_get_workdir,bridges/source/cpp_uno/gcc3_linux_arm)/armhelper.objectlist
endif endif
......
...@@ -45,7 +45,7 @@ $(call gb_Module_get_target,desktop) : $(OUTDIR)/bin/soffice.bin.manifest ...@@ -45,7 +45,7 @@ $(call gb_Module_get_target,desktop) : $(OUTDIR)/bin/soffice.bin.manifest
$(OUTDIR)/bin/soffice.bin.manifest : $(call gb_Executable_get_target,soffice_bin) $(OUTDIR)/bin/soffice.bin.manifest : $(call gb_Executable_get_target,soffice_bin)
$(call gb_Executable_get_clean_target,soffice_bin) : $(WORKDIR)/Clean/OutDir/bin/soffice.bin.manifest $(call gb_Executable_get_clean_target,soffice_bin) : $(WORKDIR)/Clean/OutDir/bin/soffice.bin.manifest
$(OUTDIR)/bin/soffice.bin.manifest : $(call gb_LinkTarget_get_target,$(call gb_Executable_get_linktargetname,soffice_bin)) $(OUTDIR)/bin/soffice.bin.manifest : $(call gb_LinkTarget_get_target,$(call gb_Executable_get_linktarget,soffice_bin))
$(call gb_Deliver_deliver,$<.manifest,$@) $(call gb_Deliver_deliver,$<.manifest,$@)
.PHONY : $(WORKDIR)/Clean/OutDir/bin/soffice.bin.manifest .PHONY : $(WORKDIR)/Clean/OutDir/bin/soffice.bin.manifest
......
...@@ -36,6 +36,6 @@ $(eval $(call gb_Executable_add_objcobjects,LibreOffice,\ ...@@ -36,6 +36,6 @@ $(eval $(call gb_Executable_add_objcobjects,LibreOffice,\
# rebuilt if any library has been rebuilt. Avoids need for "make # rebuilt if any library has been rebuilt. Avoids need for "make
# ios.clean". # ios.clean".
$(call gb_LinkTarget_get_target,Executable/LibreOffice) : $(wildcard $(OUTDIR)/lib/lib*.a) $(WORKDIR)/LinkTarget/Executable/LibreOffice : $(wildcard $(OUTDIR)/lib/lib*.a)
# vim: set ts=4 sw=4 et: # vim: set ts=4 sw=4 et:
...@@ -28,7 +28,7 @@ $(eval $(call gb_Executable_add_exception_objects,libtest,\ ...@@ -28,7 +28,7 @@ $(eval $(call gb_Executable_add_exception_objects,libtest,\
)) ))
liblibreoffice_OWN_LD_PATH_DIR := $(gb_DEVINSTALLROOT)/program/libolib liblibreoffice_OWN_LD_PATH_DIR := $(gb_DEVINSTALLROOT)/program/libolib
liblibreoffice_OWN_LD_SO := $(liblibreoffice_OWN_LD_PATH_DIR)/$(call gb_Library_get_linktargetname,libreoffice) liblibreoffice_OWN_LD_SO := $(liblibreoffice_OWN_LD_PATH_DIR)/$(call gb_Library__get_workdir_linktargetname,libreoffice)
$(liblibreoffice_OWN_LD_SO) : $(call gb_Library_get_target,libreoffice) $(liblibreoffice_OWN_LD_SO) : $(call gb_Library_get_target,libreoffice)
mkdir -p $(liblibreoffice_OWN_LD_PATH_DIR)/Library mkdir -p $(liblibreoffice_OWN_LD_PATH_DIR)/Library
...@@ -36,7 +36,7 @@ $(liblibreoffice_OWN_LD_SO) : $(call gb_Library_get_target,libreoffice) ...@@ -36,7 +36,7 @@ $(liblibreoffice_OWN_LD_SO) : $(call gb_Library_get_target,libreoffice)
run_libtest: $(liblibreoffice_OWN_LD_SO) run_libtest: $(liblibreoffice_OWN_LD_SO)
$(gb_Helper_LIBRARY_PATH_VAR)=$${$(gb_Helper_LIBRARY_PATH_VAR):+$$$(gb_Helper_LIBRARY_PATH_VAR):}":$(liblibreoffice_OWN_LD_PATH_DIR)/Library" \ $(gb_Helper_LIBRARY_PATH_VAR)=$${$(gb_Helper_LIBRARY_PATH_VAR):+$$$(gb_Helper_LIBRARY_PATH_VAR):}":$(liblibreoffice_OWN_LD_PATH_DIR)/Library" \
$(call gb_LinkTarget_get_target,Executable/libtest) \ $(WORKDIR)/LinkTarget/Executable/libtest \
$(gb_DEVINSTALLROOT)/program $(OUTDIR)/bin/smoketestdoc.sxw \ $(gb_DEVINSTALLROOT)/program $(OUTDIR)/bin/smoketestdoc.sxw \
# vim: set noet sw=4 ts=4: # vim: set noet sw=4 ts=4:
...@@ -48,8 +48,6 @@ endif ...@@ -48,8 +48,6 @@ endif
gb_CppunitTest_CPPTESTDEPS := $(call gb_Executable_get_runtime_dependencies,cppunit/cppunittester) gb_CppunitTest_CPPTESTDEPS := $(call gb_Executable_get_runtime_dependencies,cppunit/cppunittester)
gb_CppunitTest_CPPTESTCOMMAND := $(call gb_Executable_get_target_for_build,cppunit/cppunittester) gb_CppunitTest_CPPTESTCOMMAND := $(call gb_Executable_get_target_for_build,cppunit/cppunittester)
gb_CppunitTest__get_linktargetname = CppunitTest/$(call gb_CppunitTest_get_filename,$(1))
define gb_CppunitTest__make_args define gb_CppunitTest__make_args
$(HEADLESS) \ $(HEADLESS) \
"-env:BRAND_BASE_DIR=$(call gb_Helper_make_url,$(OUTDIR)/unittest/install)" \ "-env:BRAND_BASE_DIR=$(call gb_Helper_make_url,$(OUTDIR)/unittest/install)" \
...@@ -88,7 +86,7 @@ $(call gb_CppunitTest_get_target,%) :| $(gb_CppunitTest_CPPTESTDEPS) ...@@ -88,7 +86,7 @@ $(call gb_CppunitTest_get_target,%) :| $(gb_CppunitTest_CPPTESTDEPS)
DISABLE_SAL_DBGBOX=t \ DISABLE_SAL_DBGBOX=t \
$(if $(SAL_DIAGNOSE_ABORT),SAL_DIAGNOSE_ABORT=$(SAL_DIAGNOSE_ABORT)) \ $(if $(SAL_DIAGNOSE_ABORT),SAL_DIAGNOSE_ABORT=$(SAL_DIAGNOSE_ABORT)) \
$(ICECREAM_RUN) $(gb_CppunitTest_GDBTRACE) $(gb_CppunitTest_VALGRINDTOOL) $(gb_CppunitTest_CPPTESTCOMMAND) \ $(ICECREAM_RUN) $(gb_CppunitTest_GDBTRACE) $(gb_CppunitTest_VALGRINDTOOL) $(gb_CppunitTest_CPPTESTCOMMAND) \
$(call gb_LinkTarget_get_target,CppunitTest/$(call gb_CppunitTest_get_libfilename,$*)) \ $(WORKDIR)/LinkTarget/CppunitTest/$(call gb_CppunitTest_get_libfilename,$*) \
$(call gb_CppunitTest__make_args) \ $(call gb_CppunitTest__make_args) \
$(if $(gb_CppunitTest__interactive),, \ $(if $(gb_CppunitTest__interactive),, \
> $@.log 2>&1 \ > $@.log 2>&1 \
...@@ -98,10 +96,11 @@ $(call gb_CppunitTest_get_target,%) :| $(gb_CppunitTest_CPPTESTDEPS) ...@@ -98,10 +96,11 @@ $(call gb_CppunitTest_get_target,%) :| $(gb_CppunitTest_CPPTESTDEPS)
&& false)))) && false))))
define gb_CppunitTest_CppunitTest define gb_CppunitTest_CppunitTest
$(call gb_CppunitTest__CppunitTest_impl,$(1),$(call gb_CppunitTest__get_linktargetname,$(1))) $(call gb_CppunitTest__CppunitTest_impl,$(1),$(call gb_CppunitTest_get_linktarget,$(1)))
endef endef
# call gb_CppunitTest__CppunitTest_impl,cppunittest,linktarget
define gb_CppunitTest__CppunitTest_impl define gb_CppunitTest__CppunitTest_impl
$(call gb_LinkTarget_LinkTarget,$(2),CppunitTest_$(1)) $(call gb_LinkTarget_LinkTarget,$(2),CppunitTest_$(1))
$(call gb_LinkTarget_set_targettype,$(2),CppunitTest) $(call gb_LinkTarget_set_targettype,$(2),CppunitTest)
...@@ -195,7 +194,7 @@ $$(call gb_Output_error,\ ...@@ -195,7 +194,7 @@ $$(call gb_Output_error,\
endef endef
define gb_CppunitTest_use_api define gb_CppunitTest_use_api
$(call gb_LinkTarget_use_api,$(call gb_CppunitTest__get_linktargetname,$(1)),$(2)) $(call gb_LinkTarget_use_api,$(call gb_CppunitTest_get_linktarget,$(1)),$(2))
$(foreach rdb,$(2),$(call gb_CppunitTest__use_api,$(1),$(rdb))) $(foreach rdb,$(2),$(call gb_CppunitTest__use_api,$(1),$(rdb)))
endef endef
...@@ -333,7 +332,7 @@ $(call gb_CppunitTestFakeExecutable_get_clean_target,$(2)) : ...@@ -333,7 +332,7 @@ $(call gb_CppunitTestFakeExecutable_get_clean_target,$(2)) :
endef endef
define gb_CppunitTest__forward_to_Linktarget define gb_CppunitTest__forward_to_Linktarget
gb_CppunitTest_$(1) = $$(call gb_LinkTarget_$(1),$$(call gb_CppunitTest__get_linktargetname,$$(1)),$$(2),$$(3),CppunitTest_$$(1)) gb_CppunitTest_$(1) = $$(call gb_LinkTarget_$(1),$$(call gb_CppunitTest_get_linktarget,$$(1)),$$(2),$$(3),CppunitTest_$$(1))
endef endef
......
...@@ -53,10 +53,11 @@ ifeq (,$$(findstring $(1),$$(gb_Executable_KNOWN))) ...@@ -53,10 +53,11 @@ ifeq (,$$(findstring $(1),$$(gb_Executable_KNOWN)))
$$(eval $$(call gb_Output_info,Currently known executables: $(sort $(gb_Executable_KNOWN)),ALL)) $$(eval $$(call gb_Output_info,Currently known executables: $(sort $(gb_Executable_KNOWN)),ALL))
$$(eval $$(call gb_Output_error,Executable $(1) must be registered in Repository.mk)) $$(eval $$(call gb_Output_error,Executable $(1) must be registered in Repository.mk))
endif endif
$(call gb_Executable__Executable_impl,$(1),$(call gb_Executable_get_linktargetname,$(1))) $(call gb_Executable__Executable_impl,$(1),$(call gb_Executable_get_linktarget,$(1)))
endef endef
# call gb_Executable__Executable_impl,exe,linktarget
define gb_Executable__Executable_impl define gb_Executable__Executable_impl
$(call gb_LinkTarget_LinkTarget,$(2),Executable_$(1)) $(call gb_LinkTarget_LinkTarget,$(2),Executable_$(1))
$(call gb_LinkTarget_set_targettype,$(2),Executable) $(call gb_LinkTarget_set_targettype,$(2),Executable)
...@@ -81,21 +82,21 @@ $(call gb_Deliver_add_deliverable,$(call gb_Executable_get_target,$(1)),$(call g ...@@ -81,21 +82,21 @@ $(call gb_Deliver_add_deliverable,$(call gb_Executable_get_target,$(1)),$(call g
endef endef
define gb_Executable_set_targettype_gui define gb_Executable_set_targettype_gui
$(call gb_LinkTarget_get_target,$(call gb_Executable_get_linktargetname,$(1))) : TARGETGUI := $(2) $(call gb_LinkTarget_get_target,$(call gb_Executable_get_linktarget,$(1))) : TARGETGUI := $(2)
endef endef
# The auxtarget is delivered via the rule in Package.mk. # The auxtarget is delivered via the rule in Package.mk.
# gb_Executable_add_auxtarget executable outdirauxtarget # gb_Executable_add_auxtarget executable outdirauxtarget
define gb_Executable_add_auxtarget define gb_Executable_add_auxtarget
$(call gb_LinkTarget_add_auxtarget,$(call gb_Executable_get_linktargetname,$(1)),$(dir $(call gb_LinkTarget_get_target,$(call gb_Executable_get_linktargetname,$(1))))/$(notdir $(2))) $(call gb_LinkTarget_add_auxtarget,$(call gb_Executable_get_linktarget,$(1)),$(dir $(call gb_LinkTarget_get_target,$(call gb_Executable_get_linktarget,$(1))))/$(notdir $(2)))
$(call gb_Executable_get_target,$(1)) : $(2) $(call gb_Executable_get_target,$(1)) : $(2)
$(2) : $(dir $(call gb_LinkTarget_get_target,$(call gb_Executable_get_linktargetname,$(1))))/$(notdir $(2)) $(2) : $(dir $(call gb_LinkTarget_get_target,$(call gb_Executable_get_linktarget,$(1))))/$(notdir $(2))
$(call gb_Executable_get_clean_target,$(1)) : AUXTARGETS += $(2) $(call gb_Executable_get_clean_target,$(1)) : AUXTARGETS += $(2)
endef endef
define gb_Executable_forward_to_Linktarget define gb_Executable_forward_to_Linktarget
gb_Executable_$(1) = $$(call gb_LinkTarget_$(1),$$(call gb_Executable_get_linktargetname,$$(1)),$$(2),$$(3),Executable_$$(1)) gb_Executable_$(1) = $$(call gb_LinkTarget_$(1),$$(call gb_Executable_get_linktarget,$$(1)),$$(2),$$(3),Executable_$$(1))
endef endef
......
...@@ -58,9 +58,9 @@ $(call gb_Library_get_target,$(1)) : SOVERSION := ...@@ -58,9 +58,9 @@ $(call gb_Library_get_target,$(1)) : SOVERSION :=
$(if $(gb_Package_PRESTAGEDIR),\ $(if $(gb_Package_PRESTAGEDIR),\
$(if $(wildcard $(gb_Package_PRESTAGEDIR)/$(call gb_Library_get_instdir,$(1))/$(call gb_Library_get_runtime_filename,$(1))),\ $(if $(wildcard $(gb_Package_PRESTAGEDIR)/$(call gb_Library_get_instdir,$(1))/$(call gb_Library_get_runtime_filename,$(1))),\
$(call gb_Library__Library_impl_copy,$(0),$(call gb_Library_get_instdir,$(1))/$(call gb_Library_get_runtime_filename,$(1))),\ $(call gb_Library__Library_impl_copy,$(0),$(call gb_Library_get_instdir,$(1))/$(call gb_Library_get_runtime_filename,$(1))),\
$(call gb_Library__Library_impl,$(1),$(call gb_Library_get_linktargetname,$(1)))\ $(call gb_Library__Library_impl,$(1),$(call gb_Library_get_linktarget,$(1)))\
), ),
$(call gb_Library__Library_impl,$(1),$(call gb_Library_get_linktargetname,$(1)))\ $(call gb_Library__Library_impl,$(1),$(call gb_Library_get_linktarget,$(1)))\
) )
endef endef
...@@ -72,6 +72,7 @@ $(call gb_Package_add_file,Library_Copy_$(1),$(2),$(2)) ...@@ -72,6 +72,7 @@ $(call gb_Package_add_file,Library_Copy_$(1),$(2),$(2))
$(OUTDIR)/lib/$(notdir $(2)) : $(gb_INSTROOT)/$(2) $(OUTDIR)/lib/$(notdir $(2)) : $(gb_INSTROOT)/$(2)
endef endef
# call gb_Library__Library_impl,library,linktarget
define gb_Library__Library_impl define gb_Library__Library_impl
$(call gb_LinkTarget_LinkTarget,$(2),Library_$(1)) $(call gb_LinkTarget_LinkTarget,$(2),Library_$(1))
$(call gb_LinkTarget_set_targettype,$(2),Library) $(call gb_LinkTarget_set_targettype,$(2),Library)
...@@ -105,9 +106,9 @@ endef ...@@ -105,9 +106,9 @@ endef
# The auxtarget is delivered via the rule in Package.mk. # The auxtarget is delivered via the rule in Package.mk.
# gb_Library_add_auxtarget library outdirauxtarget # gb_Library_add_auxtarget library outdirauxtarget
define gb_Library_add_auxtarget define gb_Library_add_auxtarget
$(call gb_LinkTarget_add_auxtarget,$(call gb_Library_get_linktargetname,$(1)),$(dir $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,$(1))))/$(notdir $(2))) $(call gb_LinkTarget_add_auxtarget,$(call gb_Library_get_linktarget,$(1)),$(dir $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,$(1))))/$(notdir $(2)))
$(call gb_Library_get_target,$(1)) : $(2) $(call gb_Library_get_target,$(1)) : $(2)
$(2) : $(dir $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,$(1))))/$(notdir $(2)) $(2) : $(dir $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,$(1))))/$(notdir $(2))
$(2) :| $(dir $(2)).dir $(2) :| $(dir $(2)).dir
$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS += $(2) $(call gb_Library_get_clean_target,$(1)) : AUXTARGETS += $(2)
...@@ -125,12 +126,12 @@ $(call gb_Library_add_auxtarget,$(1),$(2)) ...@@ -125,12 +126,12 @@ $(call gb_Library_add_auxtarget,$(1),$(2))
endef endef
define gb_Library__set_soversion_script define gb_Library__set_soversion_script
$(call gb_LinkTarget_set_soversion_script,$(call gb_Library_get_linktargetname,$(1)),$(2),$(3)) $(call gb_LinkTarget_set_soversion_script,$(call gb_Library_get_linktarget,$(1)),$(2),$(3))
$(call gb_Library_get_target,$(1)) : SOVERSION := $(2) $(call gb_Library_get_target,$(1)) : SOVERSION := $(2)
$(call gb_Library__add_soversion_link,$(1),$(call gb_Library_get_target,$(1)).$(2)) $(call gb_Library__add_soversion_link,$(1),$(call gb_Library_get_target,$(1)).$(2))
$(call gb_Helper_install,$(call gb_Library__get_final_target,$(1)), \ $(call gb_Helper_install,$(call gb_Library__get_final_target,$(1)), \
$(call gb_Library_get_install_target,$(1)).$(2), \ $(call gb_Library_get_install_target,$(1)).$(2), \
$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,$(1))).$(2)) $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,$(1))).$(2))
endef endef
...@@ -184,7 +185,7 @@ gb_Library__COMPONENTPREFIXES := \ ...@@ -184,7 +185,7 @@ gb_Library__COMPONENTPREFIXES := \
OXT:./ \ OXT:./ \
define gb_Library__forward_to_Linktarget define gb_Library__forward_to_Linktarget
gb_Library_$(1) = $$(call gb_LinkTarget_$(1),$$(call gb_Library_get_linktargetname,$$(1)),$$(2),$$(3),Library_$$(1)) gb_Library_$(1) = $$(call gb_LinkTarget_$(1),$$(call gb_Library_get_linktarget,$$(1)),$$(2),$$(3),Library_$$(1))
endef endef
......
...@@ -201,7 +201,7 @@ endif ...@@ -201,7 +201,7 @@ endif
# GenCxxObject class # GenCxxObject class
gb_GenCxxObject_get_source = $(WORKDIR)/$(1).$(gb_LinkTarget_CXX_SUFFIX_$(2)) gb_GenCxxObject_get_source = $(WORKDIR)/$(1).$(gb_LinkTarget_CXX_SUFFIX_$(call gb_LinkTarget__get_workdir_linktargetname,$(2)))
# defined by platform # defined by platform
# gb_CxxObject__command # gb_CxxObject__command
...@@ -360,8 +360,8 @@ endef ...@@ -360,8 +360,8 @@ endef
# gb_LinkTarget_LDFLAGS # gb_LinkTarget_LDFLAGS
# gb_LinkTarget_INCLUDE # gb_LinkTarget_INCLUDE
.PHONY : $(call gb_LinkTarget_get_clean_target,%) .PHONY : $(WORKDIR)/Clean/LinkTarget/%
$(call gb_LinkTarget_get_clean_target,%) : $(WORKDIR)/Clean/LinkTarget/% :
$(call gb_Output_announce,$*,$(false),LNK,4) $(call gb_Output_announce,$*,$(false),LNK,4)
RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),200,\ RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),200,\
$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
...@@ -409,7 +409,7 @@ $(call gb_Helper_abbreviate_dirs,\ ...@@ -409,7 +409,7 @@ $(call gb_Helper_abbreviate_dirs,\
endef endef
# call gb_LinkTarget__command_objectlist,ignored,linktargetname # call gb_LinkTarget__command_objectlist,linktarget
define gb_LinkTarget__command_objectlist define gb_LinkTarget__command_objectlist
TEMPFILE=$(call var2file,$(shell $(gb_MKTEMP)),200,\ TEMPFILE=$(call var2file,$(shell $(gb_MKTEMP)),200,\
$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
...@@ -421,7 +421,7 @@ TEMPFILE=$(call var2file,$(shell $(gb_MKTEMP)),200,\ ...@@ -421,7 +421,7 @@ TEMPFILE=$(call var2file,$(shell $(gb_MKTEMP)),200,\
$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
$(PCHOBJS)) && \ $(PCHOBJS)) && \
$(if $(EXTRAOBJECTLISTS),cat $(EXTRAOBJECTLISTS) >> $${TEMPFILE} && ) \ $(if $(EXTRAOBJECTLISTS),cat $(EXTRAOBJECTLISTS) >> $${TEMPFILE} && ) \
mv $${TEMPFILE} $(call gb_LinkTarget_get_objects_list,$(2)) mv $${TEMPFILE} $(1)
endef endef
...@@ -430,24 +430,28 @@ endef ...@@ -430,24 +430,28 @@ endef
# written in gb_LinkTarget__command_dynamiclink. # written in gb_LinkTarget__command_dynamiclink.
# Put this pattern rule here so it overrides the one below. # Put this pattern rule here so it overrides the one below.
# (this is rather ugly: because of % the functions cannot be used) # (this is rather ugly: because of % the functions cannot be used)
$(call gb_LinkTarget_get_target,Library/%.exports) : $(gb_Library_OUTDIRLOCATION)/% $(WORKDIR)/LinkTarget/Library/%.exports : $(gb_Library_OUTDIRLOCATION)/%
$(if $(wildcard $@),,mkdir -p $(dir $@) && touch $@) $(if $(wildcard $@),,mkdir -p $(dir $@) && touch $@)
# This recipe actually also builds the dep-target as a side-effect, which # This recipe actually also builds the dep-target as a side-effect, which
# is an optimization to reduce incremental build time. # is an optimization to reduce incremental build time.
# (with exception for concat-dep executable itself which does not exist yet...) # (with exception for concat-dep executable itself which does not exist yet...)
$(call gb_LinkTarget_get_target,%) : $(call gb_LinkTarget_get_headers_target,%) $(gb_Helper_MISCDUMMY) $(WORKDIR)/LinkTarget/% : $(call gb_LinkTarget_get_headers_target,%) $(gb_Helper_MISCDUMMY)
ifeq ($(gb_FULLDEPS),$(true)) $(call gb_LinkTarget__command_impl,$@,$*)
$(if $(findstring concat-deps,$*),,\
$(call gb_LinkTarget__command_dep,$(call gb_LinkTarget_get_dep_target,$*),$*)) # call gb_LinkTarget__command_impl,linktargettarget,linktargetname
endif define gb_LinkTarget__command_impl
$(if $(filter $*,$(foreach lib,$(gb_MERGEDLIBS) $(gb_URELIBS),$(call gb_Library_get_linktargetname,$(lib)))),\ $(if $(gb_FULLDEPS),\
$(if $(filter $(true),$(call gb_LinkTarget__is_build_lib,$*)),\ $(if $(findstring concat-deps,$(2)),,\
$(call gb_LinkTarget__command,$@,$*),\ $(call gb_LinkTarget__command_dep,$(call gb_LinkTarget_get_dep_target,$(2)),$(2))))
mkdir -p $(dir $@) && echo invalid > $@ \ $(if $(filter $(2),$(foreach lib,$(gb_MERGEDLIBS) $(gb_URELIBS),$(call gb_Library__get_workdir_linktargetname,$(lib)))),\
$(if $(SOVERSION),&& echo invalid > $@.$(SOVERSION))),\ $(if $(filter $(true),$(call gb_LinkTarget__is_build_lib,$(2))),\
$(call gb_LinkTarget__command,$@,$*)) $(call gb_LinkTarget__command,$(1),$(2)),\
$(call gb_LinkTarget__command_objectlist,$@,$*) mkdir -p $(dir $(1)) && echo invalid > $(1) \
$(if $(SOVERSION),&& echo invalid > $(1).$(SOVERSION))),\
$(call gb_LinkTarget__command,$(1),$(2)))
$(call gb_LinkTarget__command_objectlist,$(WORKDIR)/LinkTarget/$(2).objectlist)
endef
ifeq ($(gb_FULLDEPS),$(true)) ifeq ($(gb_FULLDEPS),$(true))
$(call gb_LinkTarget_get_dep_target,%) : $(call gb_Executable_get_runtime_dependencies,concat-deps) $(call gb_LinkTarget_get_dep_target,%) : $(call gb_Executable_get_runtime_dependencies,concat-deps)
...@@ -468,7 +472,7 @@ define gb_LinkTarget__get_headers_check ...@@ -468,7 +472,7 @@ define gb_LinkTarget__get_headers_check
ifneq ($$(SELF),$$*) ifneq ($$(SELF),$$*)
$$(eval $$(call gb_Output_info,LinkTarget $$* not defined: Assuming headers to be there!,ALL)) $$(eval $$(call gb_Output_info,LinkTarget $$* not defined: Assuming headers to be there!,ALL))
endif endif
$$@ : COMMAND := $$(call gb_Helper_abbreviate_dirs, mkdir -p $$(dir $$@) && touch $$@ && mkdir -p $(call gb_LinkTarget_get_target,)pdb/$$(dir $$*)) $$@ : COMMAND := $$(call gb_Helper_abbreviate_dirs, mkdir -p $$(dir $$@) && touch $$@ && mkdir -p $(WORKDIR)/LinkTarget/pdb/$$(dir $$*))
endef endef
...@@ -514,7 +518,7 @@ $(call gb_LinkTarget_get_headers_target,%) : ...@@ -514,7 +518,7 @@ $(call gb_LinkTarget_get_headers_target,%) :
# call gb_LinkTarget_LinkTarget,linktarget,linktargetmakefilename # call gb_LinkTarget_LinkTarget,linktarget,linktargetmakefilename
define gb_LinkTarget_LinkTarget define gb_LinkTarget_LinkTarget
$(call gb_LinkTarget_get_clean_target,$(1)) : AUXTARGETS := $(call gb_LinkTarget_get_clean_target,$(1)) : AUXTARGETS :=
$(call gb_LinkTarget_get_headers_target,$(1)) : SELF := $(1) $(call gb_LinkTarget_get_headers_target,$(1)) : SELF := $(call gb_LinkTarget__get_workdir_linktargetname,$(1))
$(call gb_LinkTarget_get_target,$(1)) : DLLTARGET := $(call gb_LinkTarget_get_target,$(1)) : DLLTARGET :=
$(call gb_LinkTarget_get_clean_target,$(1)) \ $(call gb_LinkTarget_get_clean_target,$(1)) \
$(call gb_LinkTarget_get_target,$(1)) : COBJECTS := $(call gb_LinkTarget_get_target,$(1)) : COBJECTS :=
...@@ -607,7 +611,7 @@ $(call gb_LinkTarget_get_dep_target,$(1)) : SOVERSION := ...@@ -607,7 +611,7 @@ $(call gb_LinkTarget_get_dep_target,$(1)) : SOVERSION :=
$(call gb_LinkTarget_get_dep_target,$(1)) : SOVERSIONSCRIPT := $(call gb_LinkTarget_get_dep_target,$(1)) : SOVERSIONSCRIPT :=
endif endif
gb_LinkTarget_CXX_SUFFIX_$(1) := cxx gb_LinkTarget_CXX_SUFFIX_$(call gb_LinkTarget__get_workdir_linktargetname,$(1)) := cxx
endef endef
...@@ -850,7 +854,7 @@ define gb_LinkTarget__use_libraries ...@@ -850,7 +854,7 @@ define gb_LinkTarget__use_libraries
# used by bin/module-deps.pl # used by bin/module-deps.pl
ifneq ($(ENABLE_PRINT_DEPS),) ifneq ($(ENABLE_PRINT_DEPS),)
# exclude libraries in Library_merged Librery_urelibs # exclude libraries in Library_merged Librery_urelibs
ifeq ($(filter $(1),$(foreach lib,$(gb_MERGEDLIBS) $(gb_URELIBS),$(call gb_Library_get_linktargetname,$(lib)))),) ifeq ($(filter $(1),$(foreach lib,$(gb_MERGEDLIBS) $(gb_URELIBS),$(call gb_Library_get_linktarget,$(lib)))),)
$$(eval $$(call gb_PrintDeps_info,$(4),$(3))) $$(eval $$(call gb_PrintDeps_info,$(4),$(3)))
endif endif
endif endif
...@@ -886,12 +890,12 @@ gb_BUILD_HELPER_TOOLS := cppumaker \ ...@@ -886,12 +890,12 @@ gb_BUILD_HELPER_TOOLS := cppumaker \
# call gb_LinkTarget__is_build_lib,linktargetname # call gb_LinkTarget__is_build_lib,linktargetname
define gb_LinkTarget__is_build_lib define gb_LinkTarget__is_build_lib
$(if $(filter $(1),$(foreach lib,$(gb_BUILD_HELPER_LIBS),$(call gb_Library_get_linktargetname,$(lib)))),$(true),$(false)) $(if $(filter $(1),$(foreach lib,$(gb_BUILD_HELPER_LIBS),$(call gb_Library__get_workdir_linktargetname,$(lib)))),$(true),$(false))
endef endef
# call gb_LinkTarget__is_build_tool,linktargetname # call gb_LinkTarget__is_build_tool,linktargetname
define gb_LinkTarget__is_build_tool define gb_LinkTarget__is_build_tool
$(if $(filter $(1),$(addprefix Executable/,$(gb_BUILD_HELPER_TOOLS))),$(true),$(false)) $(if $(filter $(1),$(foreach exe,$(gb_BUILD_HELPER_TOOLS),$(call gb_Executable__get_workdir_linktargetname,$(exe)))),$(true),$(false))
endef endef
# call gb_LinkTarget_use_libraries,linktarget,libs # call gb_LinkTarget_use_libraries,linktarget,libs
...@@ -903,19 +907,18 @@ endif ...@@ -903,19 +907,18 @@ endif
ifeq ($(call gb_LinkTarget__is_build_tool,$(1)),$(true)) ifeq ($(call gb_LinkTarget__is_build_tool,$(1)),$(true))
$(call gb_LinkTarget__use_libraries,$(1),$(2),$(2),$(4)) $(call gb_LinkTarget__use_libraries,$(1),$(2),$(2),$(4))
else else
$(call gb_LinkTarget__use_libraries,$(1),$(2),$(strip \ $(call gb_LinkTarget__use_libraries,$(1),$(2),$(strip \
$(if $(filter $(gb_MERGEDLIBS),$(2)), \ $(if $(filter $(gb_MERGEDLIBS),$(2)), \
$(if $(filter $(1),$(foreach lib,$(gb_MERGEDLIBS),$(call gb_Library_get_linktargetname,$(lib)))), \ $(if $(filter $(1),$(foreach lib,$(gb_MERGEDLIBS),$(call gb_Library_get_linktarget,$(lib)))), \
$(filter $(gb_MERGEDLIBS),$(2)), merged)) \ $(filter $(gb_MERGEDLIBS),$(2)), merged)) \
$(if $(filter $(gb_URELIBS),$(2)), \ $(if $(filter $(gb_URELIBS),$(2)), \
$(if $(filter $(1),$(foreach lib,$(gb_URELIBS),$(call gb_Library_get_linktargetname,$(lib)))), \ $(if $(filter $(1),$(foreach lib,$(gb_URELIBS),$(call gb_Library_get_linktarget,$(lib)))), \
$(filter $(gb_URELIBS),$(2)), urelibs)) \ $(filter $(gb_URELIBS),$(2)), urelibs)) \
$(filter-out $(gb_MERGEDLIBS) $(gb_URELIBS),$(2)) \ $(filter-out $(gb_MERGEDLIBS) $(gb_URELIBS),$(2)) \
),$(4)) ),$(4))
endif endif
endef endef
define gb_LinkTarget_add_linked_static_libs define gb_LinkTarget_add_linked_static_libs
...@@ -966,7 +969,7 @@ $(call gb_CxxObject_get_target,$(2)) : T_CXXFLAGS += $(3) ...@@ -966,7 +969,7 @@ $(call gb_CxxObject_get_target,$(2)) : T_CXXFLAGS += $(3)
$(call gb_CxxObject_get_target,$(2)) : \ $(call gb_CxxObject_get_target,$(2)) : \
OBJECTOWNER := $(call gb_Object__owner,$(2),$(1)) OBJECTOWNER := $(call gb_Object__owner,$(2),$(1))
ifeq ($(gb_ENABLE_PCH),$(true)) ifeq ($(gb_ENABLE_PCH),$(true))
$(call gb_CxxObject_get_target,$(2)) : $(call gb_PrecompiledHeader_get_timestamp,$(1)) $(call gb_CxxObject_get_target,$(2)) : $(call gb_PrecompiledHeader_get_timestamp,$(call gb_LinkTarget__get_workdir_linktargetname,$(1)))
endif endif
ifeq ($(gb_FULLDEPS),$(true)) ifeq ($(gb_FULLDEPS),$(true))
...@@ -1077,7 +1080,7 @@ $(call gb_GenCxxObject_get_target,$(2)) : \ ...@@ -1077,7 +1080,7 @@ $(call gb_GenCxxObject_get_target,$(2)) : \
OBJECTOWNER := $(call gb_Object__owner,$(2),$(1)) OBJECTOWNER := $(call gb_Object__owner,$(2),$(1))
$(call gb_GenCxxObject_get_target,$(2)) : GEN_CXX_SOURCE := $(call gb_GenCxxObject_get_source,$(2),$(1)) $(call gb_GenCxxObject_get_target,$(2)) : GEN_CXX_SOURCE := $(call gb_GenCxxObject_get_source,$(2),$(1))
ifeq ($(gb_ENABLE_PCH),$(true)) ifeq ($(gb_ENABLE_PCH),$(true))
$(call gb_GenCxxObject_get_target,$(2)) : $(call gb_PrecompiledHeader_get_timestamp,$(1)) $(call gb_GenCxxObject_get_target,$(2)) : $(call gb_PrecompiledHeader_get_timestamp,$(call gb_LinkTarget__get_workdir_linktargetname,$(1)))
endif endif
ifeq ($(gb_FULLDEPS),$(true)) ifeq ($(gb_FULLDEPS),$(true))
...@@ -1151,7 +1154,7 @@ ifneq (,$$(filter-out $(gb_Library_KNOWNLIBS),$(2))) ...@@ -1151,7 +1154,7 @@ ifneq (,$$(filter-out $(gb_Library_KNOWNLIBS),$(2)))
$$(eval $$(call gb_Output_info,currently known libraries are: $(sort $(gb_Library_KNOWNLIBS)),ALL)) $$(eval $$(call gb_Output_info,currently known libraries are: $(sort $(gb_Library_KNOWNLIBS)),ALL))
$$(eval $$(call gb_Output_error,Cannot import objects library/libraries $$(filter-out $(gb_Library_KNOWNLIBS),$(2)). Libraries must be registered in Repository.mk)) $$(eval $$(call gb_Output_error,Cannot import objects library/libraries $$(filter-out $(gb_Library_KNOWNLIBS),$(2)). Libraries must be registered in Repository.mk))
endif endif
$(call gb_LinkTarget__use_linktarget_objects,$(1),$(foreach lib,$(2),$(call gb_Library_get_linktargetname,$(lib)))) $(call gb_LinkTarget__use_linktarget_objects,$(1),$(foreach lib,$(2),$(call gb_Library_get_linktarget,$(lib))))
$(call gb_LinkTarget_get_headers_target,$(1)) : \ $(call gb_LinkTarget_get_headers_target,$(1)) : \
$(foreach lib,$(2),$(call gb_Library_get_headers_target,$(lib))) $(foreach lib,$(2),$(call gb_Library_get_headers_target,$(lib)))
...@@ -1335,7 +1338,7 @@ $(call gb_LinkTarget_get_target,$(1)) : PCH_CXXFLAGS := $$(T_CXXFLAGS) $(call gb ...@@ -1335,7 +1338,7 @@ $(call gb_LinkTarget_get_target,$(1)) : PCH_CXXFLAGS := $$(T_CXXFLAGS) $(call gb
$(call gb_PrecompiledHeader_get_target,$(3)) : VISIBILITY := $(call gb_PrecompiledHeader_get_target,$(3)) : VISIBILITY :=
$(call gb_PrecompiledHeader_get_timestamp,$(1)) : $(call gb_PrecompiledHeader_get_target,$(3)) $(call gb_PrecompiledHeader_get_timestamp,$(call gb_LinkTarget__get_workdir_linktargetname,$(1))) : $(call gb_PrecompiledHeader_get_target,$(3))
ifeq ($(gb_FULLDEPS),$(true)) ifeq ($(gb_FULLDEPS),$(true))
-include $(call gb_PrecompiledHeader_get_dep_target,$(3)) -include $(call gb_PrecompiledHeader_get_dep_target,$(3))
...@@ -1437,7 +1440,7 @@ endef ...@@ -1437,7 +1440,7 @@ endef
# #
# call gb_LinkTarget_set_generated_cxx_suffix,linktarget,used-suffix # call gb_LinkTarget_set_generated_cxx_suffix,linktarget,used-suffix
define gb_LinkTarget_set_generated_cxx_suffix define gb_LinkTarget_set_generated_cxx_suffix
gb_LinkTarget_CXX_SUFFIX_$(1) := $(2) gb_LinkTarget_CXX_SUFFIX_$(call gb_LinkTarget__get_workdir_linktargetname,$(1)) := $(2)
endef endef
......
...@@ -36,10 +36,11 @@ $(WORKDIR)/Clean/OutDir/lib/%$(gb_StaticLibrary_PLAINEXT) : ...@@ -36,10 +36,11 @@ $(WORKDIR)/Clean/OutDir/lib/%$(gb_StaticLibrary_PLAINEXT) :
$(AUXTARGETS)) $(AUXTARGETS))
define gb_StaticLibrary_StaticLibrary define gb_StaticLibrary_StaticLibrary
$(call gb_StaticLibrary__StaticLibrary_impl,$(1),$(call gb_StaticLibrary_get_linktargetname,$(1))) $(call gb_StaticLibrary__StaticLibrary_impl,$(1),$(call gb_StaticLibrary_get_linktarget,$(1)))
endef endef
# call gb_StaticLibrary__StaticLibrary_impl,staticlib,linktarget
define gb_StaticLibrary__StaticLibrary_impl define gb_StaticLibrary__StaticLibrary_impl
$(call gb_LinkTarget_LinkTarget,$(2),StaticLibrary_$(1)) $(call gb_LinkTarget_LinkTarget,$(2),StaticLibrary_$(1))
$(call gb_LinkTarget_set_targettype,$(2),StaticLibrary) $(call gb_LinkTarget_set_targettype,$(2),StaticLibrary)
...@@ -55,7 +56,7 @@ $(call gb_Deliver_add_deliverable,$(call gb_StaticLibrary_get_target,$(1)),$(cal ...@@ -55,7 +56,7 @@ $(call gb_Deliver_add_deliverable,$(call gb_StaticLibrary_get_target,$(1)),$(cal
endef endef
define gb_StaticLibrary_forward_to_Linktarget define gb_StaticLibrary_forward_to_Linktarget
gb_StaticLibrary_$(1) = $$(call gb_LinkTarget_$(1),$$(call gb_StaticLibrary_get_linktargetname,$$(1)),$$(2),$$(3),StaticLibrary_$$(1)) gb_StaticLibrary_$(1) = $$(call gb_LinkTarget_$(1),$$(call gb_StaticLibrary_get_linktarget,$$(1)),$$(2),$$(3),StaticLibrary_$$(1))
endef endef
......
...@@ -137,9 +137,16 @@ gb_JunitTest_get_classsetname = JunitTest/$(1) ...@@ -137,9 +137,16 @@ gb_JunitTest_get_classsetname = JunitTest/$(1)
gb_JunitTest_get_target = $(WORKDIR)/JunitTest/$(1)/done gb_JunitTest_get_target = $(WORKDIR)/JunitTest/$(1)/done
gb_JunitTest_get_userdir = $(WORKDIR)/JunitTest/$(1)/user gb_JunitTest_get_userdir = $(WORKDIR)/JunitTest/$(1)/user
gb_PythonTest_get_target = $(WORKDIR)/PythonTest/$(1)/done gb_PythonTest_get_target = $(WORKDIR)/PythonTest/$(1)/done
gb_LinkTarget_get_headers_target = $(WORKDIR)/Headers/$(1) gb_LinkTarget__get_workdir_linktargetname = $(firstword $(subst <>, ,$(1)))
gb_LinkTarget_get_target = $(WORKDIR)/LinkTarget/$(1) gb_LinkTarget_get_headers_target = \
gb_LinkTarget_get_objects_list = $(WORKDIR)/LinkTarget/$(1).objectlist $(WORKDIR)/Headers/$(call gb_LinkTarget__get_workdir_linktargetname,$(1))
gb_LinkTarget_get_objects_list = \
$(WORKDIR)/LinkTarget/$(call gb_LinkTarget__get_workdir_linktargetname,$(1)).objectlist
gb_LinkTarget_get_dep_target = \
$(WORKDIR)/Dep/LinkTarget/$(call gb_LinkTarget__get_workdir_linktargetname,$(1)).d
gb_LinkTarget_get_clean_target = \
$(WORKDIR)/Clean/LinkTarget/$(call gb_LinkTarget__get_workdir_linktargetname,$(1))
gb_LinkTarget_get_target = $(lastword $(subst <>, ,$(1)))
gb_Module_get_almost_target = $(WORKDIR)/Module/almost/$(1) gb_Module_get_almost_target = $(WORKDIR)/Module/almost/$(1)
gb_Module_get_check_target = $(WORKDIR)/Module/check/$(1) gb_Module_get_check_target = $(WORKDIR)/Module/check/$(1)
gb_Module_get_slowcheck_target = $(WORKDIR)/Module/slowcheck/$(1) gb_Module_get_slowcheck_target = $(WORKDIR)/Module/slowcheck/$(1)
...@@ -265,7 +272,6 @@ $(eval $(call gb_Helper_make_clean_targets,\ ...@@ -265,7 +272,6 @@ $(eval $(call gb_Helper_make_clean_targets,\
JavaClassSet \ JavaClassSet \
Jar \ Jar \
JunitTest \ JunitTest \
LinkTarget \
Module \ Module \
PackagePart \ PackagePart \
Package \ Package \
...@@ -329,7 +335,6 @@ $(eval $(call gb_Helper_make_dep_targets,\ ...@@ -329,7 +335,6 @@ $(eval $(call gb_Helper_make_dep_targets,\
AsmObject \ AsmObject \
GenCObject \ GenCObject \
GenCxxObject \ GenCxxObject \
LinkTarget \
SdiTarget \ SdiTarget \
SrsPartTarget \ SrsPartTarget \
SrsTarget \ SrsTarget \
...@@ -372,9 +377,48 @@ define gb_Executable_get_command ...@@ -372,9 +377,48 @@ define gb_Executable_get_command
$(gb_Helper_set_ld_path) $(2) $(call gb_Executable_get_target_for_build,$(1)) $(gb_Helper_set_ld_path) $(2) $(call gb_Executable_get_target_for_build,$(1))
endef endef
gb_Executable_get_linktargetname = Executable/$(call gb_Executable_get_filename,$(1)) define gb_Executable__get_workdir_linktargetname
gb_Library_get_linktargetname = Library/$(call gb_Library_get_filename,$(1)) Executable/$(call gb_Executable_get_filename,$(1))
gb_StaticLibrary_get_linktargetname = StaticLibrary/$(call gb_StaticLibrary_get_filename,$(1)) endef
define gb_Executable__get_linktarget_target
$(WORKDIR)/LinkTarget/$(call gb_Executable__get_workdir_linktargetname,$(1))
endef
define gb_Executable_get_linktarget
$(call gb_Executable__get_workdir_linktargetname,$(1))<>$(call gb_Executable__get_linktarget_target,$(1))
endef
define gb_Library__get_workdir_linktargetname
Library/$(call gb_Library_get_filename,$(1))
endef
define gb_Library__get_linktarget_target
$(WORKDIR)/LinkTarget/$(call gb_Library__get_workdir_linktargetname,$(1))
endef
# this returns a tuple of both the linktargetname, and the target file
define gb_Library_get_linktarget
$(call gb_Library__get_workdir_linktargetname,$(1))<>$(call gb_Library__get_linktarget_target,$(1))
endef
define gb_StaticLibrary__get_workdir_linktargetname
StaticLibrary/$(call gb_StaticLibrary_get_filename,$(1))
endef
define gb_StaticLibrary__get_linktarget_target
$(WORKDIR)/LinkTarget/$(call gb_StaticLibrary__get_workdir_linktargetname,$(1))
endef
# this returns a tuple of both the linktargetname, and the target file
define gb_StaticLibrary_get_linktarget
$(call gb_StaticLibrary__get_workdir_linktargetname,$(1))<>$(call gb_StaticLibrary__get_linktarget_target,$(1))
endef
define gb_CppunitTest__get_workdir_linktargetname
CppunitTest/$(call gb_CppunitTest_get_filename,$(1))
endef
define gb_CppunitTest__get_linktarget_target
$(WORKDIR)/LinkTarget/$(call gb_CppunitTest__get_workdir_linktargetname,$(1))
endef
# this returns a tuple of both the linktargetname, and the target file
define gb_CppunitTest_get_linktarget
$(call gb_CppunitTest__get_workdir_linktargetname,$(1))<>$(call gb_CppunitTest__get_linktarget_target,$(1))
endef
# static members declared here because they are used globally # static members declared here because they are used globally
......
...@@ -200,7 +200,7 @@ $(call gb_Helper_abbreviate_dirs,\ ...@@ -200,7 +200,7 @@ $(call gb_Helper_abbreviate_dirs,\
endef endef
define gb_Library_get_exports_target define gb_Library_get_exports_target
$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,$(1))).exports $(WORKDIR)/LinkTarget/$(call gb_Library__get_workdir_linktargetname,$(1)).exports
endef endef
# YaccTarget class # YaccTarget class
......
...@@ -136,7 +136,8 @@ gb_LinkTarget_INCLUDE :=\ ...@@ -136,7 +136,8 @@ gb_LinkTarget_INCLUDE :=\
$(foreach inc,$(subst ;, ,$(JDKINC)),-I$(inc)) \ $(foreach inc,$(subst ;, ,$(JDKINC)),-I$(inc)) \
-I$(BUILDDIR)/config_$(gb_Side) \ -I$(BUILDDIR)/config_$(gb_Side) \
gb_LinkTarget_get_pdbfile = $(call gb_LinkTarget_get_target,)pdb/$(1).pdb gb_LinkTarget_get_pdbfile = \
$(WORKDIR)/LinkTarget/pdb/$(call gb_LinkTarget__get_workdir_linktargetname,$(1)).pdb
# avoid fatal error LNK1170 for Library_merged # avoid fatal error LNK1170 for Library_merged
define gb_LinkTarget_MergedResponseFile define gb_LinkTarget_MergedResponseFile
...@@ -164,7 +165,7 @@ $(call gb_Helper_abbreviate_dirs,\ ...@@ -164,7 +165,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \ $(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \
$(foreach extraobjectlist,$(EXTRAOBJECTLISTS),$(shell cat $(extraobjectlist))) \ $(foreach extraobjectlist,$(EXTRAOBJECTLISTS),$(shell cat $(extraobjectlist))) \
$(PCHOBJS) $(NATIVERES)) && \ $(PCHOBJS) $(NATIVERES)) && \
$(if $(filter $(call gb_Library_get_linktargetname,merged),$(2)),$(call gb_LinkTarget_MergedResponseFile)) \ $(if $(filter $(call gb_Library__get_workdir_linktargetname,merged),$(2)),$(call gb_LinkTarget_MergedResponseFile)) \
unset INCLUDE && \ unset INCLUDE && \
$(if $(filter YES,$(LIBRARY_X64)), $(LINK_X64_BINARY), $(gb_LINK)) \ $(if $(filter YES,$(LIBRARY_X64)), $(LINK_X64_BINARY), $(gb_LINK)) \
$(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \ $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
...@@ -269,7 +270,7 @@ gb_Library_DLLFILENAMES :=\ ...@@ -269,7 +270,7 @@ gb_Library_DLLFILENAMES :=\
# An assembly is a special kind of library for CLI # An assembly is a special kind of library for CLI
define gb_Library_Assembly define gb_Library_Assembly
$(call gb_Library_Library,$(1)) $(call gb_Library_Library,$(1))
$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,$(1))) : NATIVERES := $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,$(1))) : NATIVERES :=
endef endef
...@@ -343,7 +344,7 @@ endef ...@@ -343,7 +344,7 @@ endef
# in effect this just causes the .export target to be touched # in effect this just causes the .export target to be touched
# cannot be the .lib itself because that causes attempts to get it linked :( # cannot be the .lib itself because that causes attempts to get it linked :(
define gb_Library_get_exports_target define gb_Library_get_exports_target
$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,$(1))).exports $(WORKDIR)/LinkTarget/$(call gb_Library__get_workdir_linktargetname,$(1)).exports
endef endef
......
...@@ -253,8 +253,8 @@ gb_Library__set_soversion_script_platform = $(gb_Library__set_soversion_script) ...@@ -253,8 +253,8 @@ gb_Library__set_soversion_script_platform = $(gb_Library__set_soversion_script)
# set the TARGETTYPE to Bundle, and clear install_name(RPATH) # set the TARGETTYPE to Bundle, and clear install_name(RPATH)
define gb_Library_Bundle define gb_Library_Bundle
$(call gb_Library_Library,$(1)) $(call gb_Library_Library,$(1))
$(call gb_LinkTarget_set_targettype,$(call gb_Library_get_linktargetname,$(1)),Bundle) $(call gb_LinkTarget_set_targettype,$(call gb_Library_get_linktarget,$(1)),Bundle)
$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,$(1))) : \ $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,$(1))) : \
RPATH := RPATH :=
endef endef
......
...@@ -171,7 +171,7 @@ $(call gb_Helper_abbreviate_dirs,\ ...@@ -171,7 +171,7 @@ $(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) && \ mkdir -p $(dir $(1)) && \
$(if $(CXXOBJECTS)$(GENCXXOBJECTS)$(EXTRAOBJECTLISTS),$(gb_CXX),$(gb_CC)) \ $(if $(CXXOBJECTS)$(GENCXXOBJECTS)$(EXTRAOBJECTLISTS),$(gb_CXX),$(gb_CC)) \
$(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \ $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
$(if $(filter-out $(foreach lib,frm scfilt wpftdraw,$(call gb_Library_get_linktargetname,$(lib))),$*),$(gb_LTOFLAGS)) \ $(if $(filter-out $(foreach lib,frm scfilt wpftdraw,$(call gb_Library__get_workdir_linktargetname,$(lib))),$(2)),$(gb_LTOFLAGS)) \
$(if $(SOVERSION),-Wl$(COMMA)--soname=$(notdir $(1)).$(SOVERSION)) \ $(if $(SOVERSION),-Wl$(COMMA)--soname=$(notdir $(1)).$(SOVERSION)) \
$(if $(SOVERSIONSCRIPT),-Wl$(COMMA)--version-script=$(SOVERSIONSCRIPT))\ $(if $(SOVERSIONSCRIPT),-Wl$(COMMA)--version-script=$(SOVERSIONSCRIPT))\
$(subst \d,$$,$(RPATH)) \ $(subst \d,$$,$(RPATH)) \
...@@ -215,7 +215,7 @@ endef ...@@ -215,7 +215,7 @@ endef
define gb_LinkTarget__command define gb_LinkTarget__command
$(call gb_Output_announce,$(2),$(true),LNK,4) $(call gb_Output_announce,$(2),$(true),LNK,4)
$(if $(filter Library CppunitTest Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclink,$(1))) $(if $(filter Library CppunitTest Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclink,$(1),$(2)))
$(if $(filter StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlink,$(1))) $(if $(filter StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlink,$(1)))
endef endef
......
...@@ -173,7 +173,7 @@ $(call gb_Helper_abbreviate_dirs,\ ...@@ -173,7 +173,7 @@ $(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) && \ mkdir -p $(dir $(1)) && \
$(if $(CXXOBJECTS)$(GENCXXOBJECTS)$(EXTRAOBJECTLISTS),$(gb_CXX),$(gb_CC)) \ $(if $(CXXOBJECTS)$(GENCXXOBJECTS)$(EXTRAOBJECTLISTS),$(gb_CXX),$(gb_CC)) \
$(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \ $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
$(if $(filter-out $(foreach lib,frm scfilt wpftdraw,$(call gb_Library_get_linktargetname,$(lib))),$*),$(gb_LTOFLAGS)) \ $(if $(filter-out $(foreach lib,frm scfilt wpftdraw,$(call gb_Library__get_workdir_linktargetname,$(lib))),$(2)),$(gb_LTOFLAGS)) \
$(if $(SOVERSION),-Wl$(COMMA)--soname=$(notdir $(1)).$(SOVERSION)) \ $(if $(SOVERSION),-Wl$(COMMA)--soname=$(notdir $(1)).$(SOVERSION)) \
$(if $(SOVERSIONSCRIPT),-Wl$(COMMA)--version-script=$(SOVERSIONSCRIPT))\ $(if $(SOVERSIONSCRIPT),-Wl$(COMMA)--version-script=$(SOVERSIONSCRIPT))\
$(subst \d,$$,$(RPATH)) \ $(subst \d,$$,$(RPATH)) \
...@@ -217,7 +217,7 @@ endef ...@@ -217,7 +217,7 @@ endef
define gb_LinkTarget__command define gb_LinkTarget__command
$(call gb_Output_announce,$(2),$(true),LNK,4) $(call gb_Output_announce,$(2),$(true),LNK,4)
$(if $(filter Library CppunitTest Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclink,$(1))) $(if $(filter Library CppunitTest Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclink,$(1),$(2)))
$(if $(filter StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlink,$(1))) $(if $(filter StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlink,$(1)))
endef endef
......
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