STM32F4DoorControl/Makefile

37 lines
952 B
Makefile
Raw Normal View History

2021-01-31 18:26:40 +00:00
OOCD ?= openocd
OOCD_INTERFACE ?= stlink-v2
OOCD_TARGET ?= stm32f4x
BMP_PORT ?= /dev/ttyBmpGdb
COMFLAGS=-g -Og -pedantic -Wall
BOOTLOADER ?= no
ifeq ($(BOOTLOADER),yes)
LIBNAME = opencm3_stm32f4
FP_FLAGS ?= -mfloat-abi=hard -mfpu=fpv4-sp-d16
ARCH_FLAGS = -mthumb -mcpu=cortex-m4 $(FP_FLAGS)
DEVDEFS = -DSTM32F4 -DSTM32F4CCM -DSTM32F405RG -D_ROM=1008K -D_RAM=128K -D_CCM=64K -D_CCM_OFF=0x10000000 -D_ROM_OFF=0x08004000 -D_RAM_OFF=0x20000000 -DBOOTLOADER
LDSCRIPT = linker.ld
else
DEVICE = STM32F405RG
endif
CFLAGS=$(COMFLAGS) $(DEVDEFS) -std=c99 -D_POSIX_C_SOURCE=200809L
2021-02-19 17:01:56 +00:00
CXXFLAGS=$(COMFLAGS) -std=c++17
2021-02-19 20:30:23 +00:00
OBJS = usb.o adc.o ringbuffer.o uart.o buttons.o printf.o encoder.o
2021-01-31 18:26:40 +00:00
BINARY ?= main
2021-02-19 17:01:56 +00:00
printf.o: CFLAGS:=$(CFLAGS) -Wno-parentheses -Wno-char-subscripts -Wno-sign-compare -Wno-implicit-fallthrough
2021-01-31 18:26:40 +00:00
2021-02-19 17:01:56 +00:00
include ../rules.mk
uf2: main.uf2
main.uf2: main.bin
uf2conv.py -c -b 0x4000 -o $@ $<
.PHONY: uf2