Merge pull request #3 from crian/patch-1

Makefile: Use DESTDIR/PREFIX and add uninstall
This commit is contained in:
Luke Smith 2020-03-03 16:50:35 -05:00 committed by GitHub
commit 8d8c208ac8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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