aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorjustanothercatgirl <sotov@twistea.su>2025-04-01 21:37:43 +0300
committerjustanothercatgirl <sotov@twistea.su>2025-04-01 21:54:17 +0300
commita81c5876f2058605cc5f15525591acde3ae16a80 (patch)
tree37edb55c4733288c9e58a0da960a6e3918a12279 /Makefile
parent08403b616f9dad83cb1204eec83ba1252e3eb129 (diff)
Integrated STE into html generation & cleaned up code
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 21 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 372caed..7a101dd 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
+
+run: main endpoints.so
+ env $(shell cat config.env) ./main