diff options
author | Matúš Kukan <matus.kukan@gmail.com> | 2013-06-14 22:06:09 +0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@gmail.com> | 2013-06-15 21:32:38 +0200 |
commit | 6e2d870fccb5f0c311e0e7e908d1b7cf30bd7455 (patch) | |
tree | 29e6f7fbcaf49c09690bf1113df30177c82fa1a6 /solenv | |
parent | 1f2a635ae159b62ab3a0dcbf7d460484f83ff77b (diff) |
gbuild: add gb_Helper_install and use it for Executables
It's simpler than creating a package for every executable.
Change-Id: I5f853ef2d5574b1a1c65232d1d09bc307c46f67e
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/gbuild/Executable.mk | 35 | ||||
-rw-r--r-- | solenv/gbuild/Helper.mk | 11 |
2 files changed, 20 insertions, 26 deletions
diff --git a/solenv/gbuild/Executable.mk b/solenv/gbuild/Executable.mk index 06541dd10c3c..7611ea3b0475 100644 --- a/solenv/gbuild/Executable.mk +++ b/solenv/gbuild/Executable.mk @@ -23,9 +23,9 @@ # gb_Executable_Executable_platform # NOTE: SDKBIN executables are already packaged in module odk -gb_Executable_LAYER_DIRS := \ - OOO:program \ - UREBIN:ure/bin +gb_Executable_LAYER_DIRS = \ + OOO:$(gb_Package_PROGRAMDIRNAME) \ + UREBIN:ure/bin $(dir $(call gb_Executable_get_runtime_target,%)).dir : $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) @@ -43,10 +43,10 @@ $(call gb_Executable_get_clean_target,%) : $(call gb_Executable_get_runtime_target,$*) \ $(AUXTARGETS)) -gb_Executable_get_packagename = Executable/$(1) - -gb_Executable__get_dir_for_layer = $(patsubst $(1):%,%,$(filter $(1):%,$(gb_Executable_LAYER_DIRS))) -gb_Executable__get_instdir = $(call gb_Executable__get_dir_for_layer,$(call gb_Executable_get_layer,$(1))) +gb_Executable__get_dir_for_layer = $(patsubst $(1):%,$(INSTDIR)/%,$(filter $(1):%,$(call gb_Executable_LAYER_DIRS))) +gb_Executable__get_dir_for_exe = $(call gb_Executable__get_dir_for_layer,$(call gb_Executable_get_layer,$(1))) +gb_Executable__get_instdir = $(call gb_Executable__get_dir_for_exe,$(1))/$(call gb_Executable_get_filename,$(1)) +gb_Executable_get_install_target = $(if $(call gb_Executable__get_dir_for_exe,$(1)),$(call gb_Executable__get_instdir,$(1))) define gb_Executable_Executable $(call gb_Postprocess_register_target,AllExecutables,Executable,$(1)) @@ -67,33 +67,16 @@ $(call gb_Executable_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2)) \ $(call gb_Executable_get_runtime_target,$(1)) :| $(dir $(call gb_Executable_get_runtime_target,$(1))).dir $(call gb_Executable_get_runtime_target,$(1)) : $(call gb_Executable_get_target_for_build,$(1)) $(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_get_clean_target,$(1)) : AUXTARGETS := $(call gb_Executable_get_install_target,$(1)) $(call gb_Executable_Executable_platform,$(1),$(2)) -ifneq ($(gb_RUNNABLE_INSTDIR),) -$(if $(filter $(call gb_Executable_get_layer,$(1)):%,$(gb_Executable_LAYER_DIRS)),\ - $(call gb_Executable__Executable_package,$(1),$(call gb_Executable_get_packagename,$(1)),$(2),$(notdir $(call gb_Executable_get_target,$(1)))) \ -) -endif - +$(call gb_Helper_install,Executable,$(1),$(call gb_LinkTarget_get_target,$(2))) $$(eval $$(call gb_Module_register_target,$(call gb_Executable_get_target,$(1)),$(call gb_Executable_get_clean_target,$(1)))) $(call gb_Helper_make_userfriendly_targets,$(1),Executable) $(call gb_Deliver_add_deliverable,$(call gb_Executable_get_target,$(1)),$(call gb_LinkTarget_get_target,$(2)),$(1)) endef -# gb_Executable__Executable_package executable package linktarget filename -define gb_Executable__Executable_package -$(call gb_Package_Package_internal,$(2),$(WORKDIR)) -$(call gb_Package_set_outdir,$(2),$(INSTDIR)) -$(call gb_Package_add_file,$(2),$(call gb_Executable__get_instdir,$(1))/$(4),$(subst $(WORKDIR)/,,$(call gb_LinkTarget_get_target,$(3)))) - -$(call gb_Executable_get_target,$(1)) :| $(call gb_Package_get_target,$(2)) -$(call gb_Package_get_target,$(2)) : $(call gb_LinkTarget_get_target,$(3)) -$(call gb_Executable_get_clean_target,$(1)) : $(call gb_Package_get_clean_target,$(2)) - -endef - define gb_Executable_set_targettype_gui $(call gb_LinkTarget_get_target,$(call gb_Executable_get_linktargetname,$(1))) : TARGETGUI := $(2) endef diff --git a/solenv/gbuild/Helper.mk b/solenv/gbuild/Helper.mk index cb51f503da7b..b017a40a3b64 100644 --- a/solenv/gbuild/Helper.mk +++ b/solenv/gbuild/Helper.mk @@ -201,6 +201,17 @@ define gb_Helper_execute $(call gb_Executable_get_command,$(firstword $(1))) $(wordlist 2,$(words $(1)),$(1)) endef +# define gb_Helper_install class instance-name target-to-install +define gb_Helper_install +ifneq (,$(call gb_$(1)_get_install_target,$(2))) +$(call gb_$(1)_get_target,$(2)) :| $(call gb_$(1)_get_install_target,$(2)) +$(call gb_$(1)_get_install_target,$(2)) : $(3) \ + | $(dir $(call gb_$(1)_get_install_target,$(2))).dir +$(call gb_Deliver_add_deliverable,$(call gb_$(1)_get_install_target,$(2)),$(3),$(2)) +endif + +endef + # gb_Helper_OUTDIRLIBDIR is set by the platform to the path the dynamic linker need to use # for libraries from the OUTDIR |