From c16defa7e73d1746bbbdd2572fcc608a628a447b Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Sat, 8 Dec 2012 09:21:37 +0100 Subject: build: unify TARGET_* defines --- build/arch.mk | 2 ++ build/host.mk | 3 +-- build/stm32f4.mk | 4 +--- 3 files changed, 4 insertions(+), 5 deletions(-) (limited to 'build') diff --git a/build/arch.mk b/build/arch.mk index 01b797f..62f0687 100644 --- a/build/arch.mk +++ b/build/arch.mk @@ -6,6 +6,8 @@ # Define standard commands. define arch_cmds +$1_TARGET_DEFS := -DTARGET_$1=1 $$($1_SUBTARGETS:%=-DTARGET_%=1) +$1_CPPFLAGS += $$($1_TARGET_DEFS) $1_CC := $$($1_PREFIX)gcc $1_CXX := $$($1_PREFIX)g++ $1_OBJCOPY := $$($1_PREFIX)objcopy diff --git a/build/host.mk b/build/host.mk index b061efd..a07d525 100644 --- a/build/host.mk +++ b/build/host.mk @@ -2,8 +2,7 @@ # # Rules for Host. -host_CPPFLAGS := $(CPPFLAGS) $(host_DEFS) \ - -DTARGET_HOST=1 +host_CPPFLAGS := $(CPPFLAGS) $(host_DEFS) host_CFLAGS := $(CFLAGS) host_CXXFLAGS := $(sort $(host_CFLAGS) $(CXXFLAGS)) host_ASFLAGS := $(ASFLAGS) diff --git a/build/stm32f4.mk b/build/stm32f4.mk index b60d02d..ae899b5 100644 --- a/build/stm32f4.mk +++ b/build/stm32f4.mk @@ -17,9 +17,7 @@ endif stm32f4_SUBTARGETS := stm32 arm newlib stm32f4_CPPFLAGS := $(CPPFLAGS) $(stm32f4_DEFS) \ - -DSTM32F4 $(LIBOPENCM3_CPPFLAGS) \ - -DTARGET_STM32F4=1 \ - $(foreach sub,$(stm32f4_SUBTARGETS),-DTARGET_SUB_$(sub)=1) + -DSTM32F4 $(LIBOPENCM3_CPPFLAGS) stm32f4_CFLAGS := $(CFLAGS) \ -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 \ -Wl,--gc-sections -ffunction-sections -- cgit v1.2.3