view Makefile.w32 @ 642:c8e5949a8961

Use th-libs functions.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 07 Jan 2015 16:56:54 +0200
parents 904c359b1ced
children 0d7e6b61956c
line wrap: on
line source

#
# For win32 version cross-compilation with MinGW suite @ Linux
#

# C-compiler, flags and linker flags
MINGW_PREFIX=i686-w64-mingw32-
CC=$(MINGW_PREFIX)gcc
AR=$(MINGW_PREFIX)ar
RANLIB=$(MINGW_PREFIX)ranlib
WINDRES=$(MINGW_PREFIX)windres

CFLAGS=-DHAVE_STRING_H -Ipdcurses -mwindows
LDFLAGS= -lws2_32 -lole32 -mwindows pdcurses/libpdcurses.a -lSDL -s

# Miscellaneous
EXEEXT=.exe
OBJPATH=obj/win32/
BINPATH=installer/

EXTRAOBJS= resource.o
ICON=resource.ico

include Makefile.gen

resource.rc: resource.rc.in $(ICON) VERSION
	sed -e "s/@VERSION@/$(NN_VERSION)/g;s/@VERSION_COM@/$(NN_VERSION_COM)/g;s/@ICON@/$(ICON)/g;s#@EXE@#$(notdir $(NNCHAT_BIN))#g" < $< > $@

resource.o: resource.rc
	$(WINDRES) $< -O coff -o $@


DOC=$(BINPATH)/README.html

update-doc:
	@wget -qO- http://www.tnsp.org/~ccr/nnchat/ | tr '\n' '' | sed "s/<.-- BEGIN -->.*<.-- END -->//g" | tr '' '\n' > "$(DOC).new"
	@if diff -u "$(DOC)" "$(DOC).new" > /dev/null; then echo "No differences."; else cp "$(DOC).new" "$(DOC)"; fi

$(DOC): update-doc

upload: $(BINPATH)/nncsetup.msi $(DOC)
	@scp $< ccr@tnsp.org:public_html/nnchat/nncsetup-$(NN_VERSION).msi
	@touch $@