From d484f834f05d88713eb1795336bdd370e4559e02 Mon Sep 17 00:00:00 2001 From: Philipp Hachtmann Date: Tue, 18 Apr 2023 22:33:09 +0200 Subject: [PATCH] trennfix/sw: Makefile improvements Signed-off-by: Philipp Hachtmann --- trennfix/sw/Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/trennfix/sw/Makefile b/trennfix/sw/Makefile index 248a0c7..a18bcfb 100644 --- a/trennfix/sw/Makefile +++ b/trennfix/sw/Makefile @@ -2,6 +2,8 @@ ####################################### HW?=trennfix_0.4 + +# Default program to build PROG?=trennfix BUILD_DIR=build @@ -116,7 +118,9 @@ program: $(1)_program fuses: $(1)_fuses endef -all: build +default:build + +all: buildall cleanall: $(foreach prog, $(PROGRAMS), $(prog)_clean) buildall: $(foreach prog, $(PROGRAMS), $(prog)_build) @@ -168,11 +172,11 @@ $(BUILD_DIR)/%.o : %.c Makefile $(wildcard mk/hw/*) $(Q)$(CC) -c $(ASFLAGS) $< -o $@ ########################### The big template for each program ################## -define PROGRAM_template= +define PROGRAM_template= $(1)_mupf: @echo "$(1) Objects: " $$($(1)_OBJS) - + # Determine program's object files $(1)_OBJS=$$(foreach obj, $$($(1)_SRC:.c=.o), $(BUILD_DIR)/$$(obj)) $(1)_OBJS+=$$($(1)_ASRC:.S=.o) -- 2.32.0