summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-08-13 19:18:39 -0600
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-08-13 20:29:38 -0600
commit98cdaf9076a67a7d1262a15c4acb1e92ead7c18d (patch)
tree07fe1b1ed0f352a9054b609767de38d857de7ff1
parent90f2163dc1000e1098ba2c79008dd6f7bf236c7b (diff)
Clean up Makefiles
-rw-r--r--Makefile28
1 files changed, 18 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 426800d..61b54ec 100644
--- a/Makefile
+++ b/Makefile
@@ -1,20 +1,28 @@
-# SVG2PNG: Each is buggy in their own way
-# ImageMagick: doesn't support transparency
-#SVG2PNG = convert $1 -format png $2
-# librsvg: doesn't support <style> element
-#SVG2PNG = rsvg-convert $1 -o $2
-# Inkscape: doesn't do text hinting (feature?), messes up gradients
-SVG2PNG = inkscape $1 --export-png $2
+## SVG2PNG: Each is buggy in their own way
+## Usage: $(call SVG2PNG,infile,outfile[,width,height,background-color])
+##
+## ImageMagick: doesn't support transparency
+#SVG2PNG = convert $1 -format png $(if $3,-resize $3x)$(if $4,$4) $(if $5,-background '$5') $2
+## librsvg: doesn't support <style> element, hints small text poorly
+#SVG2PNG = rsvg-convert $1 -o $2 $(if $3,-w $3) $(if $4,-h $4) $(if $5,--background-color=$5)
+## Inkscape: messes up gradients
+SVG2PNG = DISPLAY= inkscape -z $1 --export-png $2 $(if $3,-w $3) $(if $4,-h $4) $(if $5,-b '$5')
+
+#PNGCRUSH = cp $1 $2
+PNGCRUSH = pngcrush $1 $2
all: \
logotype-color-darkbg.png \
logotype-color-lightbg.png \
logotype-grayscale.png \
logotype-mono-black.png \
- logotype-mono-white.png \
+ logotype-mono-white.png
clean:
- rm -f *.png
+ rm -f -- *.png
-%.png: %.svg
+%.raw.png: %.svg Makefile
$(call SVG2PNG,$<,$@)
+
+%.png: %.raw.png Makefile
+ $(call PNGCRUSH,$<,$@)