aptpkg/Makefile

29 lines
680 B
Makefile

PREFIX?=/usr/local
BINDIR?=$(PREFIX)/bin
# Exists in GNUMake but not in NetBSD make and others.
RM?=rm -f
.PHONY: help
help: ## Show this help
@egrep -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
.PHONY: install
install: ## Install aptpkg
mkdir -m755 -p $(DESTDIR)$(BINDIR)
install -m755 aptpkg $(DESTDIR)$(BINDIR)/aptpkg
.PHONY: test
test: ## Run shellcheck tests
shellcheck aptpkg
RMDIR_IF_EMPTY:=sh -c '\
if test -d $$0 && ! ls -1qA $$0 | grep -q . ; then \
rmdir $$0; \
fi'
.PHONY: uninstall
uninstall: ## Uninstall aptpkg
$(RM) $(DESTDIR)$(BINDIR)/aptpkg
${RMDIR_IF_EMPTY} $(DESTDIR)$(BINDIR)