From 451d077170c76fb2946fead69efb6dfddd892193 Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Thu, 27 Sep 2012 00:33:33 +0100 Subject: [PATCH] cygwin target added --- Makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c637b87b..71783091 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ PROG= mongoose all: - @echo "make (linux|bsd|solaris|mac|windows|mingw)" + @echo "make (linux|bsd|solaris|mac|windows|mingw|cygwin)" # Possible COPT values: (in brackets are rough numbers for 'gcc -O2' on i386) # -DHAVE_MD5 - use system md5 library (-2kb) @@ -144,6 +144,16 @@ mingw: $(CC) $(MINGWOPT) -Iwin32 mongoose.c main.c win32\res.o -lws2_32 -ladvapi32 \ -o $(PROG).exe +# Build for Windows under Cygwin +#CYGWINDBG= -DDEBUG -O0 -ggdb +CYGWINDBG= -DNDEBUG -Os +CYGWINOPT= -W -Wall -mthreads -Wl,--subsystem,console $(CYGWINDBG) -DHAVE_STDINT $(GCC_WARNINGS) $(COPT) +cygwin: + windres ./win32/res.rc ./win32/res.o + $(CC) $(CYGWINOPT) mongoose.c -lws2_32 \ + -shared -Wl,--out-implib=$(PROG).lib -o $(PROG).dll + $(CC) $(CYGWINOPT) -Iwin32 mongoose.c main.c ./win32/res.o -lws2_32 \ + -ladvapi32 -o $(PROG).exe ########################################################################## ### Manuals, cleanup, test, release @@ -163,4 +173,4 @@ release: clean F=mongoose-`perl -lne '/define\s+MONGOOSE_VERSION\s+"(\S+)"/ and print $$1' mongoose.c`.tgz ; cd .. && tar -czf x mongoose/{LICENSE,Makefile,bindings,examples,test,win32,mongoose.c,mongoose.h,mongoose.1,main.c} && mv x mongoose/$$F clean: - rm -rf *.o *.core $(PROG) *.obj *.so $(PROG).txt *.dSYM *.tgz $(PROG).exe *.dll *.lib \ No newline at end of file + rm -rf *.o *.core $(PROG) *.obj *.so $(PROG).txt *.dSYM *.tgz $(PROG).exe *.dll *.lib win32/res.o