chiark / gitweb /
Move images.h to images/ directory, and limit to just the images that
[disorder] / images / Makefile.am
index 22322edcabc2bfa38cbd4f91c82d65ccf48f277e..36a6ad5cd6047f5756ddb4758ed7f4be2dc44f75 100644 (file)
@@ -1,6 +1,6 @@
 #
 # This file is part of DisOrder.
-# Copyright (C) 2005-2009 Richard Kettlewell
+# Copyright (C) 2005-2010 Richard Kettlewell
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -30,4 +30,26 @@ randomdisabled32.png randomenabled32.png rtpdisabled32.png           \
 rtpenabled32.png duck55.png cards24.png cards48.png                    \
 cards-simple-fanned.svg cards-thin.svg
 
-CLEANFILES=$(SEDFILES)
+DISOBEDIENCE_IMAGES=up.png down.png cards24.png logo256.png duck.png   \
+propagate.png
+
+if GTK
+noinst_HEADERS=images.h
+
+images.h: $(DISOBEDIENCE_IMAGES)
+       set -e;                                                         \
+       exec > @$.new;                                                  \
+       for png in $^; do                                               \
+         name=`echo $$png | $(GNUSED) 's,.*/,,;s,\.png,,;'`;           \
+         gdk-pixbuf-csource --raw --name=image_$$name $$png;           \
+       done;                                                           \
+       echo "static const struct image images[] = {";                  \
+       for png in `echo $^`; do                                        \
+         name=`echo $$png | $(GNUSED) 's,.*/,,;s,\.png,,;'`;           \
+         echo "  { \"$$name.png\", image_$$name },";                   \
+       done|sort;                                                      \
+       echo "};"
+       mv @$.new $@
+endif
+
+CLEANFILES=$(SEDFILES) images.h