From edbb590addd77173f4e650e3c11f48fc7ad1c7a9 Mon Sep 17 00:00:00 2001 From: Sergei Eremenko Date: Sun, 24 Sep 2017 16:36:10 +0300 Subject: [PATCH] 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 --- .gitattributes | 3 +++ Makefile | 44 ++++++++++++++++++++------------------------ 2 files changed, 23 insertions(+), 24 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..cb32fb2d4b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +# exclude the following dirs/files from archives: +.* export-ignore +tools export-ignore diff --git a/Makefile b/Makefile index 6bf0506e78..ae4b899525 100644 --- a/Makefile +++ b/Makefile @@ -1,37 +1,37 @@ 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: install: mkdir -p $(DESTDIR)$(PREFIX)/share/icons - cp -R ePapirus Papirus Papirus-Adapta Papirus-Adapta-Nokto Papirus-Light Papirus-Dark \ - $(DESTDIR)$(PREFIX)/share/icons + cp -R $(THEMES) $(DESTDIR)$(PREFIX)/share/icons -post-install: - -gtk-update-icon-cache -q $(DESTDIR)$(PREFIX)/share/icons/ePapirus - -gtk-update-icon-cache -q $(DESTDIR)$(PREFIX)/share/icons/Papirus - -gtk-update-icon-cache -q $(DESTDIR)$(PREFIX)/share/icons/Papirus-Adapta - -gtk-update-icon-cache -q $(DESTDIR)$(PREFIX)/share/icons/Papirus-Adapta-Nokto - -gtk-update-icon-cache -q $(DESTDIR)$(PREFIX)/share/icons/Papirus-Dark - -gtk-update-icon-cache -q $(DESTDIR)$(PREFIX)/share/icons/Papirus-Light +# skip building an icon cache when packaging +ifndef DESTDIR + $(MAKE) $(THEMES) +endif + +$(THEMES): + -gtk-update-icon-cache -q $(DESTDIR)$(PREFIX)/share/icons/$@ uninstall: - -rm -rf $(DESTDIR)$(PREFIX)/share/icons/ePapirus - -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 + -rm -rf $(foreach theme,$(THEMES),$(DESTDIR)$(PREFIX)/share/icons/$(theme)) _get_version: $(eval VERSION := $(shell git show -s --format=%cd --date=format:%Y%m%d HEAD)) @echo $(VERSION) -push: - git push origin +dist: _get_version + 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 push origin git push origin --tags undo_release: _get_version @@ -56,11 +56,7 @@ tests: update_authors: editor Papirus/AUTHORS - cp -f Papirus/AUTHORS Papirus-Adapta/AUTHORS - 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 + @echo $(THEMES) | xargs -n 1 cp -vu Papirus/AUTHORS || true -.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