diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-10-28 10:01:34 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-10-28 14:01:07 +0100 |
commit | decf809674a837bfddb5b9a376502927364377e8 (patch) | |
tree | aaf3ba51d5a414e02e43983ed173331907101427 /solenv/gbuild | |
parent | a2f9c446b79d50d808bdc6e3487d230459f81260 (diff) |
fdo#69601: refactor CliNativeLibrary
- stop copying the DLL to OUTDIR
- since that was the main reason for the separation between
CliNativeLibrary and CliNativeLibraryTarget, merge the targets;
the newly inherited variables are not expected to cause problems
- the Library remains in layer NONE; the derived CliNativeLibrary
is in INSTDIR
- hardcode target to URE bin dir for now, no immediate need for
multiple layers
Change-Id: I3bf4859e8c574f84d69eb43d12ddce0d34b5730c
Diffstat (limited to 'solenv/gbuild')
-rw-r--r-- | solenv/gbuild/CliNativeLibrary.mk | 103 | ||||
-rw-r--r-- | solenv/gbuild/TargetLocations.mk | 9 |
2 files changed, 39 insertions, 73 deletions
diff --git a/solenv/gbuild/CliNativeLibrary.mk b/solenv/gbuild/CliNativeLibrary.mk index b014a18b011b..84c19c1e8473 100644 --- a/solenv/gbuild/CliNativeLibrary.mk +++ b/solenv/gbuild/CliNativeLibrary.mk @@ -7,14 +7,15 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -# CliNativeLibraryTarget class +# CliNativeLibrary class -gb_CliNativeLibraryTarget_EXT := $(gb_CliAssembly_POLICYEXT) +gb_CliNativeLibrary_PLATFORM_DEFAULT := x86 +gb_CliNativeLibrary_EXT := $(gb_CliAssembly_POLICYEXT) -gb_CliNativeLibraryTarget__get_library = $(call gb_CliAssembly_get_dll,$(1)) +gb_CliNativeLibrary__get_library = $(call gb_CliAssembly_get_dll,$(1)) -define gb_CliNativeLibraryTarget__command -$(call gb_Output_announce,$(1),$(true),SN ,4) +define gb_CliNativeLibrary__command +$(call gb_Output_announce,$(2),$(true),SN ,4) $(call gb_Helper_abbreviate_dirs,\ $(GNUCOPY) $(CLI_NATIVE_LIBRARY) $(1).tmp && \ sn -R $(1).tmp $(CLI_NATIVE_KEYFILE) && \ @@ -22,86 +23,43 @@ $(call gb_Helper_abbreviate_dirs,\ ) endef -$(dir $(call gb_CliNativeLibraryTarget_get_target,%)).dir : - $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) - -$(dir $(call gb_CliNativeLibraryTarget_get_target,%))%/.dir : - $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) - -$(call gb_CliNativeLibraryTarget_get_target,%) : - $(call gb_CliNativeLibraryTarget__command,$@,$*,$<) +$(call gb_CliNativeLibrary_get_preparation_target,%) : + mkdir -p $(dir $@) && touch $@ -$(call gb_CliNativeLibraryTarget_get_external_target,%) : - touch $@ - -.PHONY : $(call gb_CliNativeLibraryTarget_get_clean_target,%) -$(call gb_CliNativeLibraryTarget_get_clean_target,%) : +.PHONY : $(call gb_CliNativeLibrary_get_clean_target,%) +$(call gb_CliNativeLibrary_get_clean_target,%) : $(call gb_Output_announce,$*,$(false),SN ,4) $(call gb_Helper_abbreviate_dirs,\ - rm -rf $(call gb_CliNativeLibraryTarget_get_target,$*) \ - $(call gb_CliNativeLibraryTarget_get_external_target,$*) \ + rm -rf $(call gb_CliNativeLibrary_get_target,$*) \ + $(call gb_CliNativeLibrary_get_preparation_target,$*) \ ) -define gb_CliNativeLibraryTarget_CliNativeLibraryTarget -$(call gb_CliNativeLibraryTarget_get_target,$(1)) : CLI_NATIVE_ASSEMBLIES := $(gb_Helper_MISCDUMMY) -$(call gb_CliNativeLibraryTarget_get_target,$(1)) : CLI_NATIVE_KEYFILE := -$(call gb_CliNativeLibraryTarget_get_target,$(1)) : CLI_NATIVE_LIBRARY := - -$(call gb_CliNativeLibraryTarget_get_external_target,$(1)) :| $(dir $(call gb_CliNativeLibraryTarget_get_target,$(1))).dir -$(call gb_CliNativeLibraryTarget_get_target,$(1)) :| $(dir $(call gb_CliNativeLibraryTarget_get_target,$(1))).dir - -endef - -define gb_CliNativeLibraryTarget_wrap_library -$(call gb_CliNativeLibraryTarget_get_target,$(1)) : CLI_NATIVE_LIBRARY := $(call gb_CliNativeLibraryTarget__get_library,$(2)) -$(call gb_CliNativeLibraryTarget_get_target,$(1)) : $(call gb_Library_get_target,$(2)) -$(call gb_Library_get_headers_target,$(2)) : $(call gb_CliNativeLibraryTarget_get_external_target,$(1)) - -endef - -define gb_CliNativeLibraryTarget_set_keyfile -$(call gb_CliNativeLibraryTarget_get_target,$(1)) : CLI_NATIVE_KEYFILE := $(2) -$(call gb_CliNativeLibraryTarget_get_target,$(1)) : $(2) - -endef - -define gb_CliNativeLibraryTarget_use_assembly -$(call gb_CliNativeLibraryTarget_get_target,$(1)) : CLI_NATIVE_ASSEMBLIES += $(call gb_CliLibrary_get_target,$(2)) -$(call gb_CliNativeLibraryTarget_get_external_target,$(1)) : $(call gb_CliLibrary_get_target,$(2)) - -endef - -define gb_CliNativeLibraryTarget_use_assemblies -$(foreach assembly,$(2),$(call gb_CliNativeLibraryTarget_use_assembly,$(1),$(assembly))) - -endef - -# CliNativeLibrary class - -gb_CliNativeLibrary_PLATFORM_DEFAULT := x86 -gb_CliNativeLibrary_EXT := $(gb_CliNativeLibraryTarget_EXT) # Create a CLI library for a native library # # CliNativeLibrary target define gb_CliNativeLibrary_CliNativeLibrary -$(call gb_CliNativeLibraryTarget_CliNativeLibraryTarget,$(1)) $(call gb_CliAssembly_CliAssembly,$(1)) -$(call gb_CliNativeLibraryTarget_set_keyfile,$(1),$(gb_CliAssembly_KEYFILE_DEFAULT)) +$(call gb_CliNativeLibrary_get_target,$(1)) : CLI_NATIVE_ASSEMBLIES := $(gb_Helper_MISCDUMMY) +$(call gb_CliNativeLibrary_get_target,$(1)) : CLI_NATIVE_KEYFILE := +$(call gb_CliNativeLibrary_get_target,$(1)) : CLI_NATIVE_LIBRARY := + + +$(call gb_CliNativeLibrary_set_keyfile,$(1),$(gb_CliAssembly_KEYFILE_DEFAULT)) $(call gb_CliAssembly_set_platform,$(1),$(gb_CliNativeLibrary_PLATFORM_DEFAULT)) -$(call gb_CliNativeLibrary_get_target,$(1)) : $(call gb_CliNativeLibraryTarget_get_target,$(1)) $(call gb_CliNativeLibrary_get_target,$(1)) :| $(call gb_CliAssembly_get_target,$(1)) $(call gb_CliNativeLibrary_get_target,$(1)) :| $(dir $(call gb_CliNativeLibrary_get_target,$(1))).dir -$(call gb_CliNativeLibrary_get_clean_target,$(1)) : $(call gb_CliNativeLibraryTarget_get_clean_target,$(1)) $(call gb_CliNativeLibrary_get_clean_target,$(1)) : $(call gb_CliAssembly_get_clean_target,$(1)) -$(call gb_Deliver_add_deliverable,$(call gb_CliNativeLibrary_get_target,$(1)),$(call gb_CliNativeLibraryTarget_get_target,$(1)),$(1)) - $$(eval $$(call gb_Module_register_target,$(call gb_CliNativeLibrary_get_target,$(1)),$(call gb_CliNativeLibrary_get_clean_target,$(1)))) $(call gb_Helper_make_userfriendly_targets,$(1),CliNativeLibrary) +$(call gb_CliNativeLibrary_get_target,$(1)) : + $$(call gb_CliNativeLibrary__command,$$@,$(1)) + + endef define gb_CliNativeLibrary_set_configfile @@ -110,8 +68,9 @@ $(call gb_CliAssembly_set_configfile,$(1),$(2)) endef define gb_CliNativeLibrary_set_keyfile -$(call gb_CliNativeLibraryTarget_set_keyfile,$(1),$(2)) $(call gb_CliAssembly_set_keyfile,$(1),$(2)) +$(call gb_CliNativeLibrary_get_target,$(1)) : CLI_NATIVE_KEYFILE := $(2) +$(call gb_CliNativeLibrary_get_target,$(1)) : $(2) endef @@ -126,17 +85,25 @@ $(call gb_CliAssembly_set_policy,$(1),$(2),$(3)) endef define gb_CliNativeLibrary_wrap_library -$(call gb_CliNativeLibraryTarget_wrap_library,$(1),$(2)) +$(call gb_CliNativeLibrary_get_target,$(1)) : \ + CLI_NATIVE_LIBRARY := $(call gb_CliNativeLibrary__get_library,$(2)) +$(call gb_CliNativeLibrary_get_target,$(1)) : \ + $(call gb_Library_get_target,$(2)) +$(call gb_Library_get_headers_target,$(2)) : \ + $(call gb_CliNativeLibrary_get_preparation_target,$(1)) endef define gb_CliNativeLibrary_use_assembly -$(call gb_CliNativeLibraryTarget_use_assembly,$(1),$(2)) +$(call gb_CliNativeLibrary_get_target,$(1)) : \ + CLI_NATIVE_ASSEMBLIES += $(call gb_CliLibrary_get_target,$(2)) +$(call gb_CliNativeLibrary_get_preparation_target,$(1)) : \ + $(call gb_CliLibrary_get_target,$(2)) endef define gb_CliNativeLibrary_use_assemblies -$(call gb_CliNativeLibraryTarget_use_assemblies,$(1),$(2)) +$(foreach assembly,$(2),$(call gb_CliNativeLibrary_use_assembly,$(1),$(assembly))) endef diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk index 1340593391da..878d747fa939 100644 --- a/solenv/gbuild/TargetLocations.mk +++ b/solenv/gbuild/TargetLocations.mk @@ -19,8 +19,9 @@ # outdir target pattern +# thoese are hard-coded to URE for now since there are so few of them... gb_CliLibrary_get_target = $(gb_Helper_OUTDIRLIBDIR)/$(1)$(gb_CliLibrary_EXT) -gb_CliNativeLibrary_get_target = $(gb_Helper_OUTDIRLIBDIR)/$(1)$(gb_CliNativeLibrary_EXT) +gb_CliNativeLibrary_get_target = $(INSTROOT)/$(LIBO_URE_LIB_FOLDER)/$(1)$(gb_CliNativeLibrary_EXT) gb_CliUnoApi_get_target = $(gb_Helper_OUTDIRLIBDIR)/$(1)$(gb_CliUnoApi_EXT) gb_PackagePart_get_destinations = \ $(INSTDIR) \ @@ -69,8 +70,7 @@ gb_CliAssemblyTarget_get_target = $(WORKDIR)/CliAssemblyTarget/$(1).done gb_CliAssemblyTarget_get_assembly_target = $(WORKDIR)/CliAssemblyTarget/$(1)$(gb_CliAssemblyTarget_POLICYEXT) gb_CliConfigTarget_get_target = $(WORKDIR)/CliConfigTarget/$(1).config gb_CliLibraryTarget_get_target = $(WORKDIR)/CliLibraryTarget/$(1)$(gb_CliLibraryTarget_EXT) -gb_CliNativeLibraryTarget_get_external_target = $(WORKDIR)/CliNativeLibraryTarget/$(1).external -gb_CliNativeLibraryTarget_get_target = $(WORKDIR)/CliNativeLibraryTarget/$(1)$(gb_CliNativeLibraryTarget_EXT) +gb_CliNativeLibrary_get_preparation_target = $(WORKDIR)/CliNativeLibraryTarget/$(1).prepare gb_CliUnoApiTarget_get_target = $(WORKDIR)/CliUnoApiTarget/$(1)$(gb_CliUnoApiTarget_EXT) gb_ComponentTarget_get_target = $(WORKDIR)/ComponentTarget/$(1).component gb_ComponentTarget_get_target_for_build = $(WORKDIR_FOR_BUILD)/ComponentTarget/$(1).component @@ -253,7 +253,7 @@ $(eval $(call gb_Helper_make_clean_targets,\ CliAssemblyTarget \ CliConfigTarget \ CliLibraryTarget \ - CliNativeLibraryTarget \ + CliNativeLibrary \ CliUnoApiTarget \ ComponentTarget \ CustomPackage \ @@ -328,7 +328,6 @@ $(eval $(call gb_Helper_make_clean_targets,\ $(eval $(call gb_Helper_make_outdir_clean_targets,\ CliLibrary \ - CliNativeLibrary \ CliUnoApi \ InstallScript \ )) |