diff Makefile.w32 @ 195:829457be9eea

Build system changes to support (in a big kludgy manner) icon and version information resource generation for Win32 binaries.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 17 Nov 2010 04:09:41 +0200
parents f265e7274a45
children e0ec2280a778
line wrap: on
line diff
--- a/Makefile.w32	Wed Nov 17 04:08:51 2010 +0200
+++ b/Makefile.w32	Wed Nov 17 04:09:41 2010 +0200
@@ -1,9 +1,10 @@
 #
 # For win32 version cross-compilation with MinGW suite @ Linux
 #
+SDL=y
 
 # Set PATH to include MinGW cross compiler path FIRST!
-PATH=/usr/local/i386-mingw32/bin:/usr/bin:/bin
+PATH=/usr/local/i386-mingw32/bin:/usr/bin:/bin:/usr/local/bin
 
 # C-compiler, flags and linker flags
 CC=gcc
@@ -25,8 +26,18 @@
 BINPATH=./win32/
 #BINPATH=/misc/wine_c/
 NONBUILD=$(OBJPATH)
+EXTRAOBJS= resource.o
+ICON=resource.ico
 
 include Makefile.gen
 
 $(OBJPATH):
 	mkdir $@
+
+comma:= ,
+
+resource.rc: resource.rc.in $(ICON)
+	sed -e "s/@VERSION@/$(NN_VERSION)/g;s/@VERSION_COM@/$(subst .,$(comma),$(NN_VERSION))/g;s/@ICON@/$(ICON)/g;s#@EXE@#$(notdir $(NNCHAT_BIN))#g" < $< > $@
+
+resource.o: resource.rc
+	i386-mingw32-windres $< -O coff -o $@