Split compilation in smaller units

This commit is contained in:
Stephan Rehfeld 2025-11-03 17:14:05 +01:00
parent 80b550e6ec
commit 1848235551
2 changed files with 11 additions and 3 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
a.out
example
*.swp
*.o

View File

@ -1,7 +1,14 @@
example: main.c foo.c
cc main.c foo.c -o example
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
.PHONY: clean
clean:
rm -f example
rm -f example *.o