stlink/example/Makefile

23 wiersze
383 B
Makefile

EXECUTABLE=blink.elf
BIN_IMAGE=blink.bin
CC=arm-none-eabi-gcc
OBJCOPY=arm-none-eabi-objcopy
CFLAGS=-O2 -mlittle-endian -mthumb
CFLAGS+=-mcpu=cortex-m3 -ffreestanding -nostdlib -nostdinc
all: $(BIN_IMAGE)
$(BIN_IMAGE): $(EXECUTABLE)
$(OBJCOPY) -O binary $^ $@
$(EXECUTABLE): main.c
$(CC) $(CFLAGS) $^ -o $@
clean:
rm -rf $(EXECUTABLE)
rm -rf $(BIN_IMAGE)
.PHONY: all clean