Smake: Break svg2png out as separate script.
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 16 Nov 2013 17:47:20 +0000 (09:47 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 16 Nov 2013 17:47:20 +0000 (09:47 -0800)
This makes the output of "make -f Smake" shorter and easier to read.

Makefile.am
Smake
build-aux/automake.mk [new file with mode: 0644]
build-aux/svg2png [new file with mode: 0755]

index 48ec5073668fc7681f803ff0ae9a686d82c02e56..a5a7d5c79e94bb789c5f0a3156da65978931648c 100644 (file)
@@ -59,6 +59,7 @@ generate-changelog:
 DIST_HOOKS += generate-changelog
 
 
+include $(top_srcdir)/build-aux/automake.mk
 include $(top_srcdir)/po/automake.mk
 include $(top_srcdir)/lib/automake.mk
 include $(top_srcdir)/doc/automake.mk
diff --git a/Smake b/Smake
index 3d06270160f32a64df62e79093f939f79d6c91e9..e976e46379d1af3a535f7c0fc2515b3f90bb979e 100644 (file)
--- a/Smake
+++ b/Smake
@@ -440,12 +440,9 @@ clean:
 
 #svg2png=convert -background transparent $1 $3
 
-svg2png=gimp -i -b '(let* ((image  (car  (gimp-file-load 1  "$1"  "$1"))))  (gimp-image-attach-parasite image (list "gimp-comment" 0 "$(shell cat $2)"))  (gimp-file-save 1 image (car  (gimp-image-get-active-drawable image)) "$3" "$3")) (gimp-quit 1)'
-
-
-src/ui/gui/icons/%.png: src/ui/gui/artwork/%.svg src/ui/gui/icons/COPYING_CCBYSA3
+src/ui/gui/icons/%.png: src/ui/gui/artwork/%.svg build-aux/svg2png src/ui/gui/icons/COPYING_CCBYSA3
        mkdir -p $(dir $@)
-       $(call svg2png,$<,$(lastword $^),$@)
+       build-aux/svg2png "$<" "$(lastword $^)" "$@"
 
 
 src/ui/gui/icons/%.svg: src/ui/gui/artwork/%.svg
diff --git a/build-aux/automake.mk b/build-aux/automake.mk
new file mode 100644 (file)
index 0000000..0641088
--- /dev/null
@@ -0,0 +1,3 @@
+## Process this file with automake to produce Makefile.in  -*- makefile -*-
+
+EXTRA_DIST += build-aux/svg2png
diff --git a/build-aux/svg2png b/build-aux/svg2png
new file mode 100755 (executable)
index 0000000..5c41840
--- /dev/null
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+comment=`cat $2`
+gimp -i -b "\
+(let* ((image (car (gimp-file-load 1 \"$1\" \"$1\"))))
+      (gimp-image-attach-parasite image (list \"gimp-comment\" 0 \"$comment\"))
+      (gimp-file-save 1 image (car (gimp-image-get-active-drawable image))
+                     \"$3\" \"$3\"))
+    (gimp-quit 1)"