summary refs log tree commit diff
diff options
context:
space:
mode:
-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