1
+ <<<<<<< HEAD
1
2
# Copyright (c) 2015 Atmel Corporation/Thibaut VIARD. All right reserved.
2
3
# Copyright (c) 2015 Arduino LLC. All right reserved.
3
4
#
@@ -98,6 +99,17 @@ SOURCES= \
98
99
sam_ba_monitor.c \
99
100
sam_ba_serial.c
100
101
102
+ ====== =
103
+ IDE_PATH ="../../../../.."
104
+ ARM_GCC_PATH =$(IDE_PATH ) /hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin
105
+ CC =$(ARM_GCC_PATH ) /arm-none-eabi-gcc
106
+ CFLAGS =-mthumb -mcpu=cortex-m0plus -Wall -c -g -Os -w -std=gnu99 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500
107
+ LDFLAGS =-mthumb -mcpu=cortex-m0plus -Wall -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols
108
+ BLD_EXTA_FLAGS =-D__SAMD21G18A__
109
+ BUILD_PATH =build
110
+ INCLUDES =-I$(IDE_PATH ) /hardware/tools/CMSIS/CMSIS/Include/ -I$(IDE_PATH ) /hardware/tools/CMSIS/Device/ATMEL/ -I./drivers/ -I./utils/ -I./utils/preprocessor/ -I./utils/interrupt
111
+ SOURCES =main.c sam_ba_monitor.c startup_samd21.c usart_sam_ba.c drivers/cdc_enumerate.c drivers/uart_driver.c utils/interrupt/interrupt_sam_nvic.c
112
+ >>>>>>> fix makefile for easier programming
101
113
OBJECTS =$(addprefix $(BUILD_PATH ) /, $(SOURCES:.c=.o ) )
102
114
DEPS =$(addprefix $(BUILD_PATH ) /, $(SOURCES:.c=.d ) )
103
115
@@ -109,10 +121,16 @@ else
109
121
AS_CLEAN =
110
122
endif
111
123
124
+ <<<<<<< HEAD
112
125
LD_SCRIPT =bootloader_samd21x18.ld
126
+ ====== =
127
+ NAME =samd21_sam_ba
128
+ EXECUTABLE =$(NAME ) .bin
129
+ >>>>>>> fix makefile for easier programming
113
130
114
131
all : print_info $(SOURCES ) $(BIN ) $(HEX ) $(AS_BUILD )
115
132
133
+ <<<<<<< HEAD
116
134
$(ELF ) : Makefile $(BUILD_PATH ) $(OBJECTS )
117
135
@echo ----------------------------------------------------------
118
136
@echo Creating ELF binary
@@ -171,3 +189,17 @@ clean: $(AS_CLEAN)
171
189
-rmdir $(BUILD_PATH )
172
190
173
191
.phony : print_info $(BUILD_PATH )
192
+ ====== =
193
+ all : $(SOURCES ) $(EXECUTABLE )
194
+
195
+ $(EXECUTABLE ) : $(OBJECTS )
196
+ $(CC ) -L$(BUILD_PATH ) $(LDFLAGS ) -Os -Wl,--gc-sections -save-temps -Tsamd21j18a_flash.ld -Wl,-Map,$(BUILD_PATH ) /$(NAME ) .map --specs=nano.specs --specs=nosys.specs -o $(BUILD_PATH ) /$(NAME ) .elf $(OBJECTS ) -Wl,--start-group -lm -Wl,--end-group
197
+ $(ARM_GCC_PATH ) /arm-none-eabi-objcopy -O binary $(BUILD_PATH ) /$(NAME ) .elf $@
198
+
199
+ $(BUILD_PATH ) /% .o : % .c
200
+ -@mkdir -p $(@D )
201
+ $(CC ) $(CFLAGS ) $(BLD_EXTA_FLAGS ) $(INCLUDES ) $< -o $@
202
+
203
+ clean :
204
+ del $(EXECUTABLE ) $(subst /,\,$(OBJECTS ) ) $(subst /,\,$(BUILD_PATH ) /$(NAME ) .* )
205
+ >>>>>>> fix makefile for easier programming
0 commit comments