From 29f97864e1b0ef142249898b39332b26a5fb4906 Mon Sep 17 00:00:00 2001 From: jvech Date: Mon, 10 Jul 2023 22:40:05 -0500 Subject: add: json file function implemented --- Makefile | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Makefile (limited to 'Makefile') 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 -- cgit v1.2.3-70-g09d2