I really like the idea of multi target projects.
I'd like to propose an improved Makefile for these projects. (I also saw you fixed the multi makefiles a few days ago)
Here's an example of what I would propose. It is very general, only the 'targets' line needs to be updated.
Furthermore it allows to compile single targets easily.
This one is for the multi ADC project:
Code: Select all
##############################################################################
# Multi-project makefile rules
#
targets = stm32h743zi_nucleo144 stm32g071rb_nucleo64 stm32g474re_nucleo64 \
stm32l053r8_nucleo64 stm32l476_discovery stm32l4r5zi_nucleo144
all: $(targets)
clean_targets = $(addprefix clean_,$(targets))
clean: $(clean_targets)
.PHONY: all clean $(targets) $(clean_targets)
$(targets):
@echo === Building for $@ ===============================
-@$(MAKE) --no-print-directory -f ./make/$@.make all
@echo ====================================================================
@echo
$(clean_targets): clean_%:
-@$(MAKE) --no-print-directory -f ./make/$*.make clean
@echo
#
##############################################################################