mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
Merge pull request #2040 from haukepetersen/fix_mbed_makefile
board/mbed_lpc1768: cleaned up Makefile.include
This commit is contained in:
commit
b8b9341dbe
@ -1,7 +1,19 @@
|
|||||||
## the cpu to build for
|
# define the cpu used by the mbed_lpx1768 board
|
||||||
export CPU = lpc1768
|
export CPU = lpc1768
|
||||||
|
|
||||||
# toolchain config
|
#define the default port depending on the host OS
|
||||||
|
OS := $(shell uname)
|
||||||
|
ifeq ($(OS),Linux)
|
||||||
|
PORT ?= /dev/ttyUSB0
|
||||||
|
else ifeq ($(OS),Darwin)
|
||||||
|
PORT ?= $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1)
|
||||||
|
else
|
||||||
|
$(info CAUTION: No flash tool for your host system found!)
|
||||||
|
# TODO: add support for windows as host platform
|
||||||
|
endif
|
||||||
|
export PORT
|
||||||
|
|
||||||
|
# define tools used for building the project
|
||||||
export PREFIX = arm-none-eabi-
|
export PREFIX = arm-none-eabi-
|
||||||
export CC = $(PREFIX)gcc
|
export CC = $(PREFIX)gcc
|
||||||
export CXX = $(PREFIX)g++
|
export CXX = $(PREFIX)g++
|
||||||
@ -10,8 +22,12 @@ export AS = $(PREFIX)as
|
|||||||
export LINK = $(PREFIX)gcc
|
export LINK = $(PREFIX)gcc
|
||||||
export SIZE = $(PREFIX)size
|
export SIZE = $(PREFIX)size
|
||||||
export OBJCOPY = $(PREFIX)objcopy
|
export OBJCOPY = $(PREFIX)objcopy
|
||||||
|
export TERMPROG = $(RIOTBASE)/dist/tools/pyterm/pyterm
|
||||||
|
export FLASHER =
|
||||||
|
export DEBUGGER =
|
||||||
|
export DEBUGSERVER =
|
||||||
|
|
||||||
# define build options
|
# define build specific options
|
||||||
CPU_USAGE = -mcpu=cortex-m3
|
CPU_USAGE = -mcpu=cortex-m3
|
||||||
FPU_USAGE =
|
FPU_USAGE =
|
||||||
export CFLAGS += -ggdb -g3 -std=gnu99 -Os -Wall -Wstrict-prototypes $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian -mthumb -mthumb-interwork -nostartfiles
|
export CFLAGS += -ggdb -g3 -std=gnu99 -Os -Wall -Wstrict-prototypes $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian -mthumb -mthumb-interwork -nostartfiles
|
||||||
@ -19,21 +35,20 @@ export CFLAGS += -ffunction-sections -fdata-sections -fno-builtin
|
|||||||
export ASFLAGS += -ggdb -g3 $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian
|
export ASFLAGS += -ggdb -g3 $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian
|
||||||
export LINKFLAGS += -g3 -ggdb -std=gnu99 $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian -static -lgcc -mthumb -mthumb-interwork -nostartfiles
|
export LINKFLAGS += -g3 -ggdb -std=gnu99 $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian -static -lgcc -mthumb -mthumb-interwork -nostartfiles
|
||||||
export LINKFLAGS += -T$(RIOTCPU)/$(CPU)/LPC1768.ld
|
export LINKFLAGS += -T$(RIOTCPU)/$(CPU)/LPC1768.ld
|
||||||
|
|
||||||
#LINKFLAGS += -mcpu=cortex-m3 -mthumb -Wl,--gc-sections,--cref -lc -lgcc -lnosys -nostartfiles
|
|
||||||
|
|
||||||
ifeq ($(strip $(PORT)),)
|
|
||||||
export PORT = /dev/ttyUSB0
|
|
||||||
endif
|
|
||||||
export FFLAGS = $(HEXFILE)
|
|
||||||
|
|
||||||
export DEBUGGER_FLAGS = $(ELFFILE)
|
|
||||||
|
|
||||||
export INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include/ -I$(RIOTCPU)/$(CPU)/include
|
|
||||||
export OFLAGS = -O binary
|
export OFLAGS = -O binary
|
||||||
|
export FFLAGS =
|
||||||
export UNDEF += $(BINDIR)cpu/startup.o
|
export DEBUGGER_FLAGS =
|
||||||
|
export TERMFLAGS += -p "$(PORT)"
|
||||||
|
|
||||||
# unwanted (CXXUWFLAGS) and extra (CXXEXFLAGS) flags for c++
|
# unwanted (CXXUWFLAGS) and extra (CXXEXFLAGS) flags for c++
|
||||||
export CXXUWFLAGS +=
|
export CXXUWFLAGS +=
|
||||||
export CXXEXFLAGS +=
|
export CXXEXFLAGS +=
|
||||||
|
|
||||||
|
# use newLib nano-specs if available
|
||||||
|
ifeq ($(shell $(LINK) -specs=nano.specs -E - 2>/dev/null >/dev/null </dev/null ; echo $$?),0)
|
||||||
|
export LINKFLAGS += -specs=nano.specs -lc -lnosys
|
||||||
|
endif
|
||||||
|
|
||||||
|
# export board specific includes to the global includes-listing
|
||||||
|
export INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include/ -I$(RIOTCPU)/$(CPU)/include
|
||||||
|
export UNDEF += $(BINDIR)cpu/startup.o
|
||||||
|
Loading…
Reference in New Issue
Block a user