diff --git a/builds/posix/Makefile.in b/builds/posix/Makefile.in
index f5342bb..48f4a7b 100644
--- a/builds/posix/Makefile.in
+++ b/builds/posix/Makefile.in
@@ -246,7 +246,11 @@ endif
 %.vers: $(ROOT)/builds/posix/%.vers
 	sh vers.sh $(firstword $@)
 
+ifeq ($(PLATFORM),win32)
+export_lists:
+else
 export_lists: $(ALLVERS)
+endif
 
 #___________________________________________________________________________
 # LibTomMath - used by cross-builds
@@ -305,7 +309,7 @@ $(RE2_LIB):	$(RE2_Objs)
 libcds:
 	mkdir -p $(LIBCDS)/lib/$(TARGET)
 	cd $(LIBCDS)/lib/$(TARGET); \
-	cmake -DCMAKE_BUILD_TYPE=$(FB_CMAKE_BUILD_TYPE) -DCMAKE_CXX_COMPILER="$(CXX)" -DCMAKE_CXX_FLAGS=-fPIC $(LIBCDS)
+	cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=$(FB_CMAKE_BUILD_TYPE) -DCMAKE_CXX_COMPILER="$(CXX)" -DCMAKE_CXX_FLAGS=-fPIC $(LIBCDS)
 	AR="$(AR)" $(MAKE) -C $(LIBCDS)/lib/$(TARGET)
 
 ifeq ($(TARGET),Debug)
@@ -537,14 +541,18 @@ $(LIBIBUTIL_SO): $(UTIL_Objects)
 # most of utilities, including network server and UDF support
 #
 
-.PHONY:	firebird_server fb_lock_print fbguard fbsvcmgr fbtracemgr gbak gfix gsec gsplit gstat isql nbackup
+.PHONY:	firebird_server fb_lock_print fbguard fbsvcmgr fbtracemgr gbak gfix gsec gsplit gstat isql nbackup instreg instsvc instclient
 
+ifeq ($(PLATFORM),win32)
+utilities: firebird_server fb_lock_print fbguard fbsvcmgr fbtracemgr gbak gfix gsec gsplit gstat isql nbackup udfsupport instreg instsvc instclient
+else
 utilities: firebird_server fb_lock_print fbguard fbsvcmgr fbtracemgr gbak gfix gsec gsplit gstat isql nbackup udfsupport
+endif
 
 firebird_server:	$(FB_DAEMON)
 
 $(FB_DAEMON):	$(Remote_Server_Objects) $(COMMON_LIB)
-	$(EXE_LINK) $(EXE_LINK_OPTIONS) $^ -o $@ $(FIREBIRD_LIBRARY_LINK) $(LINK_LIBS)
+	$(EXE_LINK) $(EXE_LINK_OPTIONS) $^ -o $@ $(FIREBIRD_LIBRARY_LINK) $(LIB_GUI) $(LINK_LIBS)
 
 fb_lock_print:	$(LOCKPRINT)
 
@@ -554,7 +562,7 @@ $(LOCKPRINT):	$(LOCKPRINT_Objects) $(COMMON_LIB)
 fbguard:		$(FBGUARD)
 
 $(FBGUARD):		$(FBGUARD_Objects) $(COMMON_LIB)
-	$(EXE_LINK) $(EXE_LINK_OPTIONS) $^ -o $@ $(FIREBIRD_LIBRARY_LINK) $(LINK_LIBS)
+	$(EXE_LINK) $(EXE_LINK_OPTIONS) $^ -o $@ $(FIREBIRD_LIBRARY_LINK) $(LIB_GUI) $(LINK_LIBS)
 
 fbsvcmgr:		$(FBSVCMGR)
 
@@ -601,6 +609,21 @@ nbackup:		$(NBACKUP)
 $(NBACKUP):		$(NBACKUP_Objects) $(COMMON_LIB)
 	$(EXE_LINK) $(EXE_LINK_OPTIONS) $^ -o $@ $(FIREBIRD_LIBRARY_LINK) $(LINK_LIBS)
 
+instreg:		$(INSTREG)
+
+$(INSTREG):		$(INSTREG_Objects) $(COMMON_LIB)
+	$(EXE_LINK) $(EXE_LINK_OPTIONS) $^ -o $@ $(FIREBIRD_LIBRARY_LINK) $(LINK_LIBS)
+
+instsvc:		$(INSTSVC)
+
+$(INSTSVC):		$(INSTSVC_Objects) $(COMMON_LIB)
+	$(EXE_LINK) $(EXE_LINK_OPTIONS) $^ -o $@ $(FIREBIRD_LIBRARY_LINK) $(LINK_LIBS)
+
+instclient:		$(INSTCLIENT)
+
+$(INSTCLIENT):		$(INSTCLIENT_Objects) $(COMMON_LIB)
+	$(EXE_LINK) $(EXE_LINK_OPTIONS) $^ -o $@ $(FIREBIRD_LIBRARY_LINK) $(LINK_LIBS)
+
 
 #___________________________________________________________________________
 # plugins - some of them are required to build examples, use separate entry for them
