aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorjvech <jmvalenciae@unal.edu.co>2023-06-18 15:03:25 -0500
committerjvech <jmvalenciae@unal.edu.co>2023-06-18 15:03:25 -0500
commit3113ade53d0dd889058c7838bb19c0fa0492b410 (patch)
tree4ca9353b421fbdc9d8ead8a257c415be133315d7 /Makefile
init: ppm library utilities implemented
It is not completed at all but it works well
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