icon: Construct .exe files to hold windows icons for file associations
[fw/altos] / icon / Makefile.am
index b36f6f7bbd6f3020a9d4be274a007ffaeb7d1b2c..61a169141d6127cb1eaafa7a56e81dc37903df22 100644 (file)
@@ -1,6 +1,7 @@
+JAVA_RES=16 32 48 64 128 256
 MAC_RES=16 32 128 256 512
 WIN_RES=16 24 32 48 64 72 96 128 180 256
-RES=$(shell echo $(MAC_RES) $(WIN_RES) | awk '{ for (i = 1; i <= NF; i++) printf("%s\n", $$i); }' | sort -n -u)
+RES=$(shell echo $(JAVA_RES) $(MAC_RES) $(WIN_RES) | awk '{ for (i = 1; i <= NF; i++) printf("%s\n", $$i); }' | sort -n -u)
 
 AM_FILES=$(shell for i in $(RES); do echo altus-metrum-$$i.png; done)
 MP_FILES=$(shell for i in $(RES); do echo micropeak-$$i.png; done)
@@ -33,22 +34,22 @@ res:
 all-local: $(ICO_FILES) $(ICNS_FILES)
 
 clean-local:
-       $(RM) altus-metrum-*.png telegps-*.png micropeak-*.png *.build *.ico *.icns
+       $(RM) altus-metrum-*.png telegps-*.png micropeak-*.png *.build *.ico *.icns *.o *.exe
 
 $(AM_FILES): altusmetrum.build
 
 altusmetrum.build: altusmetrum.svg
-       for i in $(RES); do ./make-png altusmetrum.svg $$i altus-metrum-$$i.png; done && touch $@
+       for i in $(RES); do rsvg-convert -w $$i -h $$i -o altus-metrum-$$i.png altusmetrum.svg; done && touch $@
 
 $(TG_FILES): telegps.build
 
 telegps.build: telegps.svg
-       for i in $(RES); do ./make-png telegps.svg $$i telegps-$$i.png; done && touch $@
+       for i in $(RES); do rsvg-convert -w $$i -h $$i -o telegps-$$i.png telegps.svg; done && touch $@
 
 $(MP_FILES): micropeak.build
 
 micropeak.build: micropeak.svg
-       for i in $(RES); do ./make-png micropeak.svg $$i micropeak-$$i.png; done && touch $@
+       for i in $(RES); do rsvg-convert -w $$i -h $$i -o micropeak-$$i.png micropeak.svg; done && touch $@
 
 #clean-local:
 #      $(RM) -f $(ICO_FILES)
@@ -70,3 +71,20 @@ TeleGPS.icns: $(MAC_TG_FILES)
 
 MicroPeak.icns: $(MAC_MP_FILES)
        png2icns $@ $(MAC_MP_FILES)
+
+MINGCC32=i686-w64-mingw32-gcc
+MINGWINDRES=i686-w64-mingw32-windres
+
+SUFFIXES=.rc .exe
+
+fat: all micro-peak.exe altus-metrum.exe telegps.exe
+
+altus-metrum.o: altus-metrum.ico
+micro-peak.o: micro-peak.ico
+telegps.o: telegps.ico
+
+.rc.o:
+       $(MINGWINDRES) $*.rc $@
+
+.o.exe:
+       $(MINGCC32) -o $@ windows-stub.c $*.o