papirus-folders/Makefile

46 lines
1.2 KiB
Makefile
Raw Normal View History

2018-10-28 14:39:45 -04:00
# GNU make is required to run this file. To install on *BSD, run:
# gmake PREFIX=/usr/local install
2017-09-06 16:44:55 -04:00
PREFIX ?= /usr
PROGNAME := papirus-folders
2018-09-09 17:37:19 -04:00
VERSION ?=
ZSHCOMPDIR ?= $(PREFIX)/share/zsh/vendor-completions
2017-09-06 16:44:55 -04:00
all:
install:
mkdir -p $(DESTDIR)$(PREFIX)/bin
install -m 755 $(PROGNAME) $(DESTDIR)$(PREFIX)/bin
mkdir -p $(DESTDIR)$(PREFIX)/share/bash-completion/completions
2018-03-09 11:43:23 -05:00
install -m 644 completion/$(PROGNAME) \
$(DESTDIR)$(PREFIX)/share/bash-completion/completions
mkdir -p $(DESTDIR)$(ZSHCOMPDIR)
2018-03-09 11:43:23 -05:00
install -m 644 completion/_$(PROGNAME) \
$(DESTDIR)$(ZSHCOMPDIR)
2017-09-06 16:44:55 -04:00
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/$(PROGNAME)
rm -f $(DESTDIR)$(PREFIX)/share/bash-completion/completions/$(PROGNAME)
rm -f $(DESTDIR)$(ZSHCOMPDIR)/_$(PROGNAME)
2017-09-06 16:44:55 -04:00
_get_version:
$(if $(VERSION),,$(error VERSION is not defined. Pass via "make bump VERSION=0.1.2"))
2017-09-06 16:44:55 -04:00
2018-09-09 17:37:19 -04:00
bump: _get_version
sed -i '/VERSION=/s/[0-9.]\+/$(VERSION)/' $(PROGNAME)
dch -v $(VERSION)-1 -- ''
git commit -am "Bump to v$(VERSION)"
git tag -f v$(VERSION)
release:
2017-11-07 07:58:59 -05:00
git push origin
2017-09-06 16:44:55 -04:00
git push origin --tags
2018-09-09 17:37:19 -04:00
.PHONY: all install uninstall _get_version bump release
2018-10-28 14:39:45 -04:00
# .BEGIN is ignored by GNU make so we can use it as a guard
.BEGIN:
@head -3 Makefile
@false