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