[source] build: minor cleanup of redundant code

LEDE Commits lede-commits at lists.infradead.org
Fri Jul 29 04:38:08 PDT 2016


nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/?p=source.git;a=commitdiff;h=c0dceae4bbb3aab0c4fcaf229925e8916d286797

commit c0dceae4bbb3aab0c4fcaf229925e8916d286797
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Fri Jul 22 14:04:16 2016 +0200

    build: minor cleanup of redundant code
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 include/image-legacy.mk | 2 +-
 include/image.mk        | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/image-legacy.mk b/include/image-legacy.mk
index da8279c..9ace98f 100644
--- a/include/image-legacy.mk
+++ b/include/image-legacy.mk
@@ -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)
diff --git a/include/image.mk b/include/image.mk
index 8cc6a91..5970e58 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -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)



More information about the lede-commits mailing list