-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
83 lines (57 loc) · 7.29 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
# This file was automagically generated by mbed.org. For more information,
# see http://mbed.org/handbook/Exporting-to-GCC-ARM-Embedded
GCC_BIN = /usr/local/gcc-arm-none-eabi-5_2-2015q4/bin/
PROJECT = AtlasQuad
OBJECTS = ./src/main.o ./src/xbeeuart.o ./src/ITG3200/ITG3200.o ./src/ADXL345/ADXL345.o ./src/PID/pid.o ./src/motors/motors.o ./src/XBeeLib/FrameBuffer/FrameBuffer.o ./src/XBeeLib/FrameHandlers/FH_AtCmdResp.o ./src/XBeeLib/FrameHandlers/FH_IoDataSample802.o ./src/XBeeLib/FrameHandlers/FH_IoDataSampleZB.o ./src/XBeeLib/FrameHandlers/FH_ModemStatus.o ./src/XBeeLib/FrameHandlers/FH_RxPacket802.o ./src/XBeeLib/FrameHandlers/FH_RxPacketZB.o ./src/XBeeLib/FrameHandlers/FrameHandler.o ./src/XBeeLib/Frames/802_Frames.o ./src/XBeeLib/Frames/ApiFrame.o ./src/XBeeLib/Frames/AtCmdFrame.o ./src/XBeeLib/Frames/ZigbeeFrames.o ./src/XBeeLib/IO/IOSample802.o ./src/XBeeLib/IO/IOSampleZB.o ./src/XBeeLib/RemoteXBee/RemoteXBee.o ./src/XBeeLib/Utils/Utils.o ./src/XBeeLib/XBee/AtCommands.o ./src/XBeeLib/XBee/RadioConfig.o ./src/XBeeLib/XBee/XBee.o ./src/XBeeLib/XBee802/XBee802.o ./src/XBeeLib/XBeeZB/XBeeZB.o ./src/XBeeLib/DigiLogger/DigiLogger.o ./src/XBeeLib/DigiLogger/DigiLoggerMbedSerial.o
SYS_OBJECTS = ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_smartcard.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/board.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/cmsis_nvic.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/hal_tick.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/mbed_overrides.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/retarget.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/startup_stm32f072xb.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_adc.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_adc_ex.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_can.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_cec.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_comp.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_cortex.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_crc.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_crc_ex.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_dac.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_dac_ex.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_dma.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_flash.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_flash_ex.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_gpio.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_i2c.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_i2c_ex.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_i2s.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_irda.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_iwdg.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_pcd.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_pcd_ex.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_pwr.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_pwr_ex.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_rcc.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_rcc_ex.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_rtc.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_rtc_ex.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_smartcard_ex.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_smbus.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_spi.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_spi_ex.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_tim.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_tim_ex.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_tsc.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_uart.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_uart_ex.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_usart.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/stm32f0xx_hal_wwdg.o ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/system_stm32f0xx.o
INCLUDE_PATHS = -I. -I./src/ITG3200 -I./src/ADXL345 -I./src/PID -I./src/motors -I./src/XBeeLib -I./src/XBeeLib/FrameBuffer -I./src/XBeeLib/FrameHandlers -I./src/XBeeLib/Frames -I./src/XBeeLib/IO -I./src/XBeeLib/RemoteXBee -I./src/XBeeLib/Utils -I./src/XBeeLib/XBee -I./src/XBeeLib/XBee802 -I./src/XBeeLib/XBeeZB -I./src/XBeeLib/DigiLogger -I./src/mbed -I./src/mbed/TARGET_NUCLEO_F072RB -I./src/mbed/TARGET_NUCLEO_F072RB/TARGET_STM -I./src/mbed/TARGET_NUCLEO_F072RB/TARGET_STM/TARGET_STM32F0 -I./src/mbed/TARGET_NUCLEO_F072RB/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F072RB -I./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM
LIBRARY_PATHS = -L./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM
LIBRARIES = -lmbed
LINKER_SCRIPT = ./src/mbed/TARGET_NUCLEO_F072RB/TOOLCHAIN_GCC_ARM/STM32F072XB.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-m0 -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 = -D__CORTEX_M0 -DTARGET_NUCLEO_F072RB -DTOOLCHAIN_GCC_ARM -DTOOLCHAIN_GCC -DTARGET_FF_MORPHO -DTARGET_CORTEX_M -DTARGET_LIKE_MBED -DTARGET_FF_ARDUINO -DARM_MATH_CM0 -D__MBED__=1 -DTARGET_STM -DTARGET_STM32F0 -DTARGET_M0 -DMBED_BUILD_TIMESTAMP=1458973319.73 -DTARGET_STM32F072RB -DTARGET_LIKE_CORTEX_M0
LD_FLAGS = $(CPU) -Wl,--gc-sections --specs=nano.specs -Wl,--wrap,main -Wl,-Map=$(PROJECT).map,--cref
LD_FLAGS += -u _printf_float -u _scanf_float
LD_SYS_LIBS = -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
DEBUG ?= 0
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)
$(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)