aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 21 insertions, 4 deletions
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