# HG changeset patch # User Matti Hamalainen # Date 1289959781 -7200 # Node ID 829457be9eea07553f32acba877d52faad231803 # Parent 0751e0fb7ba9a37b2df4620c35c6cf86f7ea31c1 Build system changes to support (in a big kludgy manner) icon and version information resource generation for Win32 binaries. diff -r 0751e0fb7ba9 -r 829457be9eea Makefile.gen --- a/Makefile.gen Wed Nov 17 04:08:51 2010 +0200 +++ b/Makefile.gen Wed Nov 17 04:09:41 2010 +0200 @@ -1,3 +1,5 @@ +NN_VERSION=0.8.3 + #CFLAGS+=-g -W -Wall -O2 -DTH_NO_DEFAULTS CFLAGS+=-g -W -Wall -DTH_NO_DEFAULTS COMP=$(CC) $(CFLAGS) @@ -18,8 +20,8 @@ $(OBJPATH)%.o: %.c %.h $(COMP) -c -o $@ $< -$(NNCHAT_BIN): nnchat.c $(OBJPATH)libnnchat.o $(OBJPATH)th_util.o $(OBJPATH)th_string.o $(OBJPATH)th_args.o $(OBJPATH)th_config.o - $(COMP) -o $@ $+ $(LDFLAGS) +$(NNCHAT_BIN): nnchat.c $(OBJPATH)libnnchat.o $(OBJPATH)th_util.o $(OBJPATH)th_string.o $(OBJPATH)th_args.o $(OBJPATH)th_config.o $(EXTRAOBJS) + $(COMP) -o $@ $+ $(LDFLAGS) -DNN_VERSION=\"$(NN_VERSION)\" # # Special targets diff -r 0751e0fb7ba9 -r 829457be9eea Makefile.w32 --- 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 $@ diff -r 0751e0fb7ba9 -r 829457be9eea nnchat.c --- a/nnchat.c Wed Nov 17 04:08:51 2010 +0200 +++ b/nnchat.c Wed Nov 17 04:09:41 2010 +0200 @@ -894,7 +894,7 @@ memset(histBuf, 0, sizeof(histBuf)); /* Initialize */ - th_init("NNChat", "Newbie Nudes chat client", "0.8.3", + th_init("NNChat", "Newbie Nudes chat client", NN_VERSION, "Written and designed by Anonymous Finnish Guy (C) 2008-2010", "This software is freeware, use and distribute as you wish."); th_verbosityLevel = 0;