From 350eb640a01a0b87f01d63c0222f9d6918def348 Mon Sep 17 00:00:00 2001 From: Martin Date: Thu, 1 Dec 2022 11:11:29 +0100 Subject: [PATCH] "TARGET=F072 make" builds tinySA, "TARGET=F303 make" builds tinySA4 undefined TARGET or all other values build the default target (F072) Signed-off-by: Martin --- Makefile | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 4eaf747..aff0005 100644 --- a/Makefile +++ b/Makefile @@ -3,11 +3,23 @@ # NOTE: Can be overridden externally. # -#Build target -ifeq ($(TARGET),) - TARGET = F072 -else - TARGET = F303 +# Build target, define with e.g. "TARGET=F303 make" +# If no TARGET defined use one of these two: +# F072 (tinySA aka. TINYSA3 aka. TINYSA_F072) +# F303 (tinySA Ultra aka. TINYSA4 aka. TINYSA_F303) +DEFAULT_TARGET = F072 + +# target specified? +ifdef TARGET # must be one of F072 or F303 + ifneq ($(TARGET),F072) + ifneq ($(TARGET),F303) + # set default if none of these + TARGET = $(DEFAULT_TARGET) + endif + endif +else # no target specified + # set default one + TARGET = $(DEFAULT_TARGET) endif # Compiler options here. @@ -296,14 +308,8 @@ RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC include $(RULESPATH)/rules.mk #include $(CHIBIOS)/memory.mk - -ifeq ($(TARGET),F303) -clean: - rm -f -rf build/tinySA4.* build/lst/*.* build/obj/*.* -else clean: rm -f -rf build/$(PROJECT).* build/lst/*.* build/obj/*.* -endif flash: build/$(PROJECT).bin -@printf "reset dfu\r" >/dev/cu.usbmodem401 # mac