From bee018405d14154c938704c105a702f6683e7795 Mon Sep 17 00:00:00 2001 From: Gerard Swiderski Date: Wed, 12 Jul 2023 13:58:46 +0200 Subject: [PATCH] makes: add global defines __TARGET and __CPU Adds globally visible defines pointing to TARGET architecture and CPU. The definitions are derived from TARGET_FAMILY and TARGET_SUBFAMILY. JIRA: RTOS-519 --- Makefile.common | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile.common b/Makefile.common index 01869545..e530f5f3 100644 --- a/Makefile.common +++ b/Makefile.common @@ -81,6 +81,13 @@ $(info cleaning targets, make parallelism disabled) .NOTPARALLEL: endif +# Distribute the __TARGET and __CPU defines +CFLAGS += -D__TARGET_$(call uppercase,$(TARGET_FAMILY)) +CXXFLAGS += -D__TARGET_$(call uppercase,$(TARGET_FAMILY)) + +CFLAGS += -D__CPU_$(call uppercase,$(TARGET_SUBFAMILY)) +CXXFLAGS += -D__CPU_$(call uppercase,$(TARGET_SUBFAMILY)) + # generic CFLAGS/LDFLAGS LDFLAGS += -L$(PREFIX_A)