Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to build for Mbed LPC1768 using 'make build-mbed' and 'make upl…
…oad-mbed' Requires the official GCC ARM toolchain.
- Loading branch information
Showing
5 changed files
with
69 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# This file was automagically generated by mbed.org. For more information, | ||
# see http://mbed.org/handbook/Exporting-to-GCC-ARM-Embedded | ||
|
||
ROOT_DIR:=./ | ||
SOURCE_DIR:=$(ROOT_DIR)/microflo | ||
MBED_DIR:=$(ROOT_DIR)/thirdparty/mbed/build/mbed | ||
|
||
MBED_OBJDIR=$(MBED_DIR)/TARGET_LPC1768/TOOLCHAIN_GCC_ARM | ||
GCC_BIN = | ||
PROJECT = firmware | ||
OBJECTS = ./main.o | ||
SYS_OBJECTS = $(MBED_OBJDIR)/cmsis_nvic.o $(MBED_OBJDIR)/system_LPC17xx.o $(MBED_OBJDIR)/startup_LPC17xx.o | ||
INCLUDE_PATHS = -I. -I$(SOURCE_DIR) -I$(MBED_DIR) -I$(MBED_DIR)/TARGET_LPC1768 -I$(MBED_OBJDIR) | ||
LIBRARY_PATHS = -L$(MBED_OBJDIR) | ||
LIBRARIES = -lmbed | ||
LINKER_SCRIPT = ./$(MBED_OBJDIR)/LPC1768.ld | ||
|
||
############################################################################### | ||
AS = $(GCC_BIN)arm-none-eabi-as | ||
CC = $(GCC_BIN)arm-none-eabi-gcc | ||
CPP = $(GCC_BIN)arm-none-eabi-g++ | ||
LD = $(GCC_BIN)arm-none-eabi-gcc | ||
OBJCOPY = $(GCC_BIN)arm-none-eabi-objcopy | ||
|
||
CPU = -mcpu=cortex-m3 -mthumb | ||
CC_FLAGS = $(CPU) -c -Os -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections | ||
CC_SYMBOLS = -DTARGET_LPC1768 -DTARGET_M3 -DTARGET_NXP -DTARGET_LPC176X -DTOOLCHAIN_GCC_ARM -DTOOLCHAIN_GCC -D__CORTEX_M3 -DARM_MATH_CM3 | ||
|
||
LD_FLAGS = -mcpu=cortex-m3 -mthumb -Wl,--gc-sections --specs=nano.specs -u _printf_float -u _scanf_float | ||
LD_SYS_LIBS = -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys | ||
|
||
all: $(PROJECT).bin | ||
|
||
clean: | ||
rm -f $(PROJECT).bin $(PROJECT).elf $(OBJECTS) | ||
|
||
.s.o: | ||
$(AS) $(CPU) -o $@ $< | ||
|
||
.c.o: | ||
$(CC) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu99 $(INCLUDE_PATHS) -o $@ $< | ||
|
||
.cpp.o: | ||
$(CPP) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu++98 $(INCLUDE_PATHS) -o $@ $< | ||
|
||
|
||
$(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS) | ||
$(LD) $(LD_FLAGS) -T$(LINKER_SCRIPT) $(LIBRARY_PATHS) -o $@ $^ $(LIBRARIES) $(LD_SYS_LIBS) | ||
|
||
$(PROJECT).bin: $(PROJECT).elf | ||
$(OBJCOPY) -O binary $< $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters