aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-08-20 23:13:36 +0200
committerThomas Voss <mail@thomasvoss.com> 2023-08-20 23:13:36 +0200
commitbdd21b65c64c76930f159feb6e12e248b5f15a91 (patch)
tree5cdd9e77be60462a5d6a62a1ffe25014c50627ec
parent70ecd2e64631aa7ad2ca3eebe32bdf19bcbb04a8 (diff)
Add an ‘install’ rule
-rw-r--r--Makefile8
1 files changed, 8 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index e368746..b8198a4 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,9 @@ CFLAGS = -Wall -Wextra -Wpedantic -Werror \
-fomit-frame-pointer -pipe
LDLIBS = -luriparser -lssl -lcrypto
+PREFIX = /usr/local
+DPREFIX = ${DESTDIR}${PREFIX}
+
all: totp
totp: main.o b32.o
${CC} ${LDLIBS} -o $@ main.o b32.o
@@ -14,5 +17,10 @@ main.o: main.c b32.h
b32.o: b32.c b32.h
${CC} ${CFLAGS} -c b32.c
+install:
+ mkdir -p ${DPREFIX}/bin ${DPREFIX}/share/man/man1
+ cp totp ${DPREFIX}/bin
+ cp totp.1 ${DPREFIX}/share/man/man1
+
clean:
rm -f totp *.o