From afda5e684b4c3b02d55436a6ea6bff82cb56d056 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 7 Jun 2016 17:11:09 -0700 Subject: [PATCH] Make install/uninstall for Linux --- make-linux.mk | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/make-linux.mk b/make-linux.mk index 0e802074c..8a7f3b142 100644 --- a/make-linux.mk +++ b/make-linux.mk @@ -32,6 +32,7 @@ endif INCLUDES?= DEFS?= LDLIBS?= +DESTDIR?= include objects.mk @@ -146,4 +147,33 @@ debug: FORCE make ZT_DEBUG=1 one make ZT_DEBUG=1 selftest +install: FORCE + mkdir -p $(DESTDIR)/usr/sbin + rm -f $(DESTDIR)/usr/sbin/zerotier-one + cp -f zerotier-one $(DESTDIR)/usr/sbin/zerotier-one + mkdir -p $(DESTDIR)/usr/bin + rm -f $(DESTDIR)/usr/bin/zerotier-cli + rm -f $(DESTDIR)/usr/bin/zerotier-idtool + ln -s $(DESTDIR)/usr/sbin/zerotier-one $(DESTDIR)/usr/bin/zerotier-cli + ln -s $(DESTDIR)/usr/sbin/zerotier-one $(DESTDIR)/usr/bin/zerotier-idtool + mkdir -p $(DESTDIR)/var/lib/zerotier-one + rm -f $(DESTDIR)/var/lib/zerotier-one/zerotier-one + rm -f $(DESTDIR)/var/lib/zerotier-one/zerotier-cli + rm -f $(DESTDIR)/var/lib/zerotier-one/zerotier-idtool + ln -s $(DESTDIR)/usr/sbin/zerotier-one $(DESTDIR)/var/lib/zerotier-one/zerotier-one + ln -s $(DESTDIR)/usr/sbin/zerotier-one $(DESTDIR)/var/lib/zerotier-one/zerotier-cli + ln -s $(DESTDIR)/usr/sbin/zerotier-one $(DESTDIR)/var/lib/zerotier-one/zerotier-idtool + +uninstall: FORCE + rm -f $(DESTDIR)/var/lib/zerotier-one/zerotier-one + rm -f $(DESTDIR)/var/lib/zerotier-one/zerotier-cli + rm -f $(DESTDIR)/var/lib/zerotier-one/zerotier-idtool + rm -f $(DESTDIR)/usr/bin/zerotier-cli + rm -f $(DESTDIR)/usr/bin/zerotier-idtool + rm -f $(DESTDIR)/usr/sbin/zerotier-one + rm -rf $(DESTDIR)/var/lib/zerotier-one/iddb.d + rm -rf $(DESTDIR)/var/lib/zerotier-one/updates.d + rm -rf $(DESTDIR)/var/lib/zerotier-one/networks.d + rm -f $(DESTDIR)/var/lib/zerotier-one/zerotier-one.port + FORCE: