Skript file: /~heha/hs/bl/bl.zip/Makefile

PATH := c:\Program Files\winavr\armgcc2020\bin;$(PATH) 
P = hid_bootloader

F += -mcpu=cortex-m3 -mthumb -Os -std=c++14 -static
F += -fno-exceptions
F += -Wall -Wno-parentheses -Wextra -Wshadow
F += -I ../CMSIS3
F += -DSTM32F10X_MD -DPAGE_SIZE=1024
F += -DLED_INIT="BB_BIT(GPIOB->CRH,16)=1"#	output open drain
F += -DLED="BB_BIT(GPIOB->ODR,12)"#	PB12: 0 = on, 1 = off

F += -Wl,--print-memory-usage
F += -nostdlib

# Tool prefix
X = arm-none-eabi-

all: $P.bin

$P.bin: $P.elf
	$Xobjcopy -O binary $< $@
	$Xobjdump -x -S $< > $P.lst

$P.elf: *.cpp *.h *.ld Makefile
	$Xgcc $F $(filter %.cpp,$^) -T$(filter %.ld,$^) -o $@

flash: $P.bin
	stm32flash com7 -w $<

clean:
	rm -f $P.elf $P.bin $P.lst
Detected encoding: ASCII (7 bit)2