aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorjvech <jmvalenciae@unal.edu.co>2023-07-10 22:40:05 -0500
committerjvech <jmvalenciae@unal.edu.co>2023-07-10 22:40:05 -0500
commit29f97864e1b0ef142249898b39332b26a5fb4906 (patch)
treef133891c532c819910cfa1a46a38480981287ac2 /Makefile
add: json file function implemented
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..cd16efd
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,31 @@
+CC = gcc
+CFLAGS = -std=c11 -Wall -g
+BIN = ml
+OBJDIR = objs
+SRC = $(wildcard src/*.c)
+HEADERS = $(wildcard src/*.h)
+OBJS = $(SRC:src/%.c=${OBJDIR}/%.o)
+DLIBS = -ljson-c
+.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)
+ gdb $< --tui
+
+clean:
+ @rm $(OBJS) $(OBJDIR) -rv
Feel free to download, copy and edit any repo