diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-10-30 23:52:56 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-10-31 17:55:16 +0100 |
commit | 21a5dc2ac524815a7b80fa54cd28a7b49aae6d5f (patch) | |
tree | eb93109989a9e4e623fcbbfb785ae0806d928093 /solenv/gbuild | |
parent | ad43a1707353cdef79f6eb2fbc3da1a48838f6e4 (diff) |
gbuild: enforce AutoInstall for Library, Executable, Jar
... by disallowing usage of gb_Helper_register_* without _for_install
for layers that imply installation.
Change-Id: I5734b2d6fbc57196633a562dd5df0236cc290ca6
Diffstat (limited to 'solenv/gbuild')
-rw-r--r-- | solenv/gbuild/Helper.mk | 67 |
1 files changed, 51 insertions, 16 deletions
diff --git a/solenv/gbuild/Helper.mk b/solenv/gbuild/Helper.mk index 398b2f7f9a8c..943cce3e75b7 100644 --- a/solenv/gbuild/Helper.mk +++ b/solenv/gbuild/Helper.mk @@ -92,8 +92,14 @@ $(2)_$(1).clean : $(if $(4),$(4),$(call gb_$(2)_get_clean_target,$(1))) endef define gb_Helper_init_registries +gb_Executable_VALIDGROUPS_INSTALLED := UREBIN SDK OOO +gb_Executable_VALIDGROUPS_NOTINSTALLED := NONE gb_Executable_VALIDGROUPS := UREBIN SDK OOO NONE -gb_Library_VALIDGROUPS := OOOLIBS PLAINLIBS_NONE PLAINLIBS_URE PLAINLIBS_OOO PRIVATELIBS_URE RTVERLIBS UNOVERLIBS EXTENSIONLIBS PLAINLIBS_SHLXTHDL +gb_Library_VALIDGROUPS_INSTALLED := OOOLIBS PLAINLIBS_URE PLAINLIBS_OOO PRIVATELIBS_URE RTVERLIBS UNOVERLIBS PLAINLIBS_SHLXTHDL +gb_Library_VALIDGROUPS_NOTINSTALLED := PLAINLIBS_NONE EXTENSIONLIBS +gb_Library_VALIDGROUPS := OOOLIBS PLAINLIBS_URE PLAINLIBS_OOO PRIVATELIBS_URE RTVERLIBS UNOVERLIBS PLAINLIBS_SHLXTHDL PLAINLIBS_NONE EXTENSIONLIBS +gb_Jar_VALIDGROUPS_INSTALLED := URE OOO +gb_Jar_VALIDGROUPS_NOTINSTALLED := OXT NONE gb_Jar_VALIDGROUPS := URE OOO OXT NONE $$(foreach group,$$(gb_Executable_VALIDGROUPS),$$(eval gb_Executable_$$(group) :=)) @@ -117,10 +123,7 @@ $(foreach group,$(gb_Executable_VALIDGROUPS),\ endef -define gb_Helper_register_executables -ifeq ($$(filter $(1),$$(gb_Executable_VALIDGROUPS)),) -$$(eval $$(call gb_Output_error,$(1) is not a valid group for executables. Valid groups are: $$(gb_Executable_VALIDGROUPS))) -endif +define gb_Helper__register_executables $(foreach group,$(gb_Executable_VALIDGROUPS),\ $(foreach target,$(2),\ $(if $(filter $(target),$(gb_Executable_$(group))),\ @@ -132,18 +135,28 @@ gb_Executable_$(1) += $(2) endef +# $(call gb_Helper_register_executables,layer,exes) +define gb_Helper_register_executables +ifeq ($$(filter $(1),$$(gb_Executable_VALIDGROUPS_NOTINSTALLED)),) +$$(eval $$(call gb_Output_error,$(1) is not a valid group for executables that are not installed. Valid groups are: $$(gb_Executable_VALIDGROUPS_NOTINSTALLED). Use gb_Helper_register_executables_for_install for installed executables.)) +endif +$(call gb_Helper__register_executables,$(1),$(2)) + +endef + +# $(call gb_Helper_register_executables_for_install,layer,installmodule,exes) define gb_Helper_register_executables_for_install $(if $(3),,$(call gb_Output_error,gb_Helper_register_executables_for_install: no executables - need 3 parameters)) -$(call gb_Helper_register_executables,$(1),$(3)) +ifeq ($$(filter $(1),$$(gb_Executable_VALIDGROUPS_INSTALLED)),) +$$(eval $$(call gb_Output_error,$(1) is not a valid group for installed executables. Valid groups are: $$(gb_Executable_VALIDGROUPS_INSTALLED). Use gb_Helper_register_executables for executables that are not installed.)) +endif +$(call gb_Helper__register_executables,$(1),$(3)) gb_Executable_MODULE_$(2) += $(3) endef -define gb_Helper_register_libraries -ifeq ($$(filter $(1),$$(gb_Library_VALIDGROUPS)),) -$$(eval $$(call gb_Output_error,$(1) is not a valid group for libraries. Valid groups are: $$(gb_Library_VALIDGROUPS))) -endif +define gb_Helper__register_libraries $(foreach group,$(gb_Library_VALIDGROUPS),\ $(foreach target,$(2),\ $(if $(filter $(target),$(gb_Library_$(group))),\ @@ -155,12 +168,25 @@ gb_Library_$(1) += $(2) endef +# $(call gb_Helper_register_libraries,layer,libs) +define gb_Helper_register_libraries +ifeq ($$(filter $(1),$$(gb_Library_VALIDGROUPS_NOTINSTALLED)),) +$$(eval $$(call gb_Output_error,$(1) is not a valid group for libraries that are not installed. Valid groups are: $$(gb_Library_VALIDGROUPS_NOTINSTALLED). Use gb_Helper_register_libraries_for_install for installed libraries.)) +endif +$(call gb_Helper__register_libraries,$(1),$(2)) + +endef + # the first argument is the group, which sets rpaths etc. # the second argument is the install module, which describes in which distro package/msi a lib should show up # UGLY: for versioned libraries "sdk" module is hard-coded for now +# $(call gb_Helper_register_libraries_for_install,layer,installmodule,libs) define gb_Helper_register_libraries_for_install $(if $(3),,$(call gb_Output_error,gb_Helper_register_libraries_for_install: no libraries - need 3 parameters)) -$(call gb_Helper_register_libraries,$(1),$(3)) +ifeq ($$(filter $(1),$$(gb_Library_VALIDGROUPS_INSTALLED)),) +$$(eval $$(call gb_Output_error,$(1) is not a valid group for installed libraries. Valid groups are: $$(gb_Library_VALIDGROUPS_INSTALLED). Use gb_Helper_register_libraries for libraries that are not installed.)) +endif +$(call gb_Helper__register_libraries,$(1),$(3)) gb_Library_MODULE_$(2) += $(filter-out $(gb_MERGEDLIBS) $(gb_URELIBS),$(3)) @@ -169,10 +195,7 @@ $(if $(filter UNOVERLIBS RTVERLIBS,$(1)),\ endef -define gb_Helper_register_jars -ifeq ($$(filter $(1),$$(gb_Jar_VALIDGROUPS)),) -$$(eval $$(call gb_Output_error,$(1) is not a valid group for jars. Valid groups are: $$(gb_Jar_VALIDGROUPS))) -endif +define gb_Helper__register_jars $(foreach group,$(gb_Jar_VALIDGROUPS),\ $(foreach target,$(2),\ $(if $(filter $(target),$(gb_Jar_$(group))),\ @@ -184,10 +207,22 @@ gb_Jar_$(1) += $(2) endef +# $(call gb_Helper_register_jars,layer,jars) +define gb_Helper_register_jars +ifeq ($$(filter $(1),$$(gb_Jar_VALIDGROUPS_NOTINSTALLED)),) +$$(eval $$(call gb_Output_error,$(1) is not a valid group for jars that are not installed. Valid groups are: $$(gb_Jar_VALIDGROUPS_NOTINSTALLED). Use gb_Helper_register_jars_for_install for installed jars.)) +endif +$(call gb_Helper__register_jars,$(1),$(2)) + +endef + # $(call gb_Helper_register_jars_for_install,layer,installmodule,jars) define gb_Helper_register_jars_for_install $(if $(3),,$(call gb_Output_error,gb_Helper_register_jars_for_install: no jars - need 3 parameters)) -$(call gb_Helper_register_jars,$(1),$(3)) +ifeq ($$(filter $(1),$$(gb_Jar_VALIDGROUPS_INSTALLED)),) +$$(eval $$(call gb_Output_error,$(1) is not a valid group for installed jars. Valid groups are: $$(gb_Jar_VALIDGROUPS_INSTALLED). Use gb_Helper_register_jars for jars that are not installed.)) +endif +$(call gb_Helper__register_jars,$(1),$(3)) gb_Jar_MODULE_$(2) += $(3) |