From 5d1a8a836d21cdca47f65b09beb0aee31c4c2915 Mon Sep 17 00:00:00 2001 From: Christian S Date: Tue, 3 Mar 2020 20:56:08 +0100 Subject: [PATCH] Makefile: Use DESTDIR/PREFIX and add uninstall --- Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 0333d7e..4f6b305 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +PREFIX ?= /usr/local + output: dwmblocks.o gcc dwmblocks.o -lX11 -o dwmblocks dwmblocks.o: dwmblocks.c config.h @@ -5,6 +7,8 @@ dwmblocks.o: dwmblocks.c config.h clean: rm *.o *.gch dwmblocks install: output - mkdir -p /usr/local/bin - cp -f dwmblocks /usr/local/bin - chmod 755 /usr/local/bin/dwmblocks + mkdir -p $(DESTDIR)$(PREFIX)/bin + cp -f dwmblocks $(DESTDIR)$(PREFIX)/bin + chmod 755 $(DESTDIR)$(PREFIX)/bin/dwmblocks +uninstall: + rm -f $(DESTDIR)$(PREFIX)/bin/dwmblocks