summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
author0scar <qgt268@alumni.ku.dk>2021-09-16 18:55:43 +0000
committer0scar <qgt268@alumni.ku.dk>2021-09-16 18:55:43 +0000
commit9802644a3c6f7d4de289b425eb5ac76a07a0f523 (patch)
tree361ad24ffbe96586ea230c73f066f978e7f80e12 /Makefile
parent04783746a8160b2bdacbc5eda065a56293fc2248 (diff)
Add template for btrees
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 31 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..e340023
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,31 @@
+CC = gcc
+LFLAGS =
+FLAGS = -ansi -Wall -Wextra -pedantic
+OUT = btree-test
+SRC :=$(wildcard src/*.c)
+OBJ :=$(addprefix obj/,$(notdir $(SRC:.c=.o)))
+
+.PHONY: clean
+
+test: debug
+ ./$(OUT)
+
+gdb: debug
+ gdb -q -ex r $(OUT)
+
+debug: DEFS += -g3 -DDEBUG
+debug: obj build
+
+build: $(OUT)
+
+$(OUT): $(OBJ)
+ $(CC) $(DEFS) $(FLAGS) $(LFLAGS) -o $(OUT) $(OBJ)
+
+obj/%.o: src/%.c
+ $(CC) $(DEFS) $(FLAGS) -c -o $@ $<
+
+obj:
+ mkdir -p $@
+
+clean:
+ rm -rf $(OUT) obj