aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorElis Eriksson <spelis@spelis.li>2026-06-13 17:40:25 +0200
committerElis Eriksson <spelis@spelis.li>2026-06-13 17:40:25 +0200
commit7ccae1c362a45b28f4fbf96da4f479730e4b382b (patch)
treef59ba4d76221590901784464a03a6a871d774305 /Makefile
downloadbfc-7ccae1c362a45b28f4fbf96da4f479730e4b382b.tar
bfc-7ccae1c362a45b28f4fbf96da4f479730e4b382b.tar.gz
bfc-7ccae1c362a45b28f4fbf96da4f479730e4b382b.tar.bz2
bfc-7ccae1c362a45b28f4fbf96da4f479730e4b382b.tar.lz
bfc-7ccae1c362a45b28f4fbf96da4f479730e4b382b.tar.xz
bfc-7ccae1c362a45b28f4fbf96da4f479730e4b382b.tar.zst
bfc-7ccae1c362a45b28f4fbf96da4f479730e4b382b.zip
Initial Commit, probably needs heavy code cleanup
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile26
1 files changed, 26 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..8c7470c
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,26 @@
+CFLAGS := -Isrc -MMD -MP -Wall -Wextra
+LDFLAGS :=
+
+TARGET = build/bfc
+
+TARGET_SRC := $(shell find src -name "*.c")
+TARGET_OBJ := $(patsubst src/%.c, build/%.o, $(TARGET_SRC))
+TARGET_DEP := $(patsubst build/%.o, build/%.d, $(TARGET_OBJ))
+
+all: build $(TARGET)
+
+build:
+ mkdir -p $(sort $(dir $(TARGET_OBJ)))
+
+$(TARGET): $(TARGET_OBJ)
+ $(CC) $(LDFLAGS) $(TARGET_OBJ) -o $@
+
+-include $(TARGET_DEP)
+
+build/%.o: src/%.c
+ $(CC) $(CFLAGS) -c $< -o $@
+
+clean:
+ rm -rf build
+
+.PHONY: build clean