From c93c4efefee0dbf6d193466efd6761d9a1849ae9 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 18 Jun 2014 02:15:04 -0700 Subject: [PATCH] icon: Construct .exe files to hold windows icons for file associations It appears that creating an executable with an icon resource is the only way to display icons for files. Fortunately, that's not all that hard. Signed-off-by: Keith Packard --- Makefile.am | 1 + icon/.gitignore | 1 + icon/Makefile.am | 19 ++++++++++++++++++- icon/altus-metrum.rc | 1 + icon/micro-peak.rc | 1 + icon/telegps.rc | 1 + icon/windows-stub.c | 2 ++ 7 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 icon/altus-metrum.rc create mode 100644 icon/micro-peak.rc create mode 100644 icon/telegps.rc create mode 100644 icon/windows-stub.c diff --git a/Makefile.am b/Makefile.am index 15d2c82d..2f8a5ee1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -18,6 +18,7 @@ fat: cd libaltos && $(MAKE) all cd altoslib && $(MAKE) all cd altosuilib && $(MAKE) all + cd icon && $(MAKE) fat cd altosui && $(MAKE) fat cd micropeak && $(MAKE) fat cd telegps && $(MAKE) fat diff --git a/icon/.gitignore b/icon/.gitignore index e89555de..40cf2f3e 100644 --- a/icon/.gitignore +++ b/icon/.gitignore @@ -4,3 +4,4 @@ telegps-*.png *.ico *.icns *.build +*.exe diff --git a/icon/Makefile.am b/icon/Makefile.am index b1c00f4b..61a16914 100644 --- a/icon/Makefile.am +++ b/icon/Makefile.am @@ -34,7 +34,7 @@ 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 @@ -71,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 diff --git a/icon/altus-metrum.rc b/icon/altus-metrum.rc new file mode 100644 index 00000000..bbd03604 --- /dev/null +++ b/icon/altus-metrum.rc @@ -0,0 +1 @@ +101 ICON "altus-metrum.ico" diff --git a/icon/micro-peak.rc b/icon/micro-peak.rc new file mode 100644 index 00000000..4efe777d --- /dev/null +++ b/icon/micro-peak.rc @@ -0,0 +1 @@ +101 ICON "micro-peak.ico" diff --git a/icon/telegps.rc b/icon/telegps.rc new file mode 100644 index 00000000..7f5957f9 --- /dev/null +++ b/icon/telegps.rc @@ -0,0 +1 @@ +101 ICON "telegps.ico" diff --git a/icon/windows-stub.c b/icon/windows-stub.c new file mode 100644 index 00000000..8df3e0aa --- /dev/null +++ b/icon/windows-stub.c @@ -0,0 +1,2 @@ +__stdcall +WinMain(int a, int b, int c, int d) { return 0; } -- 2.30.2