about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeonardo Taccari <iamleot@gmail.com>2020-09-25 10:47:42 +0200
committerChris Down <chris@chrisdown.name>2020-09-25 10:07:58 +0100
commita9faca40b3929f22ad1e21c071c853af47b0b7bc (patch)
tree308613987c59b8d0d2233c728f3823fbc1717c61
parent55307a71cbc5d517ff311ea4adf1501717eb0fcf (diff)
downloadclipbuzz-a9faca40b3929f22ad1e21c071c853af47b0b7bc.tar.gz
Honor DESTDIR and PREFIX in {un,}install
-rw-r--r--Makefile8
1 files changed, 6 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 4d6545a..ae81666 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,17 @@
+PREFIX ?= /usr/local
+
 x11_bsd_flags = -I/usr/X11R6/include -L/usr/X11R6/lib
 
 all:
 	${CC} ${CFLAGS} ${LDFLAGS} clipnotify.c -o clipnotify $(x11_bsd_flags) -lX11 -lXfixes
 
 install: all
-	cp clipnotify /usr/local/bin
+	mkdir -p ${DESTDIR}${PREFIX}/bin
+	cp -f clipnotify ${DESTDIR}${PREFIX}/bin
+	chmod 755 ${DESTDIR}${PREFIX}/bin/clipnotify
 
 uninstall:
-	rm /usr/local/bin/clipnotify
+	rm -f ${DESTDIR}${PREFIX}/bin/clipnotify
 
 clean:
 	rm -f *.o *~ clipnotify