mirror of
https://wiki.pbeirne.com/patb/cmt.git
synced 2026-12-03 12:05:20 -05:00
26 lines
513 B
Makefile
26 lines
513 B
Makefile
|
|
CC=arm-none-eabi-gcc
|
|
CFLAGS=-Wall -mcpu=cortex-m0 -mthumb -nostartfiles -g -Os
|
|
LDFLAGS=-T stm32.lnk -static
|
|
# some recommend -lnosys --specs=nosys.spec, but they don't seem effective
|
|
|
|
SOURCES=demo.c crt1.c
|
|
OBJECTS=$(SOURCES:.c=.o)
|
|
|
|
.c.o:
|
|
$(CC) $(CFLAGS) -c $<
|
|
|
|
demo: $(OBJECTS)
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJECTS) -o $@
|
|
|
|
all:
|
|
klm
|
|
|
|
clean:
|
|
rm $(OBJECTS)
|
|
|
|
load: demo
|
|
arm-none-eabi-objcopy $< -O binary demo.bin
|
|
# st-flash write demo.bin 0x08000000
|
|
stm32loader -p /dev/ttyUSB0 -e -w -v -V demo.bin
|