diff options
author | justanothercatgirl <sotov@twistea.su> | 2025-03-31 15:44:36 +0300 |
---|---|---|
committer | justanothercatgirl <sotov@twistea.su> | 2025-03-31 15:44:36 +0300 |
commit | 08403b616f9dad83cb1204eec83ba1252e3eb129 (patch) | |
tree | 7d248c9db76d1b1bf9f303b9c0caadf1dd765a8d /Makefile | |
parent | 82742d5d13dc7b0691a79c79f8e62782fcb16e10 (diff) |
Early working state.
TODO:
* /api/linkdel, /api/linkget
* finish website
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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 |