summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAndrew Cady <d@cryptonomic.net>2021-02-24 18:19:42 -0500
committerAndrew Cady <d@cryptonomic.net>2021-02-24 18:19:42 -0500
commitf32da4ead891548cd23ec0dd6408ef3125b4e9e3 (patch)
treef118423267ae571876899c384cee5ff85d4a8cc6 /Makefile
parent5961303fc6e8f87e61a7abb1b4c14d24e7e30758 (diff)
debian package will include service file; install target will enable service
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 12 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 0fe0bb0..94a7956 100644
--- a/Makefile
+++ b/Makefile
@@ -15,6 +15,7 @@ INSTALL_MKDIR = $(INSTALL) -d -m 755
15 15
16prefix ?= /usr 16prefix ?= /usr
17bindir ?= $(prefix)/bin 17bindir ?= $(prefix)/bin
18etcdir ?= /etc
18 19
19# Targets 20# Targets
20all: tuntox tuntox_nostatic 21all: tuntox tuntox_nostatic
@@ -45,15 +46,22 @@ clean:
45 rm -f *.o tuntox cscope.out gitversion.h tox_bootstrap.h 46 rm -f *.o tuntox cscope.out gitversion.h tox_bootstrap.h
46 47
47install: tuntox_nostatic 48install: tuntox_nostatic
48 $(INSTALL_MKDIR) -d $(DESTDIR)$(bindir) 49 install -d -m755 $(DESTDIR)$(bindir) $(DESTDIR)$(etcdir)
49 cp tuntox_nostatic $(DESTDIR)$(bindir)/tuntox 50 install -d -m700 $(DESTDIR)$(etcdir)/tuntox
50 install scripts/tokssh $(DESTDIR)$(bindir)/ 51 install -D -T tuntox_nostatic $(DESTDIR)$(bindir)/tuntox
52 install -D scripts/tokssh -t $(DESTDIR)$(bindir)/
53 install -m0644 -D -t $(DESTDIR)$(etcdir)/systemd/system scripts/tuntox.service
54ifeq ($(SKIP_SYSTEMCTL),)
55 systemctl daemon-reload
56 systemctl restart tuntox
57 systemctl status tuntox
58endif
51 59
52debs = ../tuntox_0.0.9-1_amd64.deb ../tuntox-dbgsym_0.0.9-1_amd64.deb 60debs = ../tuntox_0.0.9-1_amd64.deb ../tuntox-dbgsym_0.0.9-1_amd64.deb
53.PHONY: install-debs debs 61.PHONY: install-debs debs
54install-debs: $(debs) 62install-debs: $(debs)
55 $(shell [ "$$(id -u)" = 0 ] || echo sudo) dpkg -i $(debs) 63 $(shell [ "$$(id -u)" = 0 ] || echo sudo) dpkg -i $(debs)
56$(debs) debs: 64$(debs) debs:
57 fakeroot ./debian/rules binary 65 fakeroot -- sh -c 'SKIP_SYSTEMCTL=y ./debian/rules binary'
58 66
59.PHONY: all clean tuntox 67.PHONY: all clean tuntox