summaryrefslogtreecommitdiff
path: root/navit/xpm/Makefile.am
diff options
context:
space:
mode:
authorsleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220>2012-03-14 19:06:43 +0000
committersleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220>2012-03-14 19:06:43 +0000
commitf398bd7fbea83cc1862a44e85ebd63eb4275b182 (patch)
tree3976c1028fa147c352999ad28454dcc072c58709 /navit/xpm/Makefile.am
parent440fb9302f5aa121a936db7db78e4ad84ba0c6c2 (diff)
downloadnavit-f398bd7fbea83cc1862a44e85ebd63eb4275b182.tar.gz
Fix:xpm:Correct Makefile to properly regenerate PNGs. Fixes #1016.
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@4977 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/xpm/Makefile.am')
-rw-r--r--navit/xpm/Makefile.am19
1 files changed, 15 insertions, 4 deletions
diff --git a/navit/xpm/Makefile.am b/navit/xpm/Makefile.am
index aff616eb7..b63f955d0 100644
--- a/navit/xpm/Makefile.am
+++ b/navit/xpm/Makefile.am
@@ -212,19 +212,30 @@ if USE_SVG
endif
if USE_SVG2PNG
-%.png: $(srcdir)/*.svgz
- SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir) $(srcdir)/navit_svg2png "@SVG2PNG@" "$@"
-%.png: $(srcdir)/*.svg
- SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir) $(srcdir)/navit_svg2png "@SVG2PNG@" "$@"
+# Implicit rules for generating the PNG files. This only generates the
+# standard size; for additional sizes see below.
+%.png: $(srcdir)/%.svg
+ SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir) $(srcdir)/navit_svg2png "/usr/bin/rsvg-convert" "$@"
+%.png: $(srcdir)/%.svgz
+ SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir) $(srcdir)/navit_svg2png "/usr/bin/rsvg-convert" "$@"
pngs = $(addsuffix .png,$(basename $(svgs)))
xsize = $(word 1,$(subst x, ,$(scale)))
ysize = $(word $(words $(scale)),$(subst x, ,$(scale)))
comma =,
+# template to generate scaling rules for the various PNG sizes
+define scaling_rule_template
+%_$(1)_$(1).png: $(srcdir)/%.$(2)
+ SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir) $(srcdir)/navit_svg2png "/usr/bin/rsvg-convert" "$$@"
+endef
+
# png images of the user interface and other, sizes e.g. "8,16,32,48,96"
if USE_SVG2PNG_SCALES
pngs += $(foreach scale, $(subst $(comma), ,@SVG2PNG_SCALES@), $(addsuffix _$(xsize)_$(ysize).png,$(basename $(svgs))))
+
+# create rules from template
+$(foreach extension,svg svgz, $(foreach size,@SVG2PNG_SCALES@,$(eval $(call scaling_rule_template,$(size),$(extension)))))
endif
# png state flags
if USE_SVG2PNG_SCALES_FLAG