aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-01-17 12:12:37 +0000
committerOmar Polo <op@omarpolo.com>2021-01-17 12:12:37 +0000
commit771d8f281baa6f15913d705365e00c3128feac8b (patch)
treec9bf21c1b7d62705979b3ec71ab23d3232320699 /Makefile
parent0170ba023f9c85bde2c4ae410b0af741383b7317 (diff)
build docs + install and static targets
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 16 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index cf06def..4d6ae12 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,12 @@ LDFLAGS = -ltls
LEX = lex
YACC = yacc
-.PHONY: all clean test
+PREFIX = /usr/local
+
+# /usr/local/lib on FreeBSD
+LIBDIR = /usr/lib/
+
+.PHONY: all static clean test install
all: gmid TAGS README.md
@@ -18,6 +23,12 @@ OBJS = gmid.o iri.o utf8.o lex.yy.o y.tab.o ex.o cgi.o sandbox.o
gmid: ${OBJS}
${CC} ${OBJS} -o gmid ${LDFLAGS}
+static: ${OBJS}
+ ${CC} -static ${OBJS} \
+ ${LIBDIR}/libcrypto.a ${LIBDIR}/libtls.a ${LIBDIR}/libssl.a \
+ -o gmid
+ strip gmid
+
TAGS: gmid.c iri.c utf8.c ex.c cgi.c sandbox.c
-etags gmid.c iri.c utf8.c ex.c cgi.c sandbox.c || true
@@ -35,3 +46,7 @@ test: gmid iri_test
@echo "server tests"
@echo "=============================="
cd test && ./test.sh
+
+install: gmid
+ install -o root -g wheel -m 0755 gmid ${PREFIX}/bin/
+ install -o root -g wheel -m 0644 gmid.1 ${PREFIX}/man/man1