diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-10-23 14:00:50 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-10-23 15:12:43 +0200 |
commit | 85b6a93cf41fb05e726027e34fcd805330e20414 (patch) | |
tree | 3f0404f073b8bd6d442a59e8075a1c25d61b54da /solenv | |
parent | change translations (diff) | |
download | core-85b6a93cf41fb05e726027e34fcd805330e20414.tar.gz core-85b6a93cf41fb05e726027e34fcd805330e20414.zip |
gbuild: fix AUXTARGETS:
This finally blew up spectacularly on Windows because we now have
packages delivering external libraries to the solver, where the
libraries are not defined by Library class, which leads to accidental
inheritance of AUXTARGETS variable and failure to deliver nonexistent
UnpackedTarball/.../libpq/postgresql-sdbc-impl.uno.dll
Remove the custom deliver rule that uses AUXTARGETS, and instead
let those files be handled individually by default Package.mk rules.
This requires a dummy touch rule for each file, and unfortunately a
pattern rule cannot be used here because of silly naming differences
between implibs and dlls on Windows...
AUXTARGETS do not cause problems for clean targets because there is no
interdependency there, so keep them there.
Change-Id: I2138f635334ff4517a2d31ef91cfd03a46745fd6
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/gbuild/Executable.mk | 15 | ||||
-rw-r--r-- | solenv/gbuild/Library.mk | 30 | ||||
-rw-r--r-- | solenv/gbuild/LinkTarget.mk | 28 | ||||
-rw-r--r-- | solenv/gbuild/StaticLibrary.mk | 8 | ||||
-rw-r--r-- | solenv/gbuild/platform/WNT_INTEL_GCC.mk | 11 | ||||
-rw-r--r-- | solenv/gbuild/platform/WNT_INTEL_MSC.mk | 20 |
6 files changed, 72 insertions, 40 deletions
diff --git a/solenv/gbuild/Executable.mk b/solenv/gbuild/Executable.mk index 7517e1621013..fab3be92e39d 100644 --- a/solenv/gbuild/Executable.mk +++ b/solenv/gbuild/Executable.mk @@ -37,11 +37,6 @@ $(call gb_Executable_get_clean_target,%) : rm -f $(call gb_Executable_get_target,$*) \ $(AUXTARGETS)) -$(call gb_Executable_get_target,%) : - $(call gb_Helper_abbreviate_dirs,\ - $(call gb_Deliver_deliver,$<,$@) \ - $(foreach target,$(AUXTARGETS), && $(call gb_Deliver_deliver,$(dir $<)/$(notdir $(target)),$(target)))) - define gb_Executable_Executable ifeq (,$$(findstring $(1),$$(gb_Executable_KNOWN))) $$(eval $$(call gb_Output_info,Currently known executables: $(sort $(gb_Executable_KNOWN)),ALL)) @@ -58,6 +53,7 @@ $(call gb_LinkTarget_add_libs,$(2),$(gb_STDLIBS)) $(call gb_Executable_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2)) \ | $(dir $(call gb_Executable_get_target,$(1))).dir $(call gb_Executable_get_clean_target,$(1)) : $(call gb_LinkTarget_get_clean_target,$(2)) +$(call gb_Executable_get_clean_target,$(1)) : AUXTARGETS := $(call gb_Executable_Executable_platform,$(1),$(2)) $$(eval $$(call gb_Module_register_target,$(call gb_Executable_get_target,$(1)),$(call gb_Executable_get_clean_target,$(1)))) $(call gb_Deliver_add_deliverable,$(call gb_Executable_get_target,$(1)),$(call gb_LinkTarget_get_target,$(2)),$(1)) @@ -68,6 +64,15 @@ define gb_Executable_set_targettype_gui $(call gb_LinkTarget_get_target,Executable/$(1)$(gb_Executable_EXT)) : 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_Executable_get_target,$(1)) : $(2) +$(2) : $(dir $(call gb_LinkTarget_get_target,$(call gb_Executable_get_linktargetname,$(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)) diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk index 924a2549ebbf..bb799114901c 100644 --- a/solenv/gbuild/Library.mk +++ b/solenv/gbuild/Library.mk @@ -48,18 +48,11 @@ $(WORKDIR)/Clean/OutDir/lib/%$(gb_Library_PLAINEXT) : rm -f $(OUTDIR)/lib/$*$(gb_Library_PLAINEXT) \ $(AUXTARGETS)) -# EVIL: gb_StaticLibrary and gb_Library need the same deliver rule because they are indistinguishable on windows -$(gb_Library_OUTDIRLOCATION)/%$(gb_Library_PLAINEXT) : - $(call gb_Helper_abbreviate_dirs,\ - $(call gb_Deliver_deliver,$<,$@) \ - $(foreach target,$(AUXTARGETS), && $(call gb_Deliver_deliver,$(dir $<)/$(notdir $(target)),$(target)))) - define gb_Library_Library ifeq (,$$(findstring $(1),$$(gb_Library_KNOWNLIBS))) $$(eval $$(call gb_Output_info,Currently known libraries are: $(sort $(gb_Library_KNOWNLIBS)),ALL)) $$(eval $$(call gb_Output_error,Library $(1) must be registered in Repository.mk)) endif -$(call gb_Library_get_target,$(1)) : AUXTARGETS := $(call gb_Library_get_target,$(1)) : SOVERSION := $(call gb_Library__Library_impl,$(1),$(call gb_Library_get_linktargetname,$(1))) @@ -76,18 +69,35 @@ $(call gb_Library__get_final_target,$(1)) : $(call gb_Library_get_target,$(1)) $(call gb_Library_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2)) \ | $(dir $(call gb_Library_get_target,$(1))).dir $(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))) $$(eval $$(call gb_Module_register_target,$(call gb_Library__get_final_target,$(1)),$(call gb_Library_get_clean_target,$(1)))) $(call gb_Deliver_add_deliverable,$(call gb_Library_get_target,$(1)),$(call gb_LinkTarget_get_target,$(2)),$(1)) 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. +# 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_Library_get_target,$(1)) : $(2) +$(2) : $(dir $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,$(1))))/$(notdir $(2)) +$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS += $(2) + +endef + +define gb_Library_add_auxtargets +$(foreach aux,$(2),$(call gb_Library_add_auxtarget,$(1),$(aux))) + +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_get_target,$(1)) \ -$(call gb_Library_get_clean_target,$(1)) : \ - AUXTARGETS += $(call gb_Library_get_target,$(1)).$(2) +$(call gb_Library_add_auxtarget,$(1),$(call gb_Library_get_target,$(1)).$(2)) + endef # for libraries that maintain stable ABI: set SOVERSION and version script diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk index 69b9ee0ecf7a..064ca8ebfc5c 100644 --- a/solenv/gbuild/LinkTarget.mk +++ b/solenv/gbuild/LinkTarget.mk @@ -565,7 +565,6 @@ define gb_LinkTarget_set_soversion_script $(call gb_LinkTarget_get_target,$(1)) : $(3) $(call gb_LinkTarget_get_target,$(1)) : SOVERSION := $(2) $(call gb_LinkTarget_get_target,$(1)) : SOVERSIONSCRIPT := $(3) -$(call gb_LinkTarget_add_auxtargets,$(1),$(call gb_LinkTarget_get_target,$(1)).$(2)) endef @@ -1090,11 +1089,36 @@ $$(call gb_Output_error,\ gb_LinkTarget_set_auxtargets: use gb_LinkTarget_add_auxtargets instead.) endef -define gb_LinkTarget_add_auxtargets +# Add a file that is built by the LinkTarget command and define +# a dummy touch rule for it so it can be tracked via dependencies. +# gb_LinkTarget_add_auxtarget linktarget auxtarget +define gb_LinkTarget_add_auxtarget +$(2) : $(call gb_LinkTarget_get_target,$(1)) + touch $$@ + $(call gb_LinkTarget_get_clean_target,$(1)) : AUXTARGETS += $(2) endef +define gb_LinkTarget_add_auxtargets +$(foreach aux,$(2),$(call gb_LinkTarget_add_auxtarget,$(1),$(aux))) + +endef + +#$(2)/$(3) : $(dir $(call gb_LinkTarget_get_target,$(1)/$(3)))/$(notdir $(2)) +#$(dir $(call gb_LinkTarget_get_target,$(1)))/$(notdir $(3)) : $(call gb_LinkTarget_get_target,$(3)) +# CLEAN??? inheritance not a problem here? +#$(dir $(call gb_LinkTarget_get_target,$(1)))/$(notdir $(2)) : $() + +# linktarget-type, outdir-dir, pattern +# define a dummy touch rule for auxtargets +# linktarget-type, aux-pattern, linktarget-pattern +#define gb_LinkTarget__define_auxtarget_rule +#$(call gb_LinkTarget_get_target,$(1))/$(2) : $(call gb_LinkTarget_get_target,$(1)/$(3)) +# touch $@ +# +#endef + define gb_LinkTarget__add_internal_headers $(call gb_LinkTarget_get_headers_target,$(1)) : $(2) $(2) :| $(call gb_LinkTarget_get_external_headers_target,$(1)) diff --git a/solenv/gbuild/StaticLibrary.mk b/solenv/gbuild/StaticLibrary.mk index fdebb6aaa2ea..e1e0fc51e066 100644 --- a/solenv/gbuild/StaticLibrary.mk +++ b/solenv/gbuild/StaticLibrary.mk @@ -42,18 +42,11 @@ $(WORKDIR)/Clean/OutDir/lib/%$(gb_StaticLibrary_PLAINEXT) : rm -f $(OUTDIR)/lib/$*$(gb_StaticLibrary_PLAINEXT) \ $(AUXTARGETS)) -# EVIL: gb_StaticLibrary and gb_Library need the same deliver rule because they are indistinguishable on windows -$(gb_StaticLibrary_OUTDIRLOCATION)/%$(gb_StaticLibrary_PLAINEXT) : - $(call gb_Helper_abbreviate_dirs,\ - $(call gb_Deliver_deliver,$<,$@) \ - $(foreach target,$(AUXTARGETS), && $(call gb_Deliver_deliver,$(dir $<)/$(notdir $(target)),$(target)))) - define gb_StaticLibrary_StaticLibrary ifeq (,$$(findstring $(1),$$(gb_StaticLibrary_KNOWNLIBS))) $$(eval $$(call gb_Output_info,Currently known static libraries are: $(sort $(gb_StaticLibrary_KNOWNLIBS)),ALL)) $$(eval $$(call gb_Output_error,Static library $(1) must be registered in Repository.mk)) endif -$(call gb_StaticLibrary_get_target,$(1)) : AUXTARGETS := $(call gb_StaticLibrary__StaticLibrary_impl,$(1),$(call gb_StaticLibrary_get_linktargetname,$(1))) endef @@ -64,6 +57,7 @@ $(call gb_LinkTarget_set_targettype,$(2),StaticLibrary) $(call gb_StaticLibrary_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2)) \ | $(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_Deliver_add_deliverable,$(call gb_StaticLibrary_get_target,$(1)),$(call gb_LinkTarget_get_target,$(2)),$(1)) diff --git a/solenv/gbuild/platform/WNT_INTEL_GCC.mk b/solenv/gbuild/platform/WNT_INTEL_GCC.mk index 525bc1e15ebc..ae1e7857b0c6 100644 --- a/solenv/gbuild/platform/WNT_INTEL_GCC.mk +++ b/solenv/gbuild/platform/WNT_INTEL_GCC.mk @@ -259,14 +259,12 @@ gb_Library_ILIBEXT := .lib define gb_Library_Library_platform $(call gb_LinkTarget_set_dlltarget,$(2),$(3)) -$(call gb_LinkTarget_add_auxtargets,$(2),\ - $(patsubst %.dll,%.map,$(3)) \ -) - $(call gb_Library_get_target,$(1)) :| $(OUTDIR)/bin/.dir -$(call gb_Library_get_target,$(1)) \ -$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS := $(OUTDIR)/bin/$(notdir $(3)) $(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.map,$(3))) +$(call gb_Library_add_auxtargets,$(1), \ + $(OUTDIR)/bin/$(notdir $(3)) \ + $(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.map,$(3))) \ +) $(call gb_Library_add_default_nativeres,$(1),$(1)/default) @@ -333,6 +331,7 @@ define gb_CppunitTest_CppunitTest_platform $(call gb_LinkTarget_set_dlltarget,$(2),$(3)) $(call gb_LinkTarget_add_auxtargets,$(2),\ + $(3) \ $(patsubst %.dll,%.map,$(3)) \ ) diff --git a/solenv/gbuild/platform/WNT_INTEL_MSC.mk b/solenv/gbuild/platform/WNT_INTEL_MSC.mk index 8e02e179fc7e..d3ffc061ab9c 100644 --- a/solenv/gbuild/platform/WNT_INTEL_MSC.mk +++ b/solenv/gbuild/platform/WNT_INTEL_MSC.mk @@ -458,20 +458,21 @@ $(call gb_LinkTarget_add_auxtargets,$(2),\ $(patsubst %.lib,%.exp,$(call gb_LinkTarget_get_target,$(2))) \ $(3).manifest \ $(call gb_LinkTarget_get_pdbfile,$(2)) \ - $(patsubst %.dll,%.pdb,$(3)) \ - $(patsubst %.dll,%.ilk,$(3)) \ ) $(if $(filter $(gb_MERGEDLIBS),$(1)),,\ -$(call gb_Library_get_target,$(1)) \ -$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS := $(OUTDIR)/bin/$(notdir $(3))) +$(call gb_Library_add_auxtarget,$(1),$(OUTDIR)/bin/$(notdir $(3)))) ifneq ($(ENABLE_CRASHDUMP),) -$(call gb_Library_get_target,$(1)) \ -$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS += \ +$(call gb_Library_add_auxtargets,$(1), $(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.pdb,$(3))) \ $(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.ilk,$(3))) \ - +) +else +$(call gb_LinkTarget_add_auxtargets,$(2),\ + $(patsubst %.dll,%.pdb,$(3)) \ + $(patsubst %.dll,%.ilk,$(3)) \ +) endif $(call gb_Library_add_default_nativeres,$(1),$(1)/default) @@ -542,11 +543,9 @@ define gb_Executable_Executable_platform $(call gb_LinkTarget_add_auxtargets,$(2),\ $(patsubst %.exe,%.pdb,$(call gb_LinkTarget_get_target,$(2))) \ $(call gb_LinkTarget_get_pdbfile,$(2)) \ - $(call gb_LinkTarget_get_target,$(2)).manifest \ ) -$(call gb_Executable_get_target,$(1)) \ -$(call gb_Executable_get_clean_target,$(1)) : AUXTARGETS := $(call gb_Executable_get_target,$(1)).manifest +$(call gb_Executable_add_auxtarget,$(1),$(call gb_Executable_get_target,$(1)).manifest) $(call gb_Deliver_add_deliverable,$(call gb_Executable_get_target,$(1)).manifest,$(call gb_LinkTarget_get_target,$(2)).manifest,$(1)) $(call gb_LinkTarget_get_target,$(2)) \ @@ -573,6 +572,7 @@ $(call gb_LinkTarget_set_dlltarget,$(2),$(3)) $(call gb_LinkTarget_add_auxtargets,$(2),\ $(patsubst %.lib,%.exp,$(call gb_LinkTarget_get_target,$(2))) \ + $(3) \ $(3).manifest \ $(patsubst %.dll,%.pdb,$(3)) \ $(call gb_LinkTarget_get_pdbfile,$(2)) \ |