From 09523e854dbb2993d427b9a25ff464bb355d06f1 Mon Sep 17 00:00:00 2001 From: chrysn Date: Mon, 27 Feb 2012 16:07:24 +0100 Subject: [PATCH] efm32 example: enhanced makefiles --- examples/efm32/tinygecko/Makefile.include | 3 ++- examples/efm32/tinygecko/efm32-tg-stk3300/Makefile.include | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/efm32/tinygecko/Makefile.include b/examples/efm32/tinygecko/Makefile.include index 76691ce4..2426e988 100644 --- a/examples/efm32/tinygecko/Makefile.include +++ b/examples/efm32/tinygecko/Makefile.include @@ -30,7 +30,8 @@ GDB = $(PREFIX)-gdb #TOOLCHAIN_DIR := $(shell dirname `which $(CC)`)/../$(PREFIX) TOOLCHAIN_DIR = ../../../../.. CFLAGS += -Os -g -Wall -Wextra -I$(TOOLCHAIN_DIR)/include \ - -fno-common -mcpu=cortex-m3 -mthumb -msoft-float -MD + -fno-common -mcpu=cortex-m3 -mthumb -msoft-float -MD\ + -D$(FAMILY) LDSCRIPT ?= ${TOOLCHAIN_DIR}/lib/efm32/tinygecko/$(MCU).ld LDFLAGS += -lc -lnosys -L$(TOOLCHAIN_DIR)/lib/efm32/tinygecko \ -T$(LDSCRIPT) -nostartfiles -Wl,--gc-sections \ diff --git a/examples/efm32/tinygecko/efm32-tg-stk3300/Makefile.include b/examples/efm32/tinygecko/efm32-tg-stk3300/Makefile.include index e707b652..32e6cfc3 100644 --- a/examples/efm32/tinygecko/efm32-tg-stk3300/Makefile.include +++ b/examples/efm32/tinygecko/efm32-tg-stk3300/Makefile.include @@ -18,8 +18,6 @@ ## MCU = EFM32TG840F32 +FAMILY = TINYGECKO -# Linker scripts are always relative to the current directory. This file is -# intended for inclusion from example subdirectories, so the Makefile.include -# meant here would be called ../Makefile.include relative to here. -include ../../Makefile.include +include $(dir $(lastword $(MAKEFILE_LIST)))../Makefile.include