tAdd preliminary man page and (un)install targets - filmtools - various tools for photographic film development and darkroom printing
(HTM) git clone git://src.adamsgaard.dk/filmtools
(DIR) Log
(DIR) Files
(DIR) Refs
---
(DIR) commit c8dd9b0bf1a070796343b7c4f0336be30609ee9f
(DIR) parent 925ca743c9d9b8cad49b4dcfb36a93893f5c666c
(HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Sun, 12 Jan 2020 10:15:33 +0100
Add preliminary man page and (un)install targets
Diffstat:
M Makefile | 22 ++++++++++++++++++----
A config.mk | 16 ++++++++++++++++
A timeadj.1 | 15 +++++++++++++++
3 files changed, 49 insertions(+), 4 deletions(-)
---
(DIR) diff --git a/Makefile b/Makefile
t@@ -1,20 +1,34 @@
.POSIX:
+include config.mk
+
SRC = timeadj.c
BIN = timeadj
-LDFLAGS = -lm
+MAN1 = timeadj.1
OBJ = ${SRC:.c=.o}
all: ${BIN}
.o:
- ${CC} ${LDFLAGS} -o $@
+ ${CC} ${FILMTOOLS_LDFLAGS} -o $@
.c.o:
- ${CC} -c ${CFLAGS} -o $@ -c $<
+ ${CC} -c ${FILMTOOLS_CFLAGS} -o $@ -c $<
clean:
rm -f ${BIN} ${OBJ}
-.PHONY: all clean
+install: all
+ mkdir -p ${DESTDIR}${PREFIX}/bin
+ cp -f ${BIN} ${DESTDIR}${PREFIX}/bin
+ for f in ${BIN}; do chmod 755 ${DESTDIR}${PREFIX}/bin/$$f; done
+ mkdir -p ${DESTDIR}${MANPREFIX}/man1
+ cp -f ${MAN1} ${DESTDIR}${MANPREFIX}/man1
+ for m in ${MAN1}; do chmod 644 ${DESTDIR}${MANPREFIX}/man1/$$m; done
+
+uninstall:
+ for f in ${BIN}; do rm -f ${DESTDIR}${PREFIX}/bin/$$f; done
+ for m in ${MAN1}; do rm -f ${DESTDIR}${PREFIX}/man1/$$m; done
+
+.PHONY: all clean install uninstall
(DIR) diff --git a/config.mk b/config.mk
t@@ -0,0 +1,16 @@
+# customize below to fit your system
+
+# paths
+PREFIX = /usr/local
+MANPREFIX = ${PREFIX}/man
+
+# compiler and linker
+CC = cc
+
+FILMTOOLS_CFLAGS = ${CFLAGS}
+FILMTOOLS_LDFLAGS = ${LDFLAGS}
+FILMTOOLS_CPPFLAGS = -D_DEFAULT_SOURCE
+
+# debug
+#FILMTOOLS_CFLAGS = -fstack-protector-all -O0 -g -std=c99 -Wall -Wextra -pedantic
+#FILMTOOLS_LDFLAGS =
(DIR) diff --git a/timeadj.1 b/timeadj.1
t@@ -0,0 +1,15 @@
+.Dd Jan 12, 2020
+.Dt TIMEADJ 1
+.Os
+.Sh NAME
+.Nm timeadj
+.Nd fractional time converter
+.Sh SYNOPSIS
+.Nm
+.Ar FACTOR
+.Ar TIME
+.Sh DESCRIPTION
+.Nm
+converts TIME by multiplying with FACTOR.
+.Sh AUTHORS
+.An Anders Damsgaard Aq Mt anders@adamsgaard.dk