From c52a81288630c53b4bbefcb15bfd4e8868cc5163 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Thu, 9 Feb 2017 16:59:15 +0100 Subject: Add systemd user unit We use /bin/sh so we have an absolute path --- Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 33198e9..a50d917 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ ERL ?= erl APP := simplec +USER_UNITS := ~/.config/systemd/user/ +SERVICE := $(APP).service .PHONY: deps @@ -26,6 +28,17 @@ test: all tags: find . -name "*.[he]rl" -print | etags - +install_user: test + cp priv/$(SERVICE) $(USER_UNITS)/$(SERVICE) + mkdir -p ~/bin/ + ln -s $$(realpath .)/$(APP) ~/bin/$(APP) + systemctl --user enable $(SERVICE) + +uninstall_user: + systemctl --user stop $(SERVICE) + systemctl --user disable $(SERVICE) + rm -f $(USER_UNITS)/$(SERVICE) ~/bin/$(APP) + DEPSOLVER_PLT=$(CURDIR)/.depsolver_plt $(DEPSOLVER_PLT): dialyzer --output_plt $(DEPSOLVER_PLT) --build_plt \ -- cgit v1.2.3