Adjusted Makefile rule to be more intelligent

This commit is contained in:
Stephan Rehfeld 2025-11-03 17:17:11 +01:00
parent 611ed74150
commit eaaca7b281

View File

@ -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