summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Makefile11
-rwxr-xr-xconfigure23
2 files changed, 18 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index f0f7e75..bea16f6 100644
--- a/Makefile
+++ b/Makefile
@@ -3,13 +3,18 @@ MANDIR ?= ${PREFIX}/share/man
 ETCDIR ?= ${PREFIX}/etc
 
 CFLAGS += -std=c11 -Wall -Wextra -Wpedantic
-LDLIBS = -lsqlite3 -ltls
+LDADD.sqlite3 = -lsqlite3
+LDADD.libtls = -ltls
 
 BINS = litterbox scoop unscoop
 MANS = ${BINS:=.1}
 
 -include config.mk
 
+LDLIBS.litterbox = ${LDADD.sqlite3} ${LDADD.libtls}
+LDLIBS.scoop = ${LDADD.sqlite3}
+LDLIBS.unscoop = ${LDADD.sqlite3}
+
 OBJS.litterbox = litterbox.o config.o xdg.o
 OBJS.scoop = scoop.o xdg.o
 OBJS.unscoop = unscoop.o xdg.o
@@ -27,8 +32,8 @@ scoop: ${OBJS.scoop}
 
 unscoop: ${OBJS.unscoop}
 
-.o:
-	${CC} ${LDFLAGS} ${OBJS.$@} ${LDLIBS} -o $@
+${BINS}:
+	${CC} ${LDFLAGS} ${OBJS.$@} ${LDLIBS.$@} -o $@
 
 ${OBJS}: database.h
 
diff --git a/configure b/configure
index bf9d132..1811b56 100755
--- a/configure
+++ b/configure
@@ -4,21 +4,21 @@ set -eu
 cflags() {
 	echo "CFLAGS += $*"
 }
-ldlibs() {
-	echo "LDLIBS ${o:-}= $*"
-	o=+
-}
-config() {
-	pkg-config --print-errors "$@"
-	cflags $(pkg-config --cflags "$@")
-	ldlibs $(pkg-config --libs "$@")
-}
 defstr() {
 	cflags "-D'$1=\"$2\"'"
 }
 defvar() {
 	defstr "$1" "$(pkg-config --variable=$3 $2)${4:-}"
 }
+ldadd() {
+	lib=$1; shift
+	echo "LDADD.${lib} = $*"
+}
+config() {
+	pkg-config --print-errors "$@"
+	cflags $(pkg-config --cflags "$@")
+	for lib; do ldadd $lib $(pkg-config --libs $lib); done
+}
 
 exec >config.mk
 
@@ -32,17 +32,14 @@ done
 
 case "$(uname)" in
 	(OpenBSD)
-		ldlibs -ltls
 		config sqlite3
-		defvar SQLITE3_BIN sqlite3 exec_prefix /bin/sqlite3
 		;;
 	(Linux)
 		cflags -D_GNU_SOURCE
 		config sqlite3 libtls
-		defvar SQLITE3_BIN sqlite3 exec_prefix /bin/sqlite3
 		;;
 	(*)
 		config sqlite3 libtls
-		defvar SQLITE3_BIN sqlite3 exec_prefix /bin/sqlite3
 		;;
 esac
+defvar SQLITE3_BIN sqlite3 exec_prefix /bin/sqlite3
01-22Update some pluginsJune McEnroe 2012-01-22Add VCS repo directories to wildignoreJune McEnroe 2012-01-22Map ,e and ,b to CtrlP file and buffer respectivelyJune McEnroe 2012-01-22Add vim-spaceJune McEnroe 2012-01-22Add AutoCloseJune McEnroe 2012-01-22Add binding for GundoJune McEnroe 2012-01-22Add GundoJune McEnroe 2012-01-22Add Jellybeans colorschemeJune McEnroe 2012-01-22Add syntasticJune McEnroe 2012-01-21Add PowerlineJune McEnroe 2012-01-21Add quicktaskJune McEnroe 2012-01-15Moved comments out of mapsJune McEnroe 2012-01-14Disable scrollbarsJune McEnroe