2020-07-05 13:25:52 +02:00
|
|
|
# Install to /usr/local unless otherwise specified, such as `make PREFIX=/app`
|
|
|
|
PREFIX?=/usr/local
|
|
|
|
|
|
|
|
# What to run to install various files
|
|
|
|
INSTALL?=install
|
|
|
|
# Run to install the actual binary
|
|
|
|
INSTALL_PROGRAM=$(INSTALL) -Dm 755
|
|
|
|
# Run to install application data, with differing permissions
|
|
|
|
INSTALL_DATA=$(INSTALL) -Dm 644
|
|
|
|
|
|
|
|
# Directories into which to install the various files
|
|
|
|
bindir=$(DESTDIR)$(PREFIX)/bin
|
|
|
|
sharedir=$(DESTDIR)$(PREFIX)/share
|
2018-08-15 05:42:09 +02:00
|
|
|
|
2020-07-05 13:25:52 +02:00
|
|
|
help:
|
|
|
|
@echo "targets:"
|
2020-09-05 20:05:16 +02:00
|
|
|
@awk -F '#' '/^[a-zA-Z0-9_-]+:.*?#/ { print $0 }' $(MAKEFILE_LIST) \
|
|
|
|
| sed -n 's/^\(.*\): \(.*\)#\(.*\)/ \1|-\3/p' \
|
2020-07-05 13:25:52 +02:00
|
|
|
| column -t -s '|'
|
|
|
|
|
2020-09-05 20:05:16 +02:00
|
|
|
install: pb pb.1 # system install
|
2020-07-05 13:25:52 +02:00
|
|
|
$(INSTALL_PROGRAM) pb $(bindir)/pb
|
|
|
|
$(INSTALL_DATA) pb.1 $(sharedir)/man/man1/pb.1
|
2018-08-15 05:42:09 +02:00
|
|
|
|
2020-09-05 20:05:16 +02:00
|
|
|
uninstall: # system uninstall
|
2020-07-05 13:25:52 +02:00
|
|
|
rm -f $(bindir)/pb
|
|
|
|
rm -f $(sharedir)/man/man1/pb.1
|
2018-08-15 05:42:09 +02:00
|
|
|
|
2020-07-05 13:25:52 +02:00
|
|
|
.PHONY: install uninstall help
|