# This was stolen from here: https://avikdas.com/2019/12/16/makefiles-for-c-cpp-projects.html CFILES = $(wildcard src/*.c) OBJFILES = $(CFILES:.c=.o) OUT = proxy CFLAGS = -Wall LDLIBS = -lsqlite3 CC = gcc .PHONY: default default: $(OUT) .PHONY: run run: $(OUT) ./$(OUT) $(OUT): $(OBJFILES) $(CC) -o $@ $^ $(LDLIBS) %.o: %.c $(CC) $(CFLAGS) -c -o $@ $^ .PHONY: clean clean: rm -f $(OBJFILES) $(OUT)