diff options
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/gbuild/CppunitTest.mk | 11 | ||||
-rw-r--r-- | solenv/gbuild/Executable.mk | 11 | ||||
-rw-r--r-- | solenv/gbuild/Library.mk | 15 | ||||
-rw-r--r-- | solenv/gbuild/LinkTarget.mk | 69 | ||||
-rw-r--r-- | solenv/gbuild/StaticLibrary.mk | 5 | ||||
-rw-r--r-- | solenv/gbuild/TargetLocations.mk | 60 | ||||
-rw-r--r-- | solenv/gbuild/platform/com_GCC_class.mk | 2 | ||||
-rw-r--r-- | solenv/gbuild/platform/com_MSC_class.mk | 9 | ||||
-rw-r--r-- | solenv/gbuild/platform/macosx.mk | 4 | ||||
-rw-r--r-- | solenv/gbuild/platform/solaris.mk | 4 | ||||
-rw-r--r-- | solenv/gbuild/platform/unxgcc.mk | 4 |
11 files changed, 122 insertions, 72 deletions
diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk index 25afb392518a..2b5e854fe040 100644 --- a/solenv/gbuild/CppunitTest.mk +++ b/solenv/gbuild/CppunitTest.mk @@ -48,8 +48,6 @@ endif 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__get_linktargetname = CppunitTest/$(call gb_CppunitTest_get_filename,$(1)) - define gb_CppunitTest__make_args $(HEADLESS) \ "-env:BRAND_BASE_DIR=$(call gb_Helper_make_url,$(OUTDIR)/unittest/install)" \ @@ -88,7 +86,7 @@ $(call gb_CppunitTest_get_target,%) :| $(gb_CppunitTest_CPPTESTDEPS) DISABLE_SAL_DBGBOX=t \ $(if $(SAL_DIAGNOSE_ABORT),SAL_DIAGNOSE_ABORT=$(SAL_DIAGNOSE_ABORT)) \ $(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) \ $(if $(gb_CppunitTest__interactive),, \ > $@.log 2>&1 \ @@ -98,10 +96,11 @@ $(call gb_CppunitTest_get_target,%) :| $(gb_CppunitTest_CPPTESTDEPS) && false)))) 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 +# call gb_CppunitTest__CppunitTest_impl,cppunittest,linktarget define gb_CppunitTest__CppunitTest_impl $(call gb_LinkTarget_LinkTarget,$(2),CppunitTest_$(1)) $(call gb_LinkTarget_set_targettype,$(2),CppunitTest) @@ -195,7 +194,7 @@ $$(call gb_Output_error,\ endef 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))) endef @@ -333,7 +332,7 @@ $(call gb_CppunitTestFakeExecutable_get_clean_target,$(2)) : endef 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 diff --git a/solenv/gbuild/Executable.mk b/solenv/gbuild/Executable.mk index 2b8188adbaa0..bb9358e82cb5 100644 --- a/solenv/gbuild/Executable.mk +++ b/solenv/gbuild/Executable.mk @@ -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_error,Executable $(1) must be registered in Repository.mk)) 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 +# call gb_Executable__Executable_impl,exe,linktarget define gb_Executable__Executable_impl $(call gb_LinkTarget_LinkTarget,$(2),Executable_$(1)) $(call gb_LinkTarget_set_targettype,$(2),Executable) @@ -81,21 +82,21 @@ $(call gb_Deliver_add_deliverable,$(call gb_Executable_get_target,$(1)),$(call g endef 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 # The auxtarget is delivered via the rule in Package.mk. # gb_Executable_add_auxtarget executable outdirauxtarget 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) -$(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) endef 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 diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk index 34e590065b38..f5b4a9f53e2b 100644 --- a/solenv/gbuild/Library.mk +++ b/solenv/gbuild/Library.mk @@ -58,9 +58,9 @@ $(call gb_Library_get_target,$(1)) : SOVERSION := $(if $(gb_Package_PRESTAGEDIR),\ $(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,$(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 @@ -72,6 +72,7 @@ $(call gb_Package_add_file,Library_Copy_$(1),$(2),$(2)) $(OUTDIR)/lib/$(notdir $(2)) : $(gb_INSTROOT)/$(2) endef +# call gb_Library__Library_impl,library,linktarget define gb_Library__Library_impl $(call gb_LinkTarget_LinkTarget,$(2),Library_$(1)) $(call gb_LinkTarget_set_targettype,$(2),Library) @@ -105,9 +106,9 @@ endef # The auxtarget is delivered via the rule in Package.mk. # gb_Library_add_auxtarget library outdirauxtarget 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) -$(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 $(call gb_Library_get_clean_target,$(1)) : AUXTARGETS += $(2) @@ -125,12 +126,12 @@ $(call gb_Library_add_auxtarget,$(1),$(2)) endef 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__add_soversion_link,$(1),$(call gb_Library_get_target,$(1)).$(2)) $(call gb_Helper_install,$(call gb_Library__get_final_target,$(1)), \ $(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 @@ -184,7 +185,7 @@ gb_Library__COMPONENTPREFIXES := \ OXT:./ \ 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 diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk index 49ddc1cc626e..901a00ea8813 100644 --- a/solenv/gbuild/LinkTarget.mk +++ b/solenv/gbuild/LinkTarget.mk @@ -201,7 +201,7 @@ endif # 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 # gb_CxxObject__command @@ -360,8 +360,8 @@ endef # gb_LinkTarget_LDFLAGS # gb_LinkTarget_INCLUDE -.PHONY : $(call gb_LinkTarget_get_clean_target,%) -$(call gb_LinkTarget_get_clean_target,%) : +.PHONY : $(WORKDIR)/Clean/LinkTarget/% +$(WORKDIR)/Clean/LinkTarget/% : $(call gb_Output_announce,$*,$(false),LNK,4) RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),200,\ $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ @@ -409,7 +409,7 @@ $(call gb_Helper_abbreviate_dirs,\ endef -# call gb_LinkTarget__command_objectlist,ignored,linktargetname +# call gb_LinkTarget__command_objectlist,linktarget define gb_LinkTarget__command_objectlist TEMPFILE=$(call var2file,$(shell $(gb_MKTEMP)),200,\ $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ @@ -421,7 +421,7 @@ TEMPFILE=$(call var2file,$(shell $(gb_MKTEMP)),200,\ $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ $(PCHOBJS)) && \ $(if $(EXTRAOBJECTLISTS),cat $(EXTRAOBJECTLISTS) >> $${TEMPFILE} && ) \ -mv $${TEMPFILE} $(call gb_LinkTarget_get_objects_list,$(2)) +mv $${TEMPFILE} $(1) endef @@ -430,24 +430,28 @@ endef # written in gb_LinkTarget__command_dynamiclink. # Put this pattern rule here so it overrides the one below. # (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 $@) # This recipe actually also builds the dep-target as a side-effect, which # is an optimization to reduce incremental build time. # (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) -ifeq ($(gb_FULLDEPS),$(true)) - $(if $(findstring concat-deps,$*),,\ - $(call gb_LinkTarget__command_dep,$(call gb_LinkTarget_get_dep_target,$*),$*)) -endif - $(if $(filter $*,$(foreach lib,$(gb_MERGEDLIBS) $(gb_URELIBS),$(call gb_Library_get_linktargetname,$(lib)))),\ - $(if $(filter $(true),$(call gb_LinkTarget__is_build_lib,$*)),\ - $(call gb_LinkTarget__command,$@,$*),\ - mkdir -p $(dir $@) && echo invalid > $@ \ - $(if $(SOVERSION),&& echo invalid > $@.$(SOVERSION))),\ - $(call gb_LinkTarget__command,$@,$*)) - $(call gb_LinkTarget__command_objectlist,$@,$*) +$(WORKDIR)/LinkTarget/% : $(call gb_LinkTarget_get_headers_target,%) $(gb_Helper_MISCDUMMY) + $(call gb_LinkTarget__command_impl,$@,$*) + +# call gb_LinkTarget__command_impl,linktargettarget,linktargetname +define gb_LinkTarget__command_impl + $(if $(gb_FULLDEPS),\ + $(if $(findstring concat-deps,$(2)),,\ + $(call gb_LinkTarget__command_dep,$(call gb_LinkTarget_get_dep_target,$(2)),$(2)))) + $(if $(filter $(2),$(foreach lib,$(gb_MERGEDLIBS) $(gb_URELIBS),$(call gb_Library__get_workdir_linktargetname,$(lib)))),\ + $(if $(filter $(true),$(call gb_LinkTarget__is_build_lib,$(2))),\ + $(call gb_LinkTarget__command,$(1),$(2)),\ + 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)) $(call gb_LinkTarget_get_dep_target,%) : $(call gb_Executable_get_runtime_dependencies,concat-deps) @@ -468,7 +472,7 @@ define gb_LinkTarget__get_headers_check ifneq ($$(SELF),$$*) $$(eval $$(call gb_Output_info,LinkTarget $$* not defined: Assuming headers to be there!,ALL)) 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 @@ -514,7 +518,7 @@ $(call gb_LinkTarget_get_headers_target,%) : # call gb_LinkTarget_LinkTarget,linktarget,linktargetmakefilename define gb_LinkTarget_LinkTarget $(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_clean_target,$(1)) \ $(call gb_LinkTarget_get_target,$(1)) : COBJECTS := @@ -607,7 +611,7 @@ $(call gb_LinkTarget_get_dep_target,$(1)) : SOVERSION := $(call gb_LinkTarget_get_dep_target,$(1)) : SOVERSIONSCRIPT := endif -gb_LinkTarget_CXX_SUFFIX_$(1) := cxx +gb_LinkTarget_CXX_SUFFIX_$(call gb_LinkTarget__get_workdir_linktargetname,$(1)) := cxx endef @@ -850,7 +854,7 @@ define gb_LinkTarget__use_libraries # used by bin/module-deps.pl ifneq ($(ENABLE_PRINT_DEPS),) # 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))) endif endif @@ -886,12 +890,12 @@ gb_BUILD_HELPER_TOOLS := cppumaker \ # call gb_LinkTarget__is_build_lib,linktargetname 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 # call gb_LinkTarget__is_build_tool,linktargetname 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 # call gb_LinkTarget_use_libraries,linktarget,libs @@ -903,19 +907,18 @@ endif ifeq ($(call gb_LinkTarget__is_build_tool,$(1)),$(true)) $(call gb_LinkTarget__use_libraries,$(1),$(2),$(2),$(4)) - else $(call gb_LinkTarget__use_libraries,$(1),$(2),$(strip \ $(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)) \ $(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-out $(gb_MERGEDLIBS) $(gb_URELIBS),$(2)) \ ),$(4)) - endif + endef define gb_LinkTarget_add_linked_static_libs @@ -966,7 +969,7 @@ $(call gb_CxxObject_get_target,$(2)) : T_CXXFLAGS += $(3) $(call gb_CxxObject_get_target,$(2)) : \ OBJECTOWNER := $(call gb_Object__owner,$(2),$(1)) 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 ifeq ($(gb_FULLDEPS),$(true)) @@ -1077,7 +1080,7 @@ $(call gb_GenCxxObject_get_target,$(2)) : \ OBJECTOWNER := $(call gb_Object__owner,$(2),$(1)) $(call gb_GenCxxObject_get_target,$(2)) : GEN_CXX_SOURCE := $(call gb_GenCxxObject_get_source,$(2),$(1)) 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 ifeq ($(gb_FULLDEPS),$(true)) @@ -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_error,Cannot import objects library/libraries $$(filter-out $(gb_Library_KNOWNLIBS),$(2)). Libraries must be registered in Repository.mk)) 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)) : \ $(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 $(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)) -include $(call gb_PrecompiledHeader_get_dep_target,$(3)) @@ -1437,7 +1440,7 @@ endef # # call gb_LinkTarget_set_generated_cxx_suffix,linktarget,used-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 diff --git a/solenv/gbuild/StaticLibrary.mk b/solenv/gbuild/StaticLibrary.mk index 02a358ac11c7..ea8c5d8635c4 100644 --- a/solenv/gbuild/StaticLibrary.mk +++ b/solenv/gbuild/StaticLibrary.mk @@ -36,10 +36,11 @@ $(WORKDIR)/Clean/OutDir/lib/%$(gb_StaticLibrary_PLAINEXT) : $(AUXTARGETS)) 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 +# call gb_StaticLibrary__StaticLibrary_impl,staticlib,linktarget define gb_StaticLibrary__StaticLibrary_impl $(call gb_LinkTarget_LinkTarget,$(2),StaticLibrary_$(1)) $(call gb_LinkTarget_set_targettype,$(2),StaticLibrary) @@ -55,7 +56,7 @@ $(call gb_Deliver_add_deliverable,$(call gb_StaticLibrary_get_target,$(1)),$(cal endef 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 diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk index 73c55d7afc6f..e75626d5bee2 100644 --- a/solenv/gbuild/TargetLocations.mk +++ b/solenv/gbuild/TargetLocations.mk @@ -137,9 +137,16 @@ gb_JunitTest_get_classsetname = JunitTest/$(1) gb_JunitTest_get_target = $(WORKDIR)/JunitTest/$(1)/done gb_JunitTest_get_userdir = $(WORKDIR)/JunitTest/$(1)/user gb_PythonTest_get_target = $(WORKDIR)/PythonTest/$(1)/done -gb_LinkTarget_get_headers_target = $(WORKDIR)/Headers/$(1) -gb_LinkTarget_get_target = $(WORKDIR)/LinkTarget/$(1) -gb_LinkTarget_get_objects_list = $(WORKDIR)/LinkTarget/$(1).objectlist +gb_LinkTarget__get_workdir_linktargetname = $(firstword $(subst <>, ,$(1))) +gb_LinkTarget_get_headers_target = \ + $(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_check_target = $(WORKDIR)/Module/check/$(1) gb_Module_get_slowcheck_target = $(WORKDIR)/Module/slowcheck/$(1) @@ -265,7 +272,6 @@ $(eval $(call gb_Helper_make_clean_targets,\ JavaClassSet \ Jar \ JunitTest \ - LinkTarget \ Module \ PackagePart \ Package \ @@ -329,7 +335,6 @@ $(eval $(call gb_Helper_make_dep_targets,\ AsmObject \ GenCObject \ GenCxxObject \ - LinkTarget \ SdiTarget \ SrsPartTarget \ SrsTarget \ @@ -372,9 +377,48 @@ define gb_Executable_get_command $(gb_Helper_set_ld_path) $(2) $(call gb_Executable_get_target_for_build,$(1)) endef -gb_Executable_get_linktargetname = Executable/$(call gb_Executable_get_filename,$(1)) -gb_Library_get_linktargetname = Library/$(call gb_Library_get_filename,$(1)) -gb_StaticLibrary_get_linktargetname = StaticLibrary/$(call gb_StaticLibrary_get_filename,$(1)) +define gb_Executable__get_workdir_linktargetname +Executable/$(call gb_Executable_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 diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk index 706aa3b45357..35a3d7e91577 100644 --- a/solenv/gbuild/platform/com_GCC_class.mk +++ b/solenv/gbuild/platform/com_GCC_class.mk @@ -200,7 +200,7 @@ $(call gb_Helper_abbreviate_dirs,\ endef 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 # YaccTarget class diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk index 1cc1aea6425a..6f6ebe905554 100644 --- a/solenv/gbuild/platform/com_MSC_class.mk +++ b/solenv/gbuild/platform/com_MSC_class.mk @@ -136,7 +136,8 @@ gb_LinkTarget_INCLUDE :=\ $(foreach inc,$(subst ;, ,$(JDKINC)),-I$(inc)) \ -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 define gb_LinkTarget_MergedResponseFile @@ -164,7 +165,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \ $(foreach extraobjectlist,$(EXTRAOBJECTLISTS),$(shell cat $(extraobjectlist))) \ $(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 && \ $(if $(filter YES,$(LIBRARY_X64)), $(LINK_X64_BINARY), $(gb_LINK)) \ $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \ @@ -269,7 +270,7 @@ gb_Library_DLLFILENAMES :=\ # An assembly is a special kind of library for CLI define gb_Library_Assembly $(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 @@ -343,7 +344,7 @@ endef # in effect this just causes the .export target to be touched # cannot be the .lib itself because that causes attempts to get it linked :( 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 diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk index f99283629fb1..9ef7a6283900 100644 --- a/solenv/gbuild/platform/macosx.mk +++ b/solenv/gbuild/platform/macosx.mk @@ -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) define gb_Library_Bundle $(call gb_Library_Library,$(1)) -$(call gb_LinkTarget_set_targettype,$(call gb_Library_get_linktargetname,$(1)),Bundle) -$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,$(1))) : \ +$(call gb_LinkTarget_set_targettype,$(call gb_Library_get_linktarget,$(1)),Bundle) +$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,$(1))) : \ RPATH := endef diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk index 78e401c5803b..e2829369a47d 100644 --- a/solenv/gbuild/platform/solaris.mk +++ b/solenv/gbuild/platform/solaris.mk @@ -171,7 +171,7 @@ $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(1)) && \ $(if $(CXXOBJECTS)$(GENCXXOBJECTS)$(EXTRAOBJECTLISTS),$(gb_CXX),$(gb_CC)) \ $(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 $(SOVERSIONSCRIPT),-Wl$(COMMA)--version-script=$(SOVERSIONSCRIPT))\ $(subst \d,$$,$(RPATH)) \ @@ -215,7 +215,7 @@ endef define gb_LinkTarget__command $(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))) endef diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk index ae19f5b6689a..229e525e6ab4 100644 --- a/solenv/gbuild/platform/unxgcc.mk +++ b/solenv/gbuild/platform/unxgcc.mk @@ -173,7 +173,7 @@ $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(1)) && \ $(if $(CXXOBJECTS)$(GENCXXOBJECTS)$(EXTRAOBJECTLISTS),$(gb_CXX),$(gb_CC)) \ $(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 $(SOVERSIONSCRIPT),-Wl$(COMMA)--version-script=$(SOVERSIONSCRIPT))\ $(subst \d,$$,$(RPATH)) \ @@ -217,7 +217,7 @@ endef define gb_LinkTarget__command $(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))) endef |