diff options
Diffstat (limited to 'Makefile.mingw32')
-rw-r--r-- | Makefile.mingw32 | 76 |
1 files changed, 64 insertions, 12 deletions
diff --git a/Makefile.mingw32 b/Makefile.mingw32 index 0c234fd..92f0f83 100644 --- a/Makefile.mingw32 +++ b/Makefile.mingw32 @@ -5,11 +5,18 @@ CXX = i386-mingw32-g++ LD = i386-mingw32-g++ STRIP = i386-mingw32-strip else +ifeq ($(SYSTEM),MINGW32_NT-5.1) +CC = gcc +CXX = g++ +LD = g++ +STRIP = strip +else CC = i586-mingw32msvc-gcc CXX = i586-mingw32msvc-g++ LD = i586-mingw32msvc-g++ STRIP = i586-mingw32msvc-strip endif +endif INCLUDES = \ -I../mogltk/include \ @@ -19,14 +26,18 @@ INCLUDES = \ -I../Baltisot/MSVC/iconv -I../Baltisot/MSVC/regex -I../Baltisot/MSVC \ -I../Mesa-7.0.3-mingw32/include \ -I../pthreads-w32-2-8-0-release/ \ --I../gnuwin32/include +-I../gnuwin32/include \ +-I../tinyxml \ HAVES = -DHAVE_VSSCANF -DHAVE_LIBJPEG -DHAVE_MALLOC_H -DHAVE_BYTESWAP_H -DHAVE_UCL -CPPFLAGS += $(INCLUDES) -g -fexceptions -DLUATASK_OMIT_COMMAND -DSTDC_HEADERS -DLIBICONV_PLUG -DREADLINE_STATIC -fexceptions -DWORDS_LITTLEENDIAN -march=i686 $(HAVES) -DUSE_MPQLIB +CPPFLAGS += $(INCLUDES) -g -fexceptions -DLUATASK_OMIT_COMMAND -DSTDC_HEADERS -DLIBICONV_PLUG -DREADLINE_STATIC -fexceptions -DWORDS_LITTLEENDIAN -march=i686 $(HAVES) -DUSE_MPQLIB -DFROM_LUAINTERFACE + +LDFLAGS_BASIC += -g -fexceptions -LDFLAGS += -L../gnuwin32/lib -g -fexceptions -Wl,--enable-auto-image-base -Wl,--export-dynamic --export-all-symbols -Wl,--enable-auto-import -fexceptions \ - ../libreadline-static.a -lz.dll -lucl.dll -lwsock32 -lws2_32 ../pthreads-w32-2-8-0-release/libpthreadGC2.a --enable-stdcall-fixup +LDFLAGS += $(LDFLAGS_BASIC) -Wl,--enable-auto-image-base -Wl,--export-dynamic --export-all-symbols -Wl,--enable-auto-import -fexceptions --enable-stdcall-fixup + +LIBS += -L../gnuwin32/lib ../libreadline-static.a -lz.dll -lucl.dll -lwsock32 -lws2_32 ../pthreads-w32-2-8-0-release/libpthreadGC2.a vpath %.c ../Baltisot/lib:../Baltisot/src:../Baltisot/lib/zlib/src:../Baltisot/lib/lua/src:../Baltisot/lib/lua/src/LuaLib:src:../paperIdol/src:../mogltk/lib:../tinyxml:../lua-modules/src:../Baltisot/MSVC/iconv:../Baltisot/MSVC/regex vpath %.cc ../Baltisot/lib:../Baltisot/src:../Baltisot/lib/zlib/src:../Baltisot/lib/lua/src:../Baltisot/lib/lua/src/LuaLib:src:../paperIdol/src:../mogltk/lib:../tinyxml:../lua-modules/src:../Baltisot/MSVC/iconv:../Baltisot/MSVC/regex @@ -38,10 +49,11 @@ lua-interface-main.c \ LUAINTERFACE_LDFLAGS = -Wl,--whole-archive ../Mesa-7.0.3-mingw32/lib/libGLU.a ../Mesa-7.0.3-mingw32/lib/libOSMesa.a -Wl,--no-whole-archive -BALTISOT_SOURCES = \ +LUAINTERFACE_MAIN_SOURCES = \ lua-interface.cc \ lua-plugin.cc \ -\ + +BALTISOT_SOURCES = \ Main.cc \ \ RandISAAC.cc \ @@ -162,11 +174,41 @@ generic.cc \ checkargs.c \ datecalc.c \ +LUAINTERFACE_LIGHT_SOURCES = \ +plugin-luaconfigfiles.cc \ +plugin-luahandle.cc \ +plugin-luahttp.cc \ +plugin-lualibs.cc \ +plugin-luarand.cc \ +plugin-luaregex.cc \ +plugin-luasmtp.cc \ +plugin-luatask.cc \ +plugin-luaxml.cc \ +LuaConfigFile.cc \ +tinystr.cpp \ +tinyxml.cpp \ +tinyxmlerror.cpp \ +tinyxmlparser.cpp \ +LuaXML.cc \ +LuaHttp.cc \ +LuaRegex.cc \ +loadlualibs.cc \ +supportlib.lua \ +tasklib.lua \ +ajaxlib.lua \ +htmllib.lua \ +xmllib.lua \ +httplib.lua \ +dblib.lua \ +LuaSmtp.cc \ +lua-plugin.cc \ WHOLE_SOURCES = $(BALTISOT_SOURCES) $(LUA_SOURCES) $(LUAINTERFACE_SOURCES) LUAINTERFACE_OBJECTS = $(addsuffix .o, $(notdir $(basename $(LUAINTERFACE_SOURCES)))) -LUAINTERFACE_DLL_OBJECTS = $(addsuffix .o, $(notdir $(basename $(BALTISOT_SOURCES) $(LUA_SOURCES)))) +LUAINTERFACE_MAIN_OBJECTS = $(addsuffix .o, $(notdir $(basename $(LUAINTERFACE_MAIN_SOURCES) $(LUA_SOURCES)))) +LUAINTERFACE_DLL_OBJECTS = $(addsuffix .o, $(notdir $(basename $(BALTISOT_SOURCES)))) +LUAINTERFACE_LIGHT_OBJECTS = lua-interface-light.o $(addsuffix .o, $(notdir $(basename $(LUAINTERFACE_LIGHT_SOURCES)))) LUAC_OBJECTS = $(addsuffix .o, $(notdir $(basename $(LUAC_SOURCES) $(LUA_SOURCES)))) ALL_OBJECTS = $(addsuffix .o, $(notdir $(basename $(WHOLE_SOURCES)))) @@ -177,16 +219,26 @@ all: dep luac.exe lua-interface.dll lua-interface.exe dep: $(ALL_DEPS) luac.exe: $(LUAC_OBJECTS) - $(LD) -o luac.exe $(LUAC_OBJECTS) $(LDFLAGS) + $(LD) -o luac.exe $(LUAC_OBJECTS) $(LDFLAGS) $(LIBS) -lua-interface.dll: $(LUAINTERFACE_DLL_OBJECTS) - $(LD) -shared -Wl,--output-def=lua-interface.def -Wl,--out-implib=lua-interface.a -o lua-interface.dll $(LUAINTERFACE_DLL_OBJECTS) $(LDFLAGS) $(LUAINTERFACE_LDFLAGS) +lua-interface.dll: $(LUAINTERFACE_DLL_OBJECTS) $(LUAINTERFACE_MAIN_OBJECTS) + $(LD) -shared -Wl,--output-def=lua-interface.def -Wl,--out-implib=lua-interface.a -o lua-interface.dll $(LUAINTERFACE_DLL_OBJECTS) $(LUAINTERFACE_MAIN_OBJECTS) $(LDFLAGS) $(LUAINTERFACE_LDFLAGS) $(LIBS) lua-interface.exe: $(LUAINTERFACE_OBJECTS) - $(LD) -o lua-interface.exe $(LUAINTERFACE_OBJECTS) ./lua-interface.a $(LDFLAGS) + $(LD) -o lua-interface.exe $(LUAINTERFACE_OBJECTS) ./lua-interface.a $(LDFLAGS) $(LIBS) + +lua-interface-light.exe: lua-interface-light.dll $(LUAINTERFACE_OBJECTS) + $(LD) -o lua-interface-light.exe $(LUAINTERFACE_OBJECTS) ./lua-interface.a $(LDFLAGS) $(LIBS) + +lua-interface-light.dll: $(LUAINTERFACE_DLL_OBJECTS) $(LUAINTERFACE_LIGHT_OBJECTS) + $(LD) -shared -Wl,--output-def=lua-interface.def -Wl,--out-implib=lua-interface.a -o lua-interface.dll $(LUAINTERFACE_DLL_OBJECTS) $(LUAINTERFACE_LIGHT_OBJECTS) $(LIBS) $(LDFLAGS) + touch lua-interface-light.dll + +lua-interface-light.o: lua-interface.cpp + $(CC) $(CPPFLAGS) -c -o lua-interface-light.o src/lua-interface.cpp -DLUA_INTERFACE_LIGHT clean: - rm -f lua-interface.dll lua-interface.exe luac.exe *.o *.dep *.a *.def + rm -f lua-interface.dll lua-interface.exe lua-interface-light.exe luac.exe *.o *.dep *.a *.def %.dep : %.c $(CC) $(CPPFLAGS) -M -MF $@ $< |