From 9f424ffac9e224f269c9736b5e0e358f4f187a6e Mon Sep 17 00:00:00 2001 From: hasslesstech Date: Wed, 11 Dec 2024 20:30:24 +0200 Subject: [PATCH] add Makefile to automate build process --- Makefile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f56e586 --- /dev/null +++ b/Makefile @@ -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