From 0aae05ac4a32c19ea14b512e4ea2ee339d5b096d Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Thu, 9 Jul 2020 16:44:39 -0400 Subject: Add configure script and install target --- .gitignore | 1 + Makefile | 18 +++++++++++++++++- configure | 11 +++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100755 configure 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 <