2 MAKEFLAGS += --no-print-dir
8 CFLAGS += -Wall -Wextra -Werror -Wno-char-subscripts\
9 $(OPT_FLAGS) -std=gnu99 -g3 -MD \
11 LDFLAGS += $(OPT_FLAGS)
17 CROSS_COMPILE ?= arm-none-eabi-
18 CC = $(CROSS_COMPILE)gcc
19 OBJCOPY = $(CROSS_COMPILE)objcopy
22 CFLAGS += -mcpu=cortex-m3 -mthumb \
23 -DSTM32F1 -DDISCOVERY_STLINK -I../libopencm3/include \
25 LDFLAGS_BOOT := $(LDFLAGS) --specs=nano.specs \
26 -lopencm3_stm32f1 -Wl,--defsym,_stack=0x20005000 \
27 -Wl,-T,bluepill.ld -nostartfiles -lc \
28 -Wl,-Map=mapfile -mthumb -mcpu=cortex-m3 -Wl,-gc-sections \
30 LDFLAGS = $(LDFLAGS_BOOT)
32 LDFLAGS += --specs=nosys.specs
43 $(Q)$(CC) -o $@ $(OBJ) $(LDFLAGS)
47 $(Q)$(CC) $(CFLAGS) -c $< -o $@
51 $(Q)$(OBJCOPY) -O binary $^ $@
55 $(Q)$(OBJCOPY) -O ihex $^ $@
57 .PHONY: clean host_clean FORCE
61 -$(Q)$(RM) -f *.o *.d *~ *.elf *.bin $(HOSTFILES)