-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
89 lines (60 loc) · 5.4 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# This file was automagically generated by mbed.org. For more information,
# see http://mbed.org/handbook/Exporting-to-GCC-ARM-Embedded
GCC_BIN =
PROJECT = mbed_zumy_rpc
OBJECTS = ./mbed-src/targets/cmsis/TARGET_NXP/TARGET_LPC176X/TOOLCHAIN_GCC_ARM/startup_LPC17xx.o ./mbed-src/targets/hal/TARGET_NXP/TARGET_LPC176X/port_api.o ./mbed-src/targets/hal/TARGET_NXP/TARGET_LPC176X/spi_api.o ./mbed-src/targets/hal/TARGET_NXP/TARGET_LPC176X/analogout_api.o ./mbed-src/targets/hal/TARGET_NXP/TARGET_LPC176X/analogin_api.o ./mbed-src/targets/hal/TARGET_NXP/TARGET_LPC176X/gpio_api.o ./mbed-src/targets/hal/TARGET_NXP/TARGET_LPC176X/rtc_api.o ./mbed-src/targets/hal/TARGET_NXP/TARGET_LPC176X/gpio_irq_api.o ./mbed-src/targets/hal/TARGET_NXP/TARGET_LPC176X/serial_api.o ./mbed-src/targets/hal/TARGET_NXP/TARGET_LPC176X/i2c_api.o ./mbed-src/targets/hal/TARGET_NXP/TARGET_LPC176X/pwmout_api.o ./mbed-src/targets/hal/TARGET_NXP/TARGET_LPC176X/ethernet_api.o ./mbed-src/targets/hal/TARGET_NXP/TARGET_LPC176X/sleep.o ./mbed-src/targets/hal/TARGET_NXP/TARGET_LPC176X/pinmap.o ./mbed-src/targets/hal/TARGET_NXP/TARGET_LPC176X/us_ticker.o ./mbed-src/targets/hal/TARGET_NXP/TARGET_LPC176X/can_api.o ./mbed-src/targets/cmsis/TARGET_NXP/TARGET_LPC176X/cmsis_nvic.o ./mbed-src/targets/cmsis/TARGET_NXP/TARGET_LPC176X/system_LPC17xx.o ./mbed-src/common/board.o ./mbed-src/common/assert.o ./mbed-src/common/mbed_interface.o ./mbed-src/common/ticker_api.o ./mbed-src/common/rtc_time.o ./mbed-src/common/lp_ticker_api.o ./mbed-src/common/us_ticker_api.o ./mbed-src/common/pinmap_common.o ./mbed-src/common/error.o ./mbed-src/common/gpio.o ./mbed-src/common/semihost_api.o ./mbed-src/common/wait_api.o ./main.o ./mbed-src/common/RawSerial.o ./mbed-src/common/Ticker.o ./mbed-src/common/FilePath.o ./mbed-src/common/I2C.o ./mbed-src/common/FileBase.o ./mbed-src/common/retarget.o ./mbed-src/common/Serial.o ./mbed-src/common/Stream.o ./mbed-src/common/FileSystemLike.o ./mbed-src/common/CallChain.o ./mbed-src/common/InterruptManager.o ./mbed-src/common/SerialBase.o ./mbed-src/common/BusInOut.o ./mbed-src/common/SPISlave.o ./mbed-src/common/I2CSlave.o ./mbed-src/common/Timer.o ./mbed-src/common/SPI.o ./mbed-src/common/Timeout.o ./mbed-src/common/Ethernet.o ./mbed-src/common/TimerEvent.o ./mbed-src/common/CAN.o ./mbed-src/common/BusOut.o ./mbed-src/common/FileLike.o ./mbed-src/common/BusIn.o ./mbed-src/common/InterruptIn.o ./mbed-src/common/LocalFileSystem.o ./RPCInterface/SerialRPCInterface.o ./RPCInterface/mbed-rpc/parse_pins.o ./RPCInterface/mbed-rpc/RPCFunction.o ./RPCInterface/mbed-rpc/Arguments.o ./RPCInterface/mbed-rpc/rpc.o ./QEI/QEI.o
SYS_OBJECTS =
INCLUDE_PATHS = -I. -I./mbed-src -I./mbed-src/hal -I./mbed-src/api -I./mbed-src/targets -I./mbed-src/targets/hal -I./mbed-src/targets/hal/TARGET_NXP -I./mbed-src/targets/hal/TARGET_NXP/TARGET_LPC176X -I./mbed-src/targets/hal/TARGET_NXP/TARGET_LPC176X/TARGET_MBED_LPC1768 -I./mbed-src/targets/cmsis -I./mbed-src/targets/cmsis/TARGET_NXP -I./mbed-src/targets/cmsis/TARGET_NXP/TARGET_LPC176X -I./mbed-src/targets/cmsis/TARGET_NXP/TARGET_LPC176X/TOOLCHAIN_GCC_ARM -I./mbed-src/common -I./RPCInterface -I./RPCInterface/mbed-rpc -I./QEI -I./MPU6050IMU
LIBRARY_PATHS =
LIBRARIES =
LINKER_SCRIPT = ./mbed-src/targets/cmsis/TARGET_NXP/TARGET_LPC176X/TOOLCHAIN_GCC_ARM/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
OBJDUMP = $(GCC_BIN)arm-none-eabi-objdump
SIZE = $(GCC_BIN)arm-none-eabi-size
CPU = -mcpu=cortex-m3 -mthumb
CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -Wextra -fno-exceptions -ffunction-sections -fdata-sections -fomit-frame-pointer -MMD -MP
CC_SYMBOLS = -DTOOLCHAIN_GCC_ARM -DTOOLCHAIN_GCC -DARM_MATH_CM3 -DTARGET_LIKE_CORTEX_M3 -DTARGET_CORTEX_M -DMBED_BUILD_TIMESTAMP=1464705252.99 -DTARGET_LIKE_MBED -DTARGET_LPC176X -DTARGET_NXP -DTARGET_LPC1768 -D__CORTEX_M3 -DTARGET_M3 -DTARGET_MBED_LPC1768 -D__MBED__=1
LD_FLAGS = $(CPU) -Wl,--gc-sections --specs=nano.specs -u _printf_float -u _scanf_float -Wl,--wrap,main -Wl,-Map=$(PROJECT).map,--cref
LD_SYS_LIBS = -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
ifeq ($(DEBUG), 1)
CC_FLAGS += -DDEBUG -O0
else
CC_FLAGS += -DNDEBUG -Os
endif
.PHONY: all clean lst size
all: $(PROJECT).bin $(PROJECT).hex size
clean:
rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) $(DEPS)
.asm.o:
$(CC) $(CPU) -c -x assembler-with-cpp -o $@ $<
.s.o:
$(CC) $(CPU) -c -x assembler-with-cpp -o $@ $<
.S.o:
$(CC) $(CPU) -c -x assembler-with-cpp -o $@ $<
.c.o:
$(CC) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu99 $(INCLUDE_PATHS) -o $@ $<
.cpp.o:
$(CPP) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu++98 -fno-rtti $(INCLUDE_PATHS) -o $@ $<
$(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS)
$(LD) $(LD_FLAGS) -T$(LINKER_SCRIPT) $(LIBRARY_PATHS) -o $@ $^ $(LIBRARIES) $(LD_SYS_LIBS) $(LIBRARIES) $(LD_SYS_LIBS)
@echo ""
@echo "*****"
@echo "***** You must modify vector checksum value in *.bin and *.hex files."
@echo "*****"
@echo ""
$(PROJECT).bin: $(PROJECT).elf
$(OBJCOPY) -O binary $< $@
$(PROJECT).hex: $(PROJECT).elf
@$(OBJCOPY) -O ihex $< $@
$(PROJECT).lst: $(PROJECT).elf
@$(OBJDUMP) -Sdh $< > $@
lst: $(PROJECT).lst
size: $(PROJECT).elf
$(SIZE) $(PROJECT).elf
DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d)
-include $(DEPS)