File: Makefile.am

package info (click to toggle)
ldh-gui-suite 0.1~20190927-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 360 kB
  • sloc: makefile: 77; sh: 62; perl: 49
file content (88 lines) | stat: -rw-r--r-- 3,034 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# -*- mode: makefile; coding: utf-8 -*-
# Copyright 2019, Jonas Smedegaard <dr@jones.dk>
# Copyright 2019, Purism, SPC
#
# This Makefile.am is free software;
# you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License
# as published by the Free Software Foundation;
# either version 3, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy
# of the GNU Affero General Public License
# along with this program.
# If not, see <http://www.gnu.org/licenses/>.

APPSTEMS = one.liberty.hub one.liberty.social

if HAVE_DOMAIN
desktopdir = $(datadir)/applications
nodist_desktop_DATA = $(patsubst %,data/%.desktop,$(APPSTEMS))
else
templatedir = $(datadir)/$(PACKAGE_TARNAME)
dist_template_DATA = $(patsubst %,templates/%.desktop.in,$(APPSTEMS))
endif

iconsdir = $(datadir)/icons
# TODO: use some icon size best practice (not just mimick Adwaita theme)
ICONSIZES_regular = 16 22 24 32 48 128 256 512
ICONSIZES_symbolic = 16 24 32 48 64 96
nobase_icons_DATA = $(foreach a,$(APPSTEMS),\
 $(foreach t,regular symbolic,\
  $(eval x = $(if $(filter symbolic,$t),-symbolic)) \
  hicolor/scalable/$a$x.svg \
  $(foreach s,$(ICONSIZES_$t),\
   hicolor/$sx$s/$a$x$(x:-%=.%).png)))
EXTRA_DIST = $(foreach a,$(APPSTEMS),icons/$a.svg icons-symbolic/$a-symbolic.svg)
CLEANFILES = $(nobase_icons_DATA)

define TYPE_template
$(eval x = $(if $(filter symbolic,$1),-symbolic))
hicolor/scalable/%$x.svg: $(srcdir)/icons$x/%$x.svg
	$(AM_V_GEN)
	$(AM_V_at)$(MKDIR_P) $$(dir $$@)
	$(AM_V_at)$(SCOUR) --create-groups --no-renderer-workaround \
		--strip-xml-prolog --remove-descriptive-elements \
		--enable-viewboxing --nindent=0 --enable-id-stripping \
		--shorten-ids -i $$< -o $$@
endef
$(foreach t,regular symbolic,\
 $(eval $(call TYPE_template,$t)))

define TYPE_SIZE_template
$(eval x = $(if $(filter symbolic,$1),-symbolic))
hicolor/$2x$2/%$x$(x:-%=.%).png: $(srcdir)/icons$x/%$x.svg
	$$(AM_V_GEN)
	$$(AM_V_at)$(MKDIR_P) $$(dir $$@)
	$$(AM_V_at)$(RSVG_CONVERT) --width $2 --height $2 --output $$@ $$<
endef
$(foreach t,regular symbolic,\
 $(foreach s,$(ICONSIZES_$t),\
  $(eval $(call TYPE_SIZE_template,$t,$s))))

install-data-hook: update-icon-cache
uninstall-hook: update-icon-cache
update-icon-cache:
	@-if test -z "$(DESTDIR)"; then \
		echo "Updating GTK icon cache."; \
		$(GTK_UPDATE_ICON_CACHE) -f -t $(iconsdir); \
	else \
		echo "*** Icon cache not updated. After (un)install, run this:"; \
		echo "*** $(GTK_UPDATE_ICON_CACHE) -f -t $(iconsdir)"; \
	fi

@GENERATE_CHANGELOG_RULES@
dist-hook: dist-ChangeLog

distclean-local:
	rmdir --ignore-fail-on-non-empty data

.PHONY: realclean
realclean: distclean
	rm -f $(addprefix $(top_srcdir)/,Makefile.in aclocal.m4 configure)
	rm -rf $(addprefix $(top_srcdir)/,autom4te.cache build-config)