build: minor cleanup of redundant code
authorFelix Fietkau <nbd@nbd.name>
Fri, 22 Jul 2016 12:04:16 +0000 (14:04 +0200)
committerFelix Fietkau <nbd@nbd.name>
Fri, 29 Jul 2016 08:18:26 +0000 (10:18 +0200)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
include/image-legacy.mk
include/image.mk

index da8279c2634145ee70da2bd5281b6f7de4f029c4..9ace98fbe57e7047a0b231251c3d7be2cc66442c 100644 (file)
@@ -36,7 +36,7 @@ endif
 LegacyDevice/Dump = $(Device/Dump)
 
 define LegacyDevice/Check
-  _PROFILE_SET = $$(strip $$(foreach profile,$$(PROFILES) DEVICE_$(1),$$(call DEVICE_CHECK_PROFILE,$$(profile))))
+  $(Device/Check/Common)
   _TARGET_PREPARE := $$(if $$(_PROFILE_SET),legacy-images-prepare,prepare-disabled)
   _TARGET := $$(if $$(_PROFILE_SET),legacy-images,install-disabled)
   $$(if $$(_PROFILE_SET),install: legacy-images-make)
index 8cc6a91373ab6eef3038551cb91ca84ac1962c86..5970e58e1aaebe06f445f3eb3ed0f5364b97f574 100644 (file)
@@ -345,9 +345,13 @@ else
   DEVICE_CHECK_PROFILE = $(CONFIG_TARGET_$(if $(CONFIG_TARGET_MULTI_PROFILE),DEVICE_)$(call target_conf,$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET)))_$(1))
 endif
 
+define Device/Check/Common
+  _PROFILE_SET = $$(strip $$(foreach profile,$$(PROFILES) DEVICE_$(1),$$(call DEVICE_CHECK_PROFILE,$$(profile))))
+endef
+
 define Device/Check
+  $(Device/Check/Common)
   KDIR_KERNEL_IMAGE := $(KDIR)/$(1)$$(KERNEL_SUFFIX)
-  _PROFILE_SET = $$(strip $$(foreach profile,$$(PROFILES) DEVICE_$(1),$$(call DEVICE_CHECK_PROFILE,$$(profile))))
   _TARGET := $$(if $$(_PROFILE_SET),install-images,install-disabled)
   ifndef IB
     _COMPILE_TARGET := $$(if $(CONFIG_IB)$$(_PROFILE_SET),compile,compile-disabled)