diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 25 |
1 files changed, 21 insertions, 4 deletions
@@ -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 + +run: main endpoints.so + env $(shell cat config.env) ./main |