From: sin <sin@2f30.org>
Date: Tue, 21 Oct 2014 15:52:40 +0000 (+0100)
Subject: Add install/uninstall targets
X-Git-Tag: v1.0~92^2~192
X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=65c1dfe1678ba53f2a55e18d508b19a4348d7291;p=nnn.git

Add install/uninstall targets
---

diff --git a/Makefile b/Makefile
index 6ef05082..4146a777 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,4 @@
+PREFIX = /usr/local
 #CPPFLAGS += -DDEBUG
 #CFLAGS += -g
 LDLIBS = -lncursesw
@@ -19,5 +20,15 @@ noice.o: noice.c queue.h util.h
 strlcpy.o: strlcpy.c util.h
 	$(CC) $(CFLAGS) -c strlcpy.c
 
+install: all
+	@echo installing $(BIN) to $(DESTDIR)$(PREFIX)/bin
+	@mkdir -p $(DESTDIR)$(PREFIX)/bin
+	@cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin
+	@chmod 755 $(DESTDIR)$(PREFIX)/bin/$(BIN)
+
+uninstall:
+	@echo removing $(BIN) from $(DESTDIR)$(PREFIX)/bin
+	@rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN)
+
 clean:
 	rm -f $(BIN) $(OBJ)