-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (26 loc) · 914 Bytes
/
Makefile
File metadata and controls
37 lines (26 loc) · 914 Bytes
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
CMSIS_PATH=/mnt/c/path/to/cmsis-device-samd51
CC=arm-none-eabi-gcc
OBJCOPY=arm-none-eabi-objcopy
SIZE=arm-none-eabi-size
CFLAGS=-mcpu=cortex-m4 -mthumb -O0 -g -Wall -ffunction-sections -fdata-sections
CFLAGS+=-iquote ./include -DSAMD51J20A
LDFLAGS=-T linker.ld -nostartfiles -Wl,--gc-sections
LDFLAGS+=-Wl,--print-memory-usage
TARGET=blink
SOURCES=main.c startup_samd51.c
OBJECTS=$(SOURCES:.c=.o)
all: $(TARGET).elf $(TARGET).hex $(TARGET).bin
$(TARGET).elf: $(OBJECTS)
$(CC) $(CFLAGS) $(OBJECTS) $(LDFLAGS) -o $@
$(SIZE) $@
$(TARGET).hex: $(TARGET).elf
$(OBJCOPY) -O ihex $< $@
$(TARGET).bin: $(TARGET).elf
$(OBJCOPY) -O binary $< $@
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -f $(OBJECTS) $(TARGET).elf $(TARGET).hex $(TARGET).bin
flash: $(TARGET).hex
"C:\Program Files\Microchip\MPLABX\v6.25\mplab_platform\mplab_ipe\ipecmd.exe" -P ATSAMD51J20A -F $(TARGET).hex -M
.PHONY: all clean flash