Update Makefile (see commit description)

* Now can change the list of themes that will be installed:

  Install only Papirus and Papirus-Dark:
  `make THEMES="Papirus Papirus-Dark" install`

  Install all except ePapirus and Papirus-Light
  `make IGNORE="ePapirus Papirus-Light" install`

* Deleted `make post-install`. Icon caches now building with
  `make install` if DESTDIR is not set
* Added `make dist`
* Added .gitattributes. It excludes tools from releases
This commit is contained in:
Sergei Eremenko 2017-09-24 16:36:10 +03:00
parent 873ad7e672
commit edbb590add
2 changed files with 23 additions and 24 deletions

3
.gitattributes vendored Normal file
View file

@ -0,0 +1,3 @@
# exclude the following dirs/files from archives:
.* export-ignore
tools export-ignore

View file

@ -1,37 +1,37 @@
PREFIX ?= /usr PREFIX ?= /usr
IGNORE ?=
THEMES ?= ePapirus Papirus Papirus-Adapta Papirus-Adapta-Nokto Papirus-Dark Papirus-Light
# excludes IGNORE from THEMES list
THEMES := $(filter-out $(IGNORE), $(THEMES))
all: all:
install: install:
mkdir -p $(DESTDIR)$(PREFIX)/share/icons mkdir -p $(DESTDIR)$(PREFIX)/share/icons
cp -R ePapirus Papirus Papirus-Adapta Papirus-Adapta-Nokto Papirus-Light Papirus-Dark \ cp -R $(THEMES) $(DESTDIR)$(PREFIX)/share/icons
$(DESTDIR)$(PREFIX)/share/icons
post-install: # skip building an icon cache when packaging
-gtk-update-icon-cache -q $(DESTDIR)$(PREFIX)/share/icons/ePapirus ifndef DESTDIR
-gtk-update-icon-cache -q $(DESTDIR)$(PREFIX)/share/icons/Papirus $(MAKE) $(THEMES)
-gtk-update-icon-cache -q $(DESTDIR)$(PREFIX)/share/icons/Papirus-Adapta endif
-gtk-update-icon-cache -q $(DESTDIR)$(PREFIX)/share/icons/Papirus-Adapta-Nokto
-gtk-update-icon-cache -q $(DESTDIR)$(PREFIX)/share/icons/Papirus-Dark $(THEMES):
-gtk-update-icon-cache -q $(DESTDIR)$(PREFIX)/share/icons/Papirus-Light -gtk-update-icon-cache -q $(DESTDIR)$(PREFIX)/share/icons/$@
uninstall: uninstall:
-rm -rf $(DESTDIR)$(PREFIX)/share/icons/ePapirus -rm -rf $(foreach theme,$(THEMES),$(DESTDIR)$(PREFIX)/share/icons/$(theme))
-rm -rf $(DESTDIR)$(PREFIX)/share/icons/Papirus
-rm -rf $(DESTDIR)$(PREFIX)/share/icons/Papirus-Adapta
-rm -rf $(DESTDIR)$(PREFIX)/share/icons/Papirus-Adapta-Nokto
-rm -rf $(DESTDIR)$(PREFIX)/share/icons/Papirus-Dark
-rm -rf $(DESTDIR)$(PREFIX)/share/icons/Papirus-Light
_get_version: _get_version:
$(eval VERSION := $(shell git show -s --format=%cd --date=format:%Y%m%d HEAD)) $(eval VERSION := $(shell git show -s --format=%cd --date=format:%Y%m%d HEAD))
@echo $(VERSION) @echo $(VERSION)
push: dist: _get_version
git push origin git archive --format=tar.gz -o $(notdir $(CURDIR))-$(VERSION).tar.gz master -- $(THEMES)
release: _get_version push release: _get_version
git tag -f $(VERSION) git tag -f $(VERSION)
git push origin
git push origin --tags git push origin --tags
undo_release: _get_version undo_release: _get_version
@ -56,11 +56,7 @@ tests:
update_authors: update_authors:
editor Papirus/AUTHORS editor Papirus/AUTHORS
cp -f Papirus/AUTHORS Papirus-Adapta/AUTHORS @echo $(THEMES) | xargs -n 1 cp -vu Papirus/AUTHORS || true
cp -f Papirus/AUTHORS Papirus-Adapta-Nokto/AUTHORS
cp -f Papirus/AUTHORS ePapirus/AUTHORS
cp -f Papirus/AUTHORS Papirus-Dark/AUTHORS
cp -f Papirus/AUTHORS Papirus-Light/AUTHORS
.PHONY: all install uninstall _get_version push release undo_release tests update_authors .PHONY: $(THEMES) all install uninstall _get_version dist release undo_release tests update_authors