From 0a8b0bedea5df1ff892e5ca5c71578239e2bf781 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sun, 2 May 2021 13:37:36 -0400 Subject: Only link litterbox with -ltls --- Makefile | 11 ++++++++--- configure | 23 ++++++++++------------- 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 -- cgit 1.4.1 768645f9e8c54443a87389ff0dde21277fa1&showmsg=1&follow=1'>home/.config/nvim (unfollow)
Commit message (Collapse)Author
2019-06-29Add Parable of the TalentsJune McEnroe
2019-06-28Rename catsh to 1shJune McEnroe
Yes it's another rename because I felt like catsh was too long. 1sh is short and unique.
2019-06-28Set HISTSIZE in catshJune McEnroe
2019-06-28Unset iflag when exiting catshJune McEnroe
It saves history! It's usable!
2019-06-24Consolidate catsh history documentationJune McEnroe
2019-06-19Set LESS=FRXJune McEnroe
This is how git invokes less by default. I think I want this everywhere. This allows color, exits if the input fits on one screen, and doesn't clear the screen.
2019-06-16Alias date=ddateJune McEnroe
Will I regret this?
2019-06-15Set sensitivity by slot in TF2June McEnroe
2019-06-15Add AcceptanceJune McEnroe
2019-06-07Add variables to bitJune McEnroe
2019-06-05Add A Closed and Common OrbitJune McEnroe
2019-06-02Add RebornJune McEnroe
2019-05-30Add bit to bin.7June McEnroe
2019-05-30Simplify and build bitJune McEnroe
lex is a waste of time.
2019-05-29Add xx -p optionJune McEnroe
2019-05-27Add FrontierJune McEnroe
2019-05-27Break nicks with ZWNJJune McEnroe
This should prevent bad wrapping.
2019-05-26Add DawnJune McEnroe
2019-05-20Declare vasprintf(3) for GNUJune McEnroe
who the fuck is scraeming "#define _GNU_SOURCE" at my house. show yourself, coward. i will never #define _GNU_SOURCE
2019-05-20Fix comparison warning in ttpreJune McEnroe
2019-05-20Add AuthorityJune McEnroe
2019-05-19Specify precedence of unary versions of operatorsJune McEnroe
2019-05-18Add compound assignment operators to orderJune McEnroe
2019-05-15Support simple assignment in orderJune McEnroe
2019-05-15Implement sizeof in orderJune McEnroe
2019-05-15Add orderJune McEnroe
2019-05-12Add T suffix in bitJune McEnroe
2019-05-10Highlight yacc and lex files as CJune McEnroe
Their %-prefixed directives should probably be highlighted Macro.
2019-05-10Use val instead of suboptargJune McEnroe
suboptarg doesn't exist in GNU. Hopefully BSD getsubopt also sets val on failure?
2019-05-09Add Parable of the SowerJune McEnroe
2019-05-07Add bit without buildJune McEnroe
Need to do some stuff in the Makefile for lex and yacc and generating HTML pages for it.
2019-05-04Fix MANDIR typoJune McEnroe
2019-05-04Move relay to binJune McEnroe