From eaaca7b281009e812a381f6801709b71f7dc32ab Mon Sep 17 00:00:00 2001 From: Stephan Rehfeld Date: Mon, 3 Nov 2025 17:17:11 +0100 Subject: [PATCH] Adjusted Makefile rule to be more intelligent --- Makefile | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 948fae2..b8b3173 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,8 @@ example: main.o foo.o - $(CC) main.o foo.o -o example - -main.o: main.c - $(CC) -c main.c -o main.o - -foo.o: foo.c - $(CC) -c foo.c -o foo.o + $(CC) main.o foo.o -o $@ +%.o: %.c + $(CC) -c $< -o $@ .PHONY: clean