From 08403b616f9dad83cb1204eec83ba1252e3eb129 Mon Sep 17 00:00:00 2001 From: justanothercatgirl Date: Mon, 31 Mar 2025 15:44:36 +0300 Subject: Early working state. TODO: * /api/linkdel, /api/linkget * finish website --- Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 3ba5288..372caed 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ # Makefile GPERF = gperf -CC = cc +CC = gcc -CFLAGS += -Ic_headers/include -Iinclude -ggdb +CFLAGS += -Ic_headers/include -Iinclude -ggdb -Wall -Wextra -DDEFAULT_ENDPOINTS_PATH=\"./endpoints.so\" BLDDIR ?= build all: $(BLDDIR) endpoints.so main @@ -19,6 +19,9 @@ $(BLDDIR)/endpoints.o: src/endpoints.c $(BLDDIR)/rename.ld $(BLDDIR) # PIC here is important $(CC) -fPIC -c $< $(CFLAGS) -o $@ +$(BLDDIR)/sql.o: src/sql.c + $(CC) -fPIC -c $< $(CFLAGS) -o $@ + $(BLDDIR)/rename.ld: $(BLDDIR)/endpoints.o $(BLDDIR) # Looks terrible # All it does is generating ld script that creates aliases for functions @@ -26,8 +29,8 @@ $(BLDDIR)/rename.ld: $(BLDDIR)/endpoints.o $(BLDDIR) @readelf --syms --wide $(BLDDIR)/endpoints.o | awk '/FUNC/ && /GLOBAL/ && /ENDP/ {old = $$8; gsub(/_/, "/", $$8); gsub(/ENDP/, "", $$8); printf "\t%s = %s;\n", $$8, old }' >> $@ echo } >> $@ -endpoints.so: $(BLDDIR)/endpoints.o $(BLDDIR)/common.o $(BLDDIR)/mime.o - $(CC) -shared -fPIE -Wl,$(BLDDIR)/rename.ld $^ -lmicrohttpd -o $@ +endpoints.so: $(BLDDIR)/endpoints.o $(BLDDIR)/common.o $(BLDDIR)/mime.o $(BLDDIR)/sql.o + $(CC) -shared -fPIC -Wl,$(BLDDIR)/rename.ld $(CFLAGS) $^ -lmicrohttpd -lsqlite3 -o $@ # main -- cgit v1.2.3-70-g09d2