From: Philipp Hachtmann Date: Tue, 18 Apr 2023 20:33:09 +0000 (+0200) Subject: trennfix/sw: Makefile improvements X-Git-Url: http://gitweb.hachti.de/?a=commitdiff_plain;ds=inline;p=eisenbahn.git trennfix/sw: Makefile improvements Signed-off-by: Philipp Hachtmann --- 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)