Icon for Unequal.
[sgt/puzzles] / icons / Makefile
index 934b792..5953a1b 100644 (file)
@@ -2,7 +2,7 @@
 
 PUZZLES = blackbox bridges cube dominosa fifteen flip guess inertia lightup \
           loopy map mines net netslide pattern pegs rect samegame sixteen \
-          slant solo tents twiddle untangle
+          slant solo tents twiddle unequal untangle
 
 BASE = $(patsubst %,%-base.png,$(PUZZLES))
 WEB = $(patsubst %,%-web.png,$(PUZZLES))
@@ -19,6 +19,8 @@ P16D24 = $(patsubst %,%-16d24.png,$(PUZZLES))
 P16D8 = $(patsubst %,%-16d8.png,$(PUZZLES))
 P16D4 = $(patsubst %,%-16d4.png,$(PUZZLES))
 ICONS = $(patsubst %,%.ico,$(PUZZLES))
+CICONS = $(patsubst %,%-icon.c,$(PUZZLES))
+RC = $(patsubst %,%.rc,$(PUZZLES))
 
 BIN = ../
 PIC = ./
@@ -26,7 +28,9 @@ PIC = ./
 base: $(BASE)
 web: $(WEB)
 pngicons: $(P48D24) $(P32D24) $(P16D24)
-icons: $(ICONS)
+winicons: $(ICONS) $(RC)
+gtkicons: $(CICONS)
+all: base web pngicons winicons gtkicons
 
 # Build the base puzzle screenshots from which all the other images
 # are derived. Some of them involve showing a move animation
@@ -67,6 +71,7 @@ slant-ibase.png : override CROP=321x321 160x160+160+160
 solo-ibase.png : override CROP=321x321 97x97+16+16
 tents-ibase.png : override CROP=320x320 165x165+142+0
 twiddle-ibase.png : override CROP=192x192 102x102+69+21
+unequal-ibase.png : override CROP=208x208 104x104+104+104
 untangle-ibase.png : override CROP=320x320 164x164+3+116
 $(IBASE): %-ibase.png: %-base.png
        $(PIC)crop.sh $^ $@ $(CROP)
@@ -108,12 +113,22 @@ $(P16D4): %-16d4.png: %-ibase.png
        convert -colors 16 -map $(PIC)win16pal.xpm tmp2.png $@
        rm -f tmp.png tmp2.png
 
-# And build the actual icons themselves, by feeding all those PNGs
-# to my icon builder script.
+# Build the actual Windows icons themselves, by feeding all those
+# PNGs to my icon builder script.
 $(ICONS): %.ico: %-48d24.png %-48d8.png %-48d4.png \
                  %-32d24.png %-32d8.png %-32d4.png \
                  %-16d24.png %-16d8.png %-16d4.png
-       $(PIC)icon.pl $? > $@
+       $(PIC)icon.pl -24 $*-48d24.png $*-32d24.png $*-16d24.png \
+                     -8  $*-48d8.png  $*-32d8.png  $*-16d8.png  \
+                     -4  $*-48d4.png  $*-32d4.png  $*-16d4.png  > $@
+
+# Build the .RC files which bind the icons into the applications.
+$(RC): %.rc:
+       echo '200 ICON "$*.ico"' > $@
+
+# Build the GTK icon source files.
+$(CICONS): %-icon.c: %-16d24.png %-32d24.png %-48d24.png
+       $(PIC)cicon.pl $^ > $@  
 
 clean:
-       rm -f *.png *.ico
+       rm -f *.png *.ico *.rc *-icon.c