summary refs log tree commit diff
path: root/Makefile
diff options
context:
space:
mode:
authorNakidai <nakidai@disroot.org>2025-03-25 17:54:09 +0300
committerNakidai <nakidai@disroot.org>2025-03-25 17:54:09 +0300
commit4d3ee4c50376b11e576ebacd3b9976e199f9f077 (patch)
treeb87c4a761f26a806d5bce06a2fcc8f1cf41474b9 /Makefile
parent32914ca4450106012eb3a2105534942637a0d9b4 (diff)
download3cl-4d3ee4c50376b11e576ebacd3b9976e199f9f077.tar.gz
3cl-4d3ee4c50376b11e576ebacd3b9976e199f9f077.zip
Add (un)install targets
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 13 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index a1a5d01..7b4dbeb 100644
--- a/Makefile
+++ b/Makefile
@@ -7,6 +7,7 @@ OBJS += str.o
 OBJS += tokenizer.o
 
 RM ?= rm -f
+DESTDIR ?= /usr/local
 
 
 all: 3cl
@@ -16,6 +17,18 @@ ${OBJS}: cccl.h
 3cl: ${OBJS}
 	${CC} ${LDFLAGS} -o 3cl ${OBJS} ${LDLIBS}
 
+install: all
+	install -d ${DESTDIR}/bin ${DESTDIR}/share/man/man1
+	install -d ${DESTDIR}/bin ${DESTDIR}/share/man/man7
+	install -m755 3cl ${DESTDIR}/bin
+	install -m644 3cl.1 ${DESTDIR}/share/man/man1
+	install -m644 ccl.7 ${DESTDIR}/share/man/man7
+
+uninstall:
+	${RM} ${DESTDIR}/bin/3cl
+	${RM} ${DESTDIR}/share/man/man1/3cl.1
+	${RM} ${DESTDIR}/share/man/man7/ccl.7
+
 clean:
 	${RM} ${OBJS} 3cl