Makefile: Use DESTDIR/PREFIX and add uninstall
This commit is contained in:
parent
765850c8f7
commit
5d1a8a836d
1 changed files with 7 additions and 3 deletions
10
Makefile
10
Makefile
|
@ -1,3 +1,5 @@
|
||||||
|
PREFIX ?= /usr/local
|
||||||
|
|
||||||
output: dwmblocks.o
|
output: dwmblocks.o
|
||||||
gcc dwmblocks.o -lX11 -o dwmblocks
|
gcc dwmblocks.o -lX11 -o dwmblocks
|
||||||
dwmblocks.o: dwmblocks.c config.h
|
dwmblocks.o: dwmblocks.c config.h
|
||||||
|
@ -5,6 +7,8 @@ dwmblocks.o: dwmblocks.c config.h
|
||||||
clean:
|
clean:
|
||||||
rm *.o *.gch dwmblocks
|
rm *.o *.gch dwmblocks
|
||||||
install: output
|
install: output
|
||||||
mkdir -p /usr/local/bin
|
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
||||||
cp -f dwmblocks /usr/local/bin
|
cp -f dwmblocks $(DESTDIR)$(PREFIX)/bin
|
||||||
chmod 755 /usr/local/bin/dwmblocks
|
chmod 755 $(DESTDIR)$(PREFIX)/bin/dwmblocks
|
||||||
|
uninstall:
|
||||||
|
rm -f $(DESTDIR)$(PREFIX)/bin/dwmblocks
|
||||||
|
|
Loading…
Reference in a new issue