summaryrefslogtreecommitdiff
path: root/src/Makefile.am
diff options
context:
space:
mode:
authorrbuj <[email protected]>2019-05-02 12:21:04 +0200
committerraveit65 <[email protected]>2019-05-04 21:11:48 +0200
commitb3605bee34d6b62eb4e5057bbad40513bdc600df (patch)
treeae1e2c3c91b19dca750974667b3d265b88c10557 /src/Makefile.am
parentd97327cd31de7d47054ee4caa299de51d9b4349e (diff)
downloadmate-calc-b3605bee34d6b62eb4e5057bbad40513bdc600df.tar.bz2
mate-calc-b3605bee34d6b62eb4e5057bbad40513bdc600df.tar.xz
Use gresources for UI files
.ui files are combined into a binary resource bundle, and they are marked as compressed, so they will be automatically uncompressed when the resource is used. REF https://developer.gnome.org/gio/stable/GResource.html
Diffstat (limited to 'src/Makefile.am')
-rw-r--r--src/Makefile.am23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index e187118..b6690a1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,13 +4,18 @@ noinst_PROGRAMS = test-mp test-mp-equation
TESTS = test-mp test-mp-equation
AM_CPPFLAGS = \
- -DUI_DIR=\""$(datadir)/mate-calc"\" \
-DVERSION=\""$(VERSION)"\" \
-DLOCALE_DIR=\""$(localedir)"\" \
-DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" \
$(WARN_CFLAGS) \
$(MATE_CALC_CFLAGS)
+BUILT_SOURCES = \
+ mate-calc-resources.c \
+ mate-calc-resources.h
+
+nodist_mate_calc_SOURCES= $(BUILT_SOURCES)
+
mate_calc_SOURCES = \
mate-calc.c \
currency.c \
@@ -151,7 +156,8 @@ test_mp_equation_LDADD = \
CLEANFILES = \
mp-enums.c \
- mp-enums.h
+ mp-enums.h \
+ $(BUILT_SOURCES)
# Generate enum types
mp-enums.h: mp-enums.h.template mp-serializer.h
@@ -164,6 +170,11 @@ mp-enums.c: mp-enums.c.template mp-enums.h mp-serializer.h
math-serializer.c: mp-enums.h
math-equation.c: mp-enums.h
+# Generate resources
+mate-calc-resources.h mate-calc-resources.c: org.mate.calculator.gresource.xml Makefile $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir) $(srcdir)/org.mate.calculator.gresource.xml)
+ $(AM_V_GEN) XMLLINT=$(XMLLINT) $(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir $(srcdir) --generate --c-name calculator $<
+
+
# Install a symlink between mate-calc and mate-calculator
install-exec-hook:
test -e "$(DESTDIR)$(bindir)/mate-calculator" \
@@ -175,8 +186,14 @@ uninstall-local:
&& rm -f "$(DESTDIR)$(bindir)/mate-calculator"
EXTRA_DIST = \
+ buttons-advanced.ui \
+ buttons-basic.ui \
+ buttons-financial.ui \
+ buttons-programming.ui \
mp-enums.c.template \
- mp-enums.h.template
+ mp-enums.h.template \
+ org.mate.calculator.gresource.xml \
+ preferences.ui
DISTCLEANFILES = \
Makefile.in