@@ -623,6 +646,12 @@ ifeq ($(TARGET),Debug)
 	BUILD_DEBUG:=auth_debug
 endif
 
+ifeq ($(PLATFORM),win32)
+PLUGIN_SONAME=$(notdir $@)
+else
+PLUGIN_SONAME=$(notdir $@).0
+endif
+
 plugins: udr legacy_user_management legacy_auth_server srp_user_management trace $(BUILD_DEBUG) udf_compat chacha profiler
 
 udr:	$(UDR_PLUGIN) $(PLUGINS)/udr_engine.conf
@@ -631,31 +660,31 @@ $(PLUGINS)/udr_engine.conf: $(ROOT)/src/plugins/udr_engine/udr_engine.conf
 	cp $^ $@
 
 $(UDR_PLUGIN):	$(UDRENG_Objects) $(COMMON_LIB)
-	$(LINK_UDRENG) $(call LIB_LINK_SONAME,$(notdir $@).0) -o $@ $^ $(LINK_UDRENG_LIBS) $(FIREBIRD_LIBRARY_LINK)\
+	$(LINK_UDRENG) $(call LIB_LINK_SONAME,$(PLUGIN_SONAME)) -o $@ $^ $(LINK_UDRENG_LIBS) $(FIREBIRD_LIBRARY_LINK)\
  $(call LIB_LINK_DARWIN_INSTALL_NAME,plugins/libudr_engine.$(SHRLIB_EXT))
 
 legacy_user_management:	$(LEGACY_USER_MANAGER)
 
 $(LEGACY_USER_MANAGER):	$(LEGACY_USERS_MANAGE_Objects) $(COMMON_LIB)
-	$(LINK_PLUGIN) $(call LIB_LINK_SONAME,$(notdir $@).0) -o $@ $^ $(LINK_PLUG_LIBS) $(RE2LIB) $(FIREBIRD_LIBRARY_LINK)\
+	$(LINK_PLUGIN) $(call LIB_LINK_SONAME,$(PLUGIN_SONAME)) -o $@ $^ $(LINK_PLUG_LIBS) $(RE2LIB) $(FIREBIRD_LIBRARY_LINK)\
  $(call LIB_LINK_DARWIN_INSTALL_NAME,plugins/libLegacy_UserManager.$(SHRLIB_EXT))
 
 chacha:	$(CHACHA)
 
 $(CHACHA):	$(Chacha_Objects) $(COMMON_LIB)
-	$(LINK_PLUGIN) $(call LIB_LINK_SONAME,$(notdir $@).0) -o $@ $^ $(LINK_PLUG_LIBS) $(FIREBIRD_LIBRARY_LINK)\
+	$(LINK_PLUGIN) $(call LIB_LINK_SONAME,$(PLUGIN_SONAME)) -o $@ $^ $(LINK_PLUG_LIBS) $(FIREBIRD_LIBRARY_LINK)\
  $(call LIB_LINK_DARWIN_INSTALL_NAME,plugins/libChaCha.$(SHRLIB_EXT))
 
 legacy_auth_server:	$(LEGACY_AUTH_SERVER)
 
 $(LEGACY_AUTH_SERVER):	$(LEGACY_AUTH_SERVER_Objects) $(COMMON_LIB)
-	$(LINK_PLUGIN) $(call LIB_LINK_SONAME,$(notdir $@).0) -o $@ $^ $(LINK_PLUG_LIBS) $(FIREBIRD_LIBRARY_LINK)\
+	$(LINK_PLUGIN) $(call LIB_LINK_SONAME,$(PLUGIN_SONAME)) -o $@ $^ $(LINK_PLUG_LIBS) $(FIREBIRD_LIBRARY_LINK)\
  $(call LIB_LINK_DARWIN_INSTALL_NAME,plugins/libLegacy_Auth.$(SHRLIB_EXT))
 
 profiler:	$(PROFILER)
 
 $(PROFILER):	$(Profiler_Objects) $(COMMON_LIB)
-	$(LINK_PLUGIN) $(call LIB_LINK_SONAME,$(notdir $@).0) -o $@ $^ $(LINK_PLUG_LIBS) $(FIREBIRD_LIBRARY_LINK)\
+	$(LINK_PLUGIN) $(call LIB_LINK_SONAME,$(PLUGIN_SONAME)) -o $@ $^ $(LINK_PLUG_LIBS) $(FIREBIRD_LIBRARY_LINK)\
  $(call LIB_LINK_DARWIN_INSTALL_NAME,plugins/libDefault_Profiler.$(SHRLIB_EXT))
 
 trace:	$(FBTRACE)
