[source] target.mk: check that CPU_TYPE has known CPU_CFLAGS mapping

LEDE Commits lede-commits at lists.infradead.org
Tue Apr 4 03:34:56 PDT 2017


nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/d3bc11857af788e185e8a3ece26ce40757cf3965

commit d3bc11857af788e185e8a3ece26ce40757cf3965
Author: Philip Prindeville <philipp at redfish-solutions.com>
AuthorDate: Tue Jan 3 18:15:15 2017 -0700

    target.mk: check that CPU_TYPE has known CPU_CFLAGS mapping
    
    If someone creates a target and indicates a CPU_TYPE, but there's
    no corresponding support for that CPU_TYPE's flags in include/target.mk
    then that should probably be indicated rather than silently ignored.
    
    Signed-off-by: Philip Prindeville <philipp at redfish-solutions.com>
---
 include/target.mk | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/target.mk b/include/target.mk
index 61489ca..3523d04 100644
--- a/include/target.mk
+++ b/include/target.mk
@@ -218,6 +218,11 @@ ifeq ($(DUMP),1)
     CPU_CFLAGS_arc700 = -mcpu=arc700
     CPU_CFLAGS_archs = -mcpu=archs
   endif
+  ifneq ($(CPU_TYPE),)
+    ifndef CPU_CFLAGS_$(CPU_TYPE)
+      $(warning CPU_TYPE "$(CPU_TYPE)" doesn't correspond to a known type)
+    endif
+  endif
   DEFAULT_CFLAGS=$(strip $(CPU_CFLAGS) $(CPU_CFLAGS_$(CPU_TYPE)) $(CPU_CFLAGS_$(CPU_SUBTYPE)))
 
   ifneq ($(BOARD),)



More information about the lede-commits mailing list