From 6b2f03de6f7b533c31d52523d49ede2f627d5bba Mon Sep 17 00:00:00 2001 From: Tobias Wiese Date: Mon, 25 May 2020 03:01:06 +0200 Subject: 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 --- Makefile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'Makefile') 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) -- cgit v1.2.3