aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile30
1 files changed, 30 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..4403292
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,30 @@
+CC = clang
+CFLAGS = -std=c11 -Wall -g
+BIN = dsco
+OBJDIR = objs
+SRC = $(wildcard src/*.c)
+HEADERS = $(wildcard src/*.h)
+OBJS = $(SRC:src/%.c=${OBJDIR}/%.o)
+.PHONY: clean all run
+
+all: build
+
+$(OBJS): | $(OBJDIR)
+
+$(OBJDIR):
+ mkdir ${OBJDIR}
+
+$(OBJDIR)/%.o: src/%.c $(HEADERS)
+ ${CC} -c -o $@ $< ${CFLAGS}
+
+build: $(OBJS)
+ ${CC} ${DLIBS} -o ${BIN} ${OBJS}
+
+run: build
+ ./${BIN}
+
+debug: $(BIN)
+ lldb $< --tui
+
+clean:
+ @rm $(OBJS) $(OBJDIR) -rv
Feel free to download, copy and edit any repo