@@ -666,13 +695,13 @@ $(FBTRACE):	$(FBTRACE_UTIL_Objects) $(COMMON_LIB)
 auth_debug:	$(AUTH_DEBUGGER)
 
 $(AUTH_DEBUGGER):	$(AUTH_DEBUGGER_Objects) $(COMMON_LIB)
-	$(LINK_PLUGIN) $(call LIB_LINK_SONAME,$(notdir $@).0) -o $@ $^ $(LINK_PLUG_LIBS) $(FIREBIRD_LIBRARY_LINK)\
+	$(LINK_PLUGIN) $(call LIB_LINK_SONAME,$(PLUGIN_SONAME)) -o $@ $^ $(LINK_PLUG_LIBS) $(FIREBIRD_LIBRARY_LINK)\
  $(call LIB_LINK_DARWIN_INSTALL_NAME,plugins/libAuth_Debug.$(SHRLIB_EXT))
 
 srp_user_management: $(SRP_USER_MANAGER)
 
 $(SRP_USER_MANAGER):	$(SRP_USERS_MANAGE_Objects) $(COMMON_LIB)
-	$(LINK_PLUGIN) $(call LIB_LINK_SONAME,$(notdir $@).0) -o $@ $^ $(LINK_PLUG_LIBS) $(FIREBIRD_LIBRARY_LINK)\
+	$(LINK_PLUGIN) $(call LIB_LINK_SONAME,$(PLUGIN_SONAME)) -o $@ $^ $(LINK_PLUG_LIBS) $(FIREBIRD_LIBRARY_LINK)\
  $(call LIB_LINK_DARWIN_INSTALL_NAME,plugins/libSrp.$(SHRLIB_EXT))
 
 udf_compat:	$(UDF_BACKWARD_COMPATIBILITY) $(COMPAT_SQL)
diff --git a/builds/posix/Makefile.in.examples b/builds/posix/Makefile.in.examples
index d0f8973..5f72d76 100644
--- a/builds/posix/Makefile.in.examples
+++ b/builds/posix/Makefile.in.examples
@@ -67,8 +67,16 @@ export PATH
 #endif
 GPRE_FLAGS=	-m -z -n
 
-LIB_LINK_RPATH = $(call LIB_PLATFORM_RPATH,$(if $(subst intl,,$(1)),$(LIB),$(LIB)/../intl))
-LINK_DARWIN_RPATH = -Wl,-rpath,@loader_path/../$(TARGET)/firebird
+ifeq (@USE_RPATH@,1)
+    LIB_LINK_RPATH = $(call LIB_PLATFORM_RPATH,$(if $(subst intl,,$(1)),$(LIB),$(LIB)/../intl))
+else
+    LIB_LINK_RPATH =
+endif
+ifeq ($(PLATFORM),DARWIN)
+    LINK_DARWIN_RPATH = -Wl,-rpath,@loader_path/../$(TARGET)/firebird
+else
+    LINK_DARWIN_RPATH =
+endif
 LIB_LINK_MAPFILE =
 
 EXAMPLES_DEST=	$(GEN_ROOT)/examples
@@ -91,7 +99,7 @@ EMPLOYEE_DB=	$(EXAMPLES_DEST)/employee.fdb
 FINAL_EMPDB=	$(EXAMPLES_FB)/empbuild/employee.fdb
 INTLEMP_DB=	$(EXAMPLES_DEST)/intlemp.fdb
 
-EXTAUTH_PLUGIN=	$(EXAMPLES_FB)/prebuilt/libfbSampleExtAuth.$(SHRLIB_EXT)
+EXTAUTH_PLUGIN=	$(EXAMPLES_FB)/prebuilt/$(LIB_PREFIX)fbSampleExtAuth.$(SHRLIB_EXT)
 
 .PHONY: all examples
 
diff --git a/builds/posix/Makefile.in.plugins_examples b/builds/posix/Makefile.in.plugins_examples
index 989e80d..4230624 100644
--- a/builds/posix/Makefile.in.plugins_examples
+++ b/builds/posix/Makefile.in.plugins_examples
@@ -54,6 +54,16 @@ include     $(ROOT)/gen/make.shared.variables
 
 all: udrcpp_example dc_example kh_example crypt_app
 
+ifeq ($(PLATFORM),win32)
+  PLUGIN_SONAME=$(notdir $@)
+  PLUGINS_DIR=$(FIREBIRD)/examples/prebuilt/plugins
+  SAMPLES_DIR=$(FIREBIRD)/examples/prebuilt/bin
+  makePluginName=$(PLUGINS_DIR)/$(LIB_PREFIX)$(1).$(SHRLIB_EXT)
+else
+  PLUGIN_SONAME=$(notdir $@).0
+  PLUGINS_DIR=$(PLUGINS)
+  SAMPLES_DIR=$(BIN)
+endif
 
 UDR_Objects = $(call dirObjects,../examples/udr)
 UDR_Plugin = $(PLUGINS)/udr/$(LIB_PREFIX)udrcpp_example.$(SHRLIB_EXT)
@@ -66,7 +76,7 @@ ifeq ($(PLATFORM),DARWIN)
 	$(LIB_LINK) $(LIB_BUNDLE_OPTIONS) -o $@ $^ @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ \
 		$(FIREBIRD_LIBRARY_LINK)
 else
-	$(LIB_LINK) $(LIB_LINK_OPTIONS) $(LIB_LINK_SONAME)udrcpp_example.$(SHRLIB_EXT) \
+	$(LIB_LINK) $(LIB_LINK_OPTIONS) $(call LIB_LINK_SONAME,udrcpp_example.$(SHRLIB_EXT)) \
 		$(LIB_PATH_OPTS) -o $@ $^ $(THR_LIBS) \
 		$(FIREBIRD_LIBRARY_LINK)
 endif
@@ -79,8 +89,8 @@ AllObjects += $(DC_Objects)
 dc_example: $(DC_Plugin)
 
 $(DC_Plugin):	$(DC_Objects)
-	$(LINK_PLUGIN) $(call LIB_LINK_SONAME,$(notdir $@).0) -o $@ $^ $(LINK_PLUG_LIBS) $(FIREBIRD_LIBRARY_LINK)
-	$(CP) $(EXA_ROOT)/dbcrypt/fbSampleDbCrypt.conf $(PLUGINS)
+	$(LINK_PLUGIN) $(call LIB_LINK_SONAME,$(PLUGIN_SONAME)) -o $@ $^ $(LINK_PLUG_LIBS) $(FIREBIRD_LIBRARY_LINK)
+	$(CP) $(EXA_ROOT)/dbcrypt/fbSampleDbCrypt.conf $(PLUGINS_DIR)
 
 
 KH_Objects = $(call makeObjects,../examples/dbcrypt,CryptKeyHolder.cpp)
@@ -90,12 +100,12 @@ AllObjects += $(KH_Objects)
 kh_example: $(KH_Plugin)
 
 $(KH_Plugin):	$(KH_Objects)
-	$(LINK_PLUGIN) $(call LIB_LINK_SONAME,$(notdir $@).0) -o $@ $^ $(LINK_PLUG_LIBS) $(FIREBIRD_LIBRARY_LINK)
-	$(CP) $(EXA_ROOT)/dbcrypt/fbSampleKeyHolder.conf $(PLUGINS)
+	$(LINK_PLUGIN) $(call LIB_LINK_SONAME,$(PLUGIN_SONAME)) -o $@ $^ $(LINK_PLUG_LIBS) $(FIREBIRD_LIBRARY_LINK)
+	$(CP) $(EXA_ROOT)/dbcrypt/fbSampleKeyHolder.conf $(PLUGINS_DIR)
 
 
 CA_Objects = $(call makeObjects,../examples/dbcrypt,CryptApplication.cpp)
-CRYPT_APP = $(BIN)/fbSampleDbCryptApp$(EXEC_EXT)
+CRYPT_APP = $(SAMPLES_DIR)/fbSampleDbCryptApp$(EXEC_EXT)
 AllObjects += $(CA_Objects)
 
 crypt_app: $(CRYPT_APP)
diff --git a/builds/posix/make.defaults b/builds/posix/make.defaults
index 2bbf905..15cf4e9 100755
--- a/builds/posix/make.defaults
+++ b/builds/posix/make.defaults
@@ -172,7 +172,7 @@ INLINE_EDIT_SED:= -i
 
 SH=			sh -c
 RM=			rm -f
-RM_R=		rm -rf
+RM_R=			rm -rf
 CHMOD=			chmod
 CHMOD_6=		chmod 666
 CHMOD_7=		chmod 777
@@ -196,6 +196,7 @@ CXX =	@CXX@
 LD =	@CXX@
 OBJCOPY = @OBJCOPY@
 READELF = @READELF@
+WINDRES = @WINDRES@
 
 AC_CFLAGS = @CFLAGS@
 AC_CXXFLAGS = @CXXFLAGS@
@@ -206,6 +207,9 @@ AC_LDFLAGS = @LDFLAGS@
 ifeq ($(PLATFORM),DARWIN)
 LIB_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS) $(WLDFLAGS)
 EXE_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS) $(WLDFLAGS)
+else ifeq ($(PLATFORM),win32)
+LIB_LINK = $(CXX) $(GLOB_OPTIONS)
+EXE_LINK = $(CXX) $(GLOB_OPTIONS)
 else
 LIB_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS) $(WLDFLAGS) -static-libstdc++
 EXE_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS) $(WLDFLAGS) -static-libstdc++
@@ -220,7 +224,7 @@ SO_LINK_LIBS = @LIBS@ $(DECLIB) $(I128LIB)
 
 ARCH_EXT=		.a
 EXEC_EXT=		@EXEEXT@
-SHRLIB_EXT=@SHRLIB_EXT@
+SHRLIB_EXT=		@SHRLIB_EXT@
 LIB_PREFIX=		lib
 SHRLIB_FOREIGN_EXT=	$(SHRLIB_EXT)
 
@@ -238,7 +242,7 @@ include $(ROOT)/gen/Make.Version
 
 vpath %.so $(LIB)
 vpath %.a $(LIB)
-vpath %.dll $(LIB)
+vpath %.dll $(BIN)
 
 #_____________________________________________________________________________
 
@@ -338,7 +342,11 @@ UDR_SUPPORT_LIBS=
 ifeq ($(PLATFORM),DARWIN)
     LIB_LINK_RPATH =
 else
+    ifeq ($(PLATFORM),win32)
+	LIB_PLATFORM_RPATH =
+    else
 	LIB_PLATFORM_RPATH = -Wl,-rpath,$(1)
+    endif
 
 ifeq (@USE_RPATH@,1)
     ifeq ($(strip @BINRELOC_CFLAGS@),)
@@ -360,9 +368,14 @@ else
 endif
 
 LIB_PATH_OPTS = $(call LIB_LINK_RPATH,lib) $(call LIB_LINK_RPATH,intl)
+ifeq ($(PLATFORM),win32)
+LIB_LINK_SONAME= -Wl,--out-implib,$(LIB)/lib$(1)$(ARCH_EXT)
+LIB_LINK_MAPFILE=
+else
 LIB_LINK_SONAME= -Wl,-soname,$(1)
 LIB_LINK_MAPFILE= -Wl,--version-script,$(1)
-FIREBIRD_LIBRARY_LINK= -L$(LIB) -L$(STATIC_LIB) -lfbclient $(MATHLIB) $(CRYPTLIB)
+endif
+FIREBIRD_LIBRARY_LINK= -L$(LIB) -L$(STATIC_LIB) -lfbclient $(CRYPTLIB) $(MATHLIB)
 
 EXE_LINK_OPTIONS= $(LDFLAGS) $(THR_FLAGS) $(UNDEF_FLAGS) $(LIB_PATH_OPTS) $(call LINK_DARWIN_RPATH,..) $(LINK_EMPTY_SYMBOLS)
 LIB_LINK_OPTIONS= $(LDFLAGS) $(THR_FLAGS) -shared
@@ -388,7 +401,7 @@ LINK_TRACE_LIBS = -L$(LIB) -L$(STATIC_LIB) $(SO_LINK_LIBS)
 
 LINK_FIREBIRD = $(LIB_LINK) $(LINK_FIREBIRD_SYMBOLS) $(LIB_LINK_OPTIONS) $(LIB_FIREBIRD_OPTIONS) $(UNDEF_FLAGS)\
  $(call LIB_LINK_SONAME,$(LibrarySoName)) $(call LIB_LINK_RPATH,lib) $(call LINK_DARWIN_RPATH,..)
-LINK_FIREBIRD_LIBS = -L$(LIB) -L$(STATIC_LIB) $(LIB_GUI) $(SO_LINK_LIBS) $(MATHLIB)
+LINK_FIREBIRD_LIBS = -L$(LIB) -L$(STATIC_LIB) $(LIB_GUI) $(SO_LINK_LIBS) $(CRYPTLIB) $(MATHLIB)
 
 LINK_ENGINE = $(LIB_LINK) $(LINK_PLUGIN_SYMBOLS) $(LIB_LINK_OPTIONS) $(LIB_FIREBIRD_OPTIONS) $(UNDEF_FLAGS)\
  $(call LIB_LINK_SONAME,$(EngineSoName)) $(call LIB_LINK_RPATH,lib) $(call LINK_DARWIN_RPATH,..)
@@ -419,6 +432,7 @@ RUN_GFIX	= $(RBIN)/gfix$(EXEC_EXT)
 FBGUARD		= $(BIN)/fbguard$(EXEC_EXT)
 INSTREG		= $(BIN)/instreg$(EXEC_EXT)
 INSTSVC		= $(BIN)/instsvc$(EXEC_EXT)
+INSTCLIENT	= $(BIN)/instclient$(EXEC_EXT)
 
 SECURITY_FDB	= $(FIREBIRD)/security5.fdb
 
diff --git a/builds/posix/make.rules b/builds/posix/make.rules
index 659830d..f15572a 100644
--- a/builds/posix/make.rules
+++ b/builds/posix/make.rules
@@ -143,8 +143,8 @@ $(OBJ)/%.o: $(ROOT)/%.cpp
 
 # Rules for making resource files
 
-$(GEN_ROOT)/%.res: $(SRC_ROOT)/%.rc
-	windres --output-format=coff --include-dir=$(<D) $< $@
+$(OBJ)/%.res: $(SRC_ROOT)/%.rc
+	$(WINDRES) $(RCFLAGS) --output-format=coff --include-dir=$(<D) $< $@
 
 # Rule for making gbak files when cross-compiling
 
diff --git a/builds/posix/make.shared.targets b/builds/posix/make.shared.targets
index 5fefbf1..532e78d 100644
--- a/builds/posix/make.shared.targets
+++ b/builds/posix/make.shared.targets
@@ -78,17 +78,39 @@ $(OBJ)/dsql/PackageNodes.cpp: $(SRC_ROOT)/dsql/PackageNodes.epp
 
 # Adding resources as prerequisite for some files
 
-$(FilesToAddVersionInfo): $(GEN_ROOT)/jrd/version.res
-$(FilesToAddDialog): $(GEN_ROOT)/remote/os/win32/window.res
-$(FilesToAddDialog2): $(GEN_ROOT)/iscguard/iscguard.res
+$(FilesToAddVersionInfo): $(OBJ)/jrd/version.res
+$(FilesToAddVersionInfo1): $(OBJ)/yvalve/config/os/win32/version.res
+$(FilesToAddVersionInfo2): $(OBJ)/jrd/os/win32/version.res
+$(FilesToAddVersionInfo3): $(OBJ)/intl/version.res
+$(FilesToAddVersionInfo4): $(OBJ)/extlib/version.res
+$(FilesToAddDialog): $(OBJ)/remote/server/os/win32/window.res
+$(FilesToAddDialog2): $(OBJ)/iscguard/iscguard.res
 
 # Explicit dependence of resource script
-$(GEN_ROOT)/remote/os/win32/window.res: $(SRC_ROOT)/remote/os/win32/window.rc $(SRC_ROOT)/remote/os/win32/window.rh \
- $(SRC_ROOT)/jrd/version.rc $(SRC_ROOT)/jrd/build_no.h $(SRC_ROOT)/remote/os/win32/property.rc \
- $(SRC_ROOT)/remote/os/win32/property.rh
 
-$(GEN_ROOT)/iscguard/iscguard.res: $(SRC_ROOT)/iscguard/iscguard.rc $(SRC_ROOT)/iscguard/iscguard.rh \
- $(SRC_ROOT)/jrd/version.rc
+# fbclient.dll
+$(OBJ)/yvalve/config/os/win32/version.res: $(SRC_ROOT)/jrd/version.rc
+	$(WINDRES) $(RCFLAGS) -DRC_TARGET_fbclient --output-format=coff --include-dir=$(<D) $< $@
+
+# engine13.dll
+$(OBJ)/jrd/os/win32/version.res: $(SRC_ROOT)/jrd/version.rc
+	$(WINDRES) $(RCFLAGS) -DRC_TARGET_engine13 --output-format=coff --include-dir=$(<D) $< $@
+
+# fbintl.dll
+$(OBJ)/intl/version.res: $(SRC_ROOT)/jrd/version.rc
+	$(WINDRES) $(RCFLAGS) -DRC_TARGET_fbintl --output-format=coff --include-dir=$(<D) $< $@
+
+# ib_util.dll
+$(OBJ)/extlib/version.res: $(SRC_ROOT)/jrd/version.rc
+	$(WINDRES) $(RCFLAGS) -DRC_TARGET_ib_util --output-format=coff --include-dir=$(<D) $< $@
+
+# firebird.exe
+$(OBJ)/remote/server/os/win32/window.res: $(SRC_ROOT)/remote/server/os/win32/window.rc
+	$(WINDRES) $(RCFLAGS) -DRC_TARGET_firebird --output-format=coff --include-dir=$(<D) $< $@
+
+# fbguard.exe
+$(OBJ)/iscguard/iscguard.res: $(SRC_ROOT)/iscguard/iscguard.rc
+	$(WINDRES) $(RCFLAGS) -DRC_TARGET_fbguard --output-format=coff --include-dir=$(<D) $< $@
 
 .PHONY: FORCE
 
diff --git a/builds/posix/make.shared.variables b/builds/posix/make.shared.variables
index cccded7..bfcd638 100644
--- a/builds/posix/make.shared.variables
+++ b/builds/posix/make.shared.variables
@@ -66,6 +66,9 @@ SecDbCache:= $(call makeObjects,auth,SecDbCache.cpp)
 
 # Remote
 Remote_Common:= $(call dirObjects,remote) $(call dirObjects,auth/SecureRemotePassword)
+ifeq ($(PLATFORM),win32)
+Remote_Common += $(call makeObjects,auth/trusted,AuthSspi.cpp)
+endif
 Remote_Server:= $(call dirObjects,remote/server) $(call dirObjects,auth/SecureRemotePassword/server) \
 				$(call makeObjects,jrd/replication,Config.cpp Utils.cpp) $(SecDbCache)
 Remote_Client:= $(call dirObjects,remote/client) $(call dirObjects,auth/SecureRemotePassword/client) \
@@ -146,7 +149,11 @@ AllObjects += $(LOCKPRINT_Objects)
 
 
 # Guardian
+ifeq ($(PLATFORM),win32)
+FBGUARD_Objects:= $(call dirObjects,iscguard) $(call makeObjects,remote/server/os/win32,chop.cpp)
+else
 FBGUARD_Objects:= $(call dirObjects,utilities/guard)
+endif
 
 AllObjects += $(FBGUARD_Objects)
 
@@ -181,6 +188,24 @@ ISQL_Objects:= $(call dirObjects,isql)
 AllObjects += $(ISQL_Objects)
 
 
+# Registry install tool
+INSTREG_Objects:= $(call makeObjects,utilities/install,install_reg.cpp registry.cpp)
+
+AllObjects += $(INSTREG_Objects)
+
+
+# Service install tool
+INSTSVC_Objects:= $(call makeObjects,utilities/install,install_svc.cpp services.cpp)
+
+AllObjects += $(INSTSVC_Objects)
+
+
+# Client install tool
+INSTCLIENT_Objects:= $(call makeObjects,utilities/install,install.cpp install_client.cpp)
+
+AllObjects += $(INSTCLIENT_Objects)
+
+
 # Legacy users management in security database
 LEGACY_USERS_MANAGE_Objects:= $(call makeObjects,auth/SecurityDatabase,LegacyManagement.epp)
 
diff --git a/builds/posix/prefix.mingw b/builds/posix/prefix.mingw
index b4ca1da..0ae99be 100644
--- a/builds/posix/prefix.mingw
+++ b/builds/posix/prefix.mingw
@@ -20,50 +20,74 @@
 #
 
 # -Wno-unused-variable is used due to unused gpre generated variables
-PROD_FLAGS=-O2  -DMINGW -Werror=delete-incomplete -Wall -Wshadow -Wundef -Wno-long-long -Wno-unused-variable -Wno-sign-compare -Wno-parentheses -Wno-switch -fmessage-length=0 -Dlint -DWIN32_LEAN_AND_MEAN -MMD -mthreads -Wno-non-virtual-dtor
-DEV_FLAGS=-ggdb -DMINGW -Werror=delete-incomplete -Wall -Wshadow -Wundef -Wno-long-long -Wno-unused-variable -Wno-sign-compare -Wno-parentheses -Wno-switch -fmessage-length=0 -Dlint -DWIN32_LEAN_AND_MEAN -MMD -mthreads -Wno-non-virtual-dtor
 
-PLATFORM_PATH=os/win32
+PROD_FLAGS=-O2 -march=native -DNDEBUG $(COMMONFLAGS) $(EXTRAFLAGS)
+DEV_FLAGS=-ggdb -march=native -DDEBUG $(COMMONFLAGS) $(EXTRAFLAGS)
 
-# Override link command for implicit stdc++ linking
-LIB_LINK=$(LD)
+COMMONFLAGS=-DMINGW -DWIN_NT $(PROC) -DWIN32_LEAN_AND_MEAN -MMD
+COMMONFLAGS+=-DTTMATH_NOASM -DHAVE_CTIME_S -DHAVE_LOCALTIME_S
 
-LIB_LINK_OPTIONS+=-Wl,--enable-stdcall-fixup
+ifeq ($(CpuType),x86_64)
+PROC=-DAMD64
+else
+PROC=-DI386
+endif
 
-# Strip symbols from release versions to decrease size
-ifeq ($(IsProdTypeBuild),Y)
-EXE_LINK_OPTIONS+=-Wl,-s
-LIB_LINK_OPTIONS+=-Wl,-s
+ifeq ($(TARGET),Debug)
+RCFLAGS=-DDEBUG
+else
+RCFLAGS=-DNDEBUG
 endif
 
-# Generation of fbclient_ms.lib
-LIB_LINK_IMPLIB:=-Wl,--out-implib,firebird/lib/fbclient_ms.lib
+EXTRAFLAGS=-Werror=delete-incomplete -Wundef -Wno-format -Wno-long-long -Wno-unused-variable -Wno-sign-compare -Wno-parentheses -Wno-switch -Wno-non-virtual-dtor -Wno-write-strings -Wno-invalid-offsetof -Wno-shift-count-overflow -Wno-ignored-attributes -Wno-deprecated-declarations
+
+PLATFORM_PATH=os/win32
+
+# Override link command for implicit stdc++ linking
+LIB_LINK=$(LD)
+
 LIB_GUI:= -mwindows -lcomctl32 -lgdi32
 
 # Add resources to some files
-FilesToAddVersionInfo=$(LIBFBEMBED_SO) $(LIBFBCLIENT_SO) $(LIBFBINTL_SO) \
+FilesToAddVersionInfo=$(FBSVCMGR) $(FBTRACEMGR) $(LOCKPRINT) $(NBACKUP) \
+ $(INSTREG) $(INSTSVC) $(INSTCLIENT) $(GSPLIT) \
  $(GSTAT) $(GSEC) $(GFIX) $(ISQL) $(GBAK) $(GPRE)
-# TODO: guardians also must be here
-FilesToAddDialog=$(FB_SUPER_SERVER) $(FB_CLASSIC_SERVER)
-FilesToAddDialog2=$(IBGUARD)
+
+FilesToAddVersionInfo1=$(LIBFIREBIRD_SO)
+FilesToAddVersionInfo2=$(LIBENGINE_SO)
+FilesToAddVersionInfo3=$(LIBFBINTL_SO)
+FilesToAddVersionInfo4=$(LIBIBUTIL_SO)
+
+FilesToAddDialog=$(FB_DAEMON)
+FilesToAddDialog2=$(FBGUARD)
 
 # Suppress 'lib'-prefix
 LIB_PREFIX=
 
 # Override library names to suppress version suffix
-ClientLibraryNameFull := $(ClientLibraryName)
-ClientLibrarySoName := $(ClientLibraryName)
+LibraryFileName=fbclient
+LibraryFullName=$(LibraryFileName).${SHRLIB_EXT}
+LibrarySoName=$(LibraryFileName).${SHRLIB_EXT}
+LibraryBaseName=$(LibraryFileName).${SHRLIB_EXT}
+
+LIBFIREBIRD_FULLNAME = $(BIN)/$(LibraryFullName)
+LIBFIREBIRD_SONAME = $(BIN)/$(LibraryBaseName)
+LIBFIREBIRD_BASENAME = $(BIN)/$(LibrarySoName)
+
+EngineFileName=engine${OdsVersion}
+EngineSoName=$(EngineFileName).${SHRLIB_EXT}
 
-# Looks like MinGW 3 does not support version scripts but support def-files
-LINK_FIREBIRD_SYMBOLS = $(BLD_ROOT)/win32/defs/fbclient_s.def $(BLD_ROOT)/win32/defs/fbclient.def
+LIBFIREBIRD_SO = $(BIN)/$(LibraryFileName).${SHRLIB_EXT}
+LIBENGINE_SO = $(PLUGINS)/$(EngineFileName).${SHRLIB_EXT}
+LIBFBINTL_SO = $(FB_BUILD)/intl/fbintl.$(SHRLIB_EXT)
 
-# This is required for newly built executable to find newly built shared
-# libraries because on Win32 there is no such thing as LD_LIBRARY_PATH
-LIB=$(BIN)
+# Shared library name for usage inside of the UDF
+IbUtilLibraryName = ib_util.$(SHRLIB_EXT)
+LIBIBUTIL_SO = $(BIN)/$(IbUtilLibraryName)
 
-# Special options for UDF link
-LINK_UDF = $(LIB_LINK) $(LIB_LINK_OPTIONS) $(call LIB_LINK_SONAME,$(1).$(SHRLIB_EXT)) -L$(LIB) -lib_util
-LINK_UDF_LIBS =
+# Library name differ from make.default
+LINK_INTL = $(LIB_LINK) $(LINK_FBINTL_SYMBOLS) $(LIB_LINK_OPTIONS) $(UNDEF_FLAGS)\
+ $(call LIB_LINK_SONAME,fbintl.$(SHRLIB_EXT))
 
-# Special options for trace plugin link
-LINK_TRACE_LIBS = -L$(LIB) $(SO_LINK_LIBS)
+LINK_TRACE = $(LIB_LINK) $(LINK_PLUGIN_SYMBOLS) $(LIB_LINK_OPTIONS) $(UNDEF_FLAGS)\
+ $(call LIB_LINK_SONAME,fbtrace.$(SHRLIB_EXT))
