summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-07-09 16:44:39 -0400
committerJune McEnroe <june@causal.agency>2020-07-09 16:44:39 -0400
commit0aae05ac4a32c19ea14b512e4ea2ee339d5b096d (patch)
treed0d788b90ce6cda06bc2b63d20866e6dabe7acf4
parentAdd compatibility for kcgi <0.12 (diff)
downloadscooper-0aae05ac4a32c19ea14b512e4ea2ee339d5b096d.tar.gz
scooper-0aae05ac4a32c19ea14b512e4ea2ee339d5b096d.zip
Add configure script and install target
-rw-r--r--.gitignore1
-rw-r--r--Makefile18
-rwxr-xr-xconfigure11
3 files changed, 29 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 6c4605b..9d35820 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
+config.mk
 scooper
diff --git a/Makefile b/Makefile
index ce4cdcf..94ca089 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,20 @@
+PREFIX ?= ~/.local
+MANDIR ?= ${PREFIX}/share/man
+
 CFLAGS += -std=c11 -Wall -Wextra -Wpedantic
-LDLIBS = -lsqlite3 -lkcgi -lkcgihtml -lz
+LDLIBS = -lkcgi -lkcgihtml -lsqlite3
+
+-include config.mk
 
 scooper:
+
+clean:
+	rm -f scooper
+
+install: scooper scooper.1
+	install -d ${PREFIX}/bin ${MANDIR}/man1
+	install scooper ${PREFIX}/bin
+	install -m 644 scooper.1 ${MANDIR}/man1
+
+uninstall:
+	rm -f ${PREFIX}/bin/scooper ${MANDIR}/man1/scooper.1
diff --git a/configure b/configure
new file mode 100755
index 0000000..9cea63b
--- /dev/null
+++ b/configure
@@ -0,0 +1,11 @@
+#!/bin/sh
+set -eu
+
+libs='kcgi kcgi-html sqlite3'
+pkg-config --print-errors $libs
+
+cat >config.mk <<EOF
+CFLAGS += $(pkg-config --static --cflags $libs)
+LDFLAGS += -static $(pkg-config --static --libs-only-L $libs)
+LDLIBS = $(pkg-config --static --libs-only-l $libs)
+EOF
pan title='2019-01-03 02:12:16 +0100'>2019-01-03filters: migrate from luacrypto to luaosslJason A. Donenfeld 2019-01-02ui-shared: fix broken sizeof in title setting and rewriteJason A. Donenfeld 2018-12-09git: update to v2.20.0Christian Hesse 2018-11-25ui-blame: set repo for sbJason A. Donenfeld 2018-11-25auth-filter: pass url with query string attachedJason A. Donenfeld 2018-11-21git: use xz compressed archive for downloadChristian Hesse 2018-10-12git: update to v2.19.1Christian Hesse 2018-09-11ui-ssdiff: ban strcat()Christian Hesse 2018-09-11ui-ssdiff: ban strncpy()Christian Hesse 2018-09-11ui-shared: ban strcat()Christian Hesse 2018-09-11ui-patch: ban sprintf()Christian Hesse 2018-09-11ui-log: ban strncpy()Christian Hesse 2018-09-11ui-log: ban strcpy()Christian Hesse 2018-09-11parsing: ban sprintf()Christian Hesse 2018-09-11parsing: ban strncpy()Christian Hesse 2018-08-28filters: generate anchor links from markdownChristian Hesse 2018-08-03Bump version.Jason A. Donenfeld 2018-08-03clone: fix directory traversalJason A. Donenfeld 2018-08-03config: record repo.snapshot-prefix in the per-repo configKonstantin Ryabitsev