From 0eedaa2a2e5fc58789b268fdfc1b05e63dabc36b Mon Sep 17 00:00:00 2001 From: justanothercatgirl Date: Tue, 1 Apr 2025 21:37:43 +0300 Subject: Integrated STE into html generation & cleaned up code --- Makefile | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 372caed..1b71312 100644 --- a/Makefile +++ b/Makefile @@ -3,19 +3,30 @@ GPERF = gperf CC = gcc -CFLAGS += -Ic_headers/include -Iinclude -ggdb -Wall -Wextra -DDEFAULT_ENDPOINTS_PATH=\"./endpoints.so\" BLDDIR ?= build +CFLAGS += -Ic_headers/include -Iinclude -I$(BLDDIR) -ggdb -Wall -Wextra -DDEFAULT_ENDPOINTS_PATH=\"./endpoints.so\" all: $(BLDDIR) endpoints.so main -.PHONY: all clean $(BLDDIR) +.PHONY: all clean run $(BLDDIR): mkdir -p $(BLDDIR) +$(BLDDIR)/template: + mkdir -p $@ + +$(BLDDIR)/ste: c_headers/ste/ste.c + $(CC) -o $@ $< + + +$(BLDDIR)/template/%: template/%.ste $(BLDDIR)/ste $(BLDDIR)/template + $(BLDDIR)/ste -o $@ $< + # endpoints -$(BLDDIR)/endpoints.o: src/endpoints.c $(BLDDIR)/rename.ld $(BLDDIR) +$(BLDDIR)/endpoints.o: src/endpoints.c $(BLDDIR) \ + $(BLDDIR)/template/args.html $(BLDDIR)/template/linkadd.html # PIC here is important $(CC) -fPIC -c $< $(CFLAGS) -o $@ @@ -47,4 +58,10 @@ main: $(BLDDIR)/main.o $(BLDDIR)/mime.o $(BLDDIR)/common.o $(CC) $(CFLAGS) $^ -ldl -lmicrohttpd -lsqlite3 -o $@ clean: - $(RM) $(BLDDIR)/* main endpoints.o endpoints.so rename.ld include/mime.h.inc + $(RM) --recursive $(BLDDIR)/template/* $(BLDDIR)/* main endpoints.o endpoints.so rename.ld include/mime.h.inc + +veryclean: clean + $(RM) jals.db config.env + +run: main endpoints.so + env $(shell cat config.env) ./main -- cgit v1.2.3-70-g09d2