# ********************************************************************** # # Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. # # ********************************************************************** # # This file is included by Make.rules when building with MinGW. # # # Default compiler is c++ (aka g++). # CXX = c++ # ICE_WIN32_WINNT sets the minimum version of Windows supported by this build # 0x600 = Windows Vista / Windows Server 2008 # 0x601 = Windows 7 / Windows Server 2008 R2 # 0x602 = Windows 8 / Windows Server 2012 ICE_WIN32_WINNT := 0x601 CXXFLAGS = $(CXXARCHFLAGS) -mthreads -Wall -Werror -D_WIN32_WINNT=$(ICE_WIN32_WINNT) -DWIN32_LEAN_AND_MEAN LDFLAGS = -Wl,-no-undefined ifeq ($(STATICLIBS),yes) CXXFLAGS += -DICE_STATIC_LIBS LDFLAGS += -static-libgcc -static-libstdc++ endif ifeq ($(OPTIMIZE),yes) CXXFLAGS += -O2 -DNDEBUG else CXXFLAGS += -g -D_DEBUG endif COMPSUFFIX = _mingw mklibfilename = $(shell echo $(1) | tr A-Z a-z)$(SOVERSION)$(COMPSUFFIX).dll ifeq ($(STATICLIBS),yes) mklibtargets = $(3) else mklibtargets = $(1) endif mkshlib = $(CXX) -shared $(LDFLAGS) -o $(1) $(3) \ $(subst cpp/lib,cpp/bin, \ $(subst -lIce,-lice$(SOVERSION)$(COMPSUFFIX), \ $(subst -lIceUtil,-liceutil$(SOVERSION)$(COMPSUFFIX), \ $(subst -lSlice,-lslice$(SOVERSION)$(COMPSUFFIX), \ $(subst -lIceSSL,-licessl$(SOVERSION)$(COMPSUFFIX), \ $(subst -lIceDiscovery,-licediscovery$(SOVERSION)$(COMPSUFFIX),$(4))))))) mklib = ar cr $(1) $(2) ifeq ($(LP64),yes) libsubdir := bin$(lp64suffix) binsubdir := bin$(lp64suffix) else libsubdir := bin binsubdir := bin endif ifneq ($(LP64),yes) PLATFORM = Win32 else PLATFORM = x64 endif PLATFORMTOOLSET = mingw4.7.2 PKG_DIR = $(top_srcdir)/third-party-packages BZIP2_VERSION = 1.0.6.1 BZIP2_HOME = $(PKG_DIR)/bzip2.$(PLATFORMTOOLSET) BZIP2_FLAGS = -I$(BZIP2_HOME)/build/native/include BZIP2_LIBS = -L$(BZIP2_HOME)/build/native/bin/$(PLATFORM) -lbzip2$(COMPSUFFIX) BZIP2_NUPKG = $(BZIP2_HOME)/bzip2.$(PLATFORMTOOLSET).nupkg MCPP_VERSION = 2.7.2.8 MCPP_HOME = $(PKG_DIR)/mcpp.$(PLATFORMTOOLSET) MCPP_LIBS = -L$(MCPP_HOME)/build/native/lib/$(PLATFORM) -lmcpp MCPP_NUPKG = $(MCPP_HOME)/mcpp.$(PLATFORMTOOLSET).nupkg NUGET = $(subst \,/,$(LOCALAPPDATA)/ZeroC/nuget/nuget.exe) $(NUGET): @mkdir -p "$(LOCALAPPDATA)\ZeroC\nuget" powershell -Command "(New-Object Net.WebClient).DownloadFile('http://nuget.org/nuget.exe', '$(NUGET)')" $(BZIP2_NUPKG): $(NUGET) @mkdir -p "$(PKG_DIR)" @rm -rf "$(PKG_DIR)\bzip2.$(PLATFORMTOOLSET)" $(NUGET) install bzip2.$(PLATFORMTOOLSET) -OutputDirectory "$(PKG_DIR)" -ExcludeVersion $(MCPP_NUPKG): $(NUGET) @mkdir -p "$(PKG_DIR)" @rm -rf "$(PKG_DIR)\mcpp.$(PLATFORMTOOLSET)" $(NUGET) install mcpp.$(PLATFORMTOOLSET) -OutputDirectory "$(PKG_DIR)" -ExcludeVersion libdir := $(top_srcdir)/$(libsubdir) bindir := $(top_srcdir)/$(binsubdir) installlib = $(INSTALL) $(2)/$(3) $(1); \ chmod a+rx $(1)/$(3) installprogram = $(INSTALL_PROGRAM) $(1) $(2); \ chmod a+rx $(2)/$(notdir $(1)) SSL_OS_LIBS = -lsecur32 -lcrypt32 -lws2_32 ifeq ($(STATICLIBS),yes) BASELIBS = -liceutil $(ICEUTIL_OS_LIBS) LIBS = -lice $(BASELIBS) ICESSL_LIBS = -licessl SLICE_LIBS = -lslice $(BASELIBS) else BASELIBS = -liceutil$(SOVERSION)$(COMPSUFFIX) $(ICEUTIL_OS_LIBS) LIBS = -lice$(SOVERSION)$(COMPSUFFIX) $(BASELIBS) ICESSL_LIBS = -licessl$(SOVERSION)$(COMPSUFFIX) SLICE_LIBS = -lslice$(SOVERSION)$(COMPSUFFIX) $(BASELIBS) endif ICEUTIL_OS_LIBS = -lrpcrt4 -ladvapi32 -lshlwapi ICE_OS_LIBS = $(ICEUTIL_OS_LIBS) -lIphlpapi -lws2_32 EXE_EXT = .exe