summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorTobias Wiese <tobias@tobiaswiese.com>2020-05-25 03:01:06 +0200
committerTobias Wiese <tobias@tobiaswiese.com>2020-05-25 03:01:06 +0200
commit6b2f03de6f7b533c31d52523d49ede2f627d5bba (patch)
tree1b3cac20f8bbc7e6149650874a5f256b294c34de /Makefile
parent8bc203cb254638d0070436ccd2b899b56ffbc52d (diff)
Makefile: Add install and uninstall target
Adds a target for installation and uninstallation. Also restructures the makefile a bit, to remove duplication. Signed-off-by: Tobias Wiese <tobias@tobiaswiese.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 9 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index ec85e7e..b82db39 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,14 @@
SHELL = /bin/sh
+prefix = /usr/local
.PHONY: all clean
+all clean:
+ @$(MAKE) -C src/ $@
-all:
- @$(MAKE) -C src/
+.PHONY: distclean
+distclean: clean
-clean:
- @$(MAKE) -C src/ $@
+.PHONY: install uninstall
+install uninstall:
+ $(eval dd := $(shell test -z "$(DESTDIR)" || realpath -m "$(DESTDIR)"))
+ @$(MAKE) -C src/ $@ DESTDIR=$(dd) prefix=$(prefix)