about summary refs log tree commit diff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 13 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index b2fd744..4cd3419 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,18 @@
 PREFIX ?= ~/.local
-MANDIR ?= ${PREFIX}/share/man
+BINDIR ?= ${PREFIX}/bin
+MANDIR ?= ${PREFIX}/man
 
 CFLAGS += -std=c11 -Wall -Wextra -Wpedantic -Wno-overlength-strings
-LDLIBS = -lkcgi -lkcgihtml -lsqlite3
+LDADD.kcgi = -lkcgi
+LDADD.kcgi-html = -lkcgihtml
+LDADD.sqlite3 = -lsqlite3
 
 TEST_DB = ~/.local/share/litterbox/litterbox.sqlite
 
 -include config.mk
 
+LDLIBS = ${LDADD.kcgi} ${LDADD.kcgi-html} ${LDADD.sqlite3}
+
 OBJS += contexts.o
 OBJS += css.o
 OBJS += events.o
@@ -21,7 +26,7 @@ dev: tags all test
 all: scooper
 
 scooper: ${OBJS}
-	${CC} ${LDFLAGS} ${OBJS} ${LDLIBS} -o $@
+	${CC} ${STATIC} ${LDFLAGS} ${OBJS} ${LDLIBS} -o $@
 
 ${OBJS}: server.h
 
@@ -34,16 +39,16 @@ test: .test
 	./scooper -c ${TEST_DB}
 	touch .test
 
-tags: *.c *.h
-	ctags -w *.c *.h
+tags: *.[ch]
+	ctags -w *.[ch]
 
 clean:
 	rm -f scooper ${OBJS} css.c .test tags
 
 install: scooper scooper.1
-	install -d ${DESTDIR}${PREFIX}/bin ${DESTDIR}${MANDIR}/man1
-	install scooper ${DESTDIR}${PREFIX}/bin
+	install -d ${DESTDIR}${BINDIR} ${DESTDIR}${MANDIR}/man1
+	install scooper ${DESTDIR}${BINDIR}
 	install -m 644 scooper.1 ${DESTDIR}${MANDIR}/man1
 
 uninstall:
-	rm -f ${DESTDIR}${PREFIX}/bin/scooper ${DESTDIR}${MANDIR}/man1/scooper.1
+	rm -f ${DESTDIR}${BINDIR}/scooper ${DESTDIR}${MANDIR}/man1/scooper.1