add Makefile to automate build process

This commit is contained in:
ІО-23 Шмуляр Олег 2024-12-11 20:30:24 +02:00
parent b47037f66e
commit 9f424ffac9
1 changed files with 20 additions and 0 deletions

20
Makefile Normal file
View File

@ -0,0 +1,20 @@
CFLAGS=-O3 -Iinc/
build: main
out/:
mkdir out/
main: out/main.o out/swapper.o
gcc $(CFLAGS) out/main.o out/swapper.o -o main
out/main.o: out/ src/main.c
gcc $(CFLAGS) -c src/main.c -o out/main.o
out/swapper.o: out/ src/swapper.c
gcc $(CFLAGS) -c src/swapper.c -o out/swapper.o
clean:
rm -r main out/
.PHONY: build clean