aboutsummaryrefslogtreecommitdiffstats
path: root/include/image.mk
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2016-05-18 13:56:53 +0200
committerFelix Fietkau <nbd@nbd.name>2016-05-20 14:37:52 +0200
commitd01487e380c9fe1e19efd2548625467ea4233500 (patch)
tree40d5a835b072abdf312944bd3898740f2b1be6dc /include/image.mk
parentc4ae33b0488a37267e6ae24abb5726ee31fc05bd (diff)
downloadupstream-d01487e380c9fe1e19efd2548625467ea4233500.tar.gz
upstream-d01487e380c9fe1e19efd2548625467ea4233500.tar.bz2
upstream-d01487e380c9fe1e19efd2548625467ea4233500.zip
image.mk: simplify device profile check, prepare for supporting selecting multiple profiles
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'include/image.mk')
-rw-r--r--include/image.mk13
1 files changed, 8 insertions, 5 deletions
diff --git a/include/image.mk b/include/image.mk
index 1410fd52c9..d0bf8fc3ea 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -471,9 +471,14 @@ define Device/Export
$(1) : FILESYSTEM:=$(2)
endef
+DEVICE_CHECK_PROFILE = $(CONFIG_TARGET_$(call target_conf,$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET)))_$(1))
+
define Device/Check
- _TARGET = $$(if $$(and $(if $(SUBTARGET),,1)$$(filter $(SUBTARGET),$$(SUBTARGETS)),$$(filter $(PROFILE),$$(PROFILES) DEVICE_$(1))),install,install-disabled)
- _COMPILE_TARGET = $$(if $(if $(IB),,$(CONFIG_IB)$$(filter $(PROFILE),$$(PROFILES) DEVICE_$(1))),compile,compile-disabled)
+ _PROFILE_SET = $$(strip $$(foreach profile,$$(PROFILES) DEVICE_$(1),$$(call DEVICE_CHECK_PROFILE,$$(profile))))
+ _TARGET := $$(if $$(_PROFILE_SET),install,install-disabled)
+ ifndef IB
+ _COMPILE_TARGET := $$(if $(CONFIG_IB)$$(_PROFILE_SET),compile,compile-disabled)
+ endif
endef
ifndef IB
@@ -560,10 +565,8 @@ $(DEVICE_DESCRIPTION)
endef
-DEVICE_PROFILE_CHECK=$(and $(DEVICE_TITLE),$(if $(SUBTARGET),,1)$(filter $(SUBTARGET),$(SUBTARGETS)))
-
define Device/Dump
-$$(eval $$(if $$(DEVICE_PROFILE_CHECK),$$(info $$(call Device/DumpInfo,$(1)))))
+$$(eval $$(if $$(DEVICE_TITLE),$$(info $$(call Device/DumpInfo,$(1)))))
endef
define Device