summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile36
1 files changed, 36 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..3a69811
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,36 @@
+CC = clang
+CFLAGS = -g -DDEBUG -fsanitize=address
+LDFLAGS != pkg-config --libs libcurl sqlite3
+
+BIN=bin/newspaddle
+
+SRC=$(wildcard src/*.c)
+OBJ=$(patsubst src/%.c, obj/%.o, $(SRC))
+
+all: bin/ obj/ $(BIN)
+
+$(BIN): $(OBJ)
+ $(CC) $^ $(LDFLAGS) -fsanitize=address -o $@
+
+obj/%.o: src/%.c
+ $(CC) $(CFLAGS) -c $< -o $@
+
+bin/:
+ mkdir bin
+
+obj/:
+ mkdir obj
+
+run: all
+ ./$(BIN)
+
+debug: all
+ gdb ./$(BIN)
+
+scan:
+ make clean
+ scan-build make
+
+clean:
+ rm -r bin/
+ rm -r obj/