Remove an extraneous backslash
[obnox/wireshark/wip.git] / Makefile.nmake
index 15cc0b6c33ea8a6de8b473d9f56fed4fba7250a9..f592d4307a181c1289b7d907a0450068d9e349d8 100644 (file)
@@ -29,24 +29,25 @@ WIN_SETUP=tools/$(WIRESHARK_TARGET_PLATFORM)-setup.sh
 #      as to the required library package files will be made.
 #
 LIBS_CHECK=_libs_check_
-!IF [$(SH) $(WIN_SETUP) --checktag "$(WIRESHARK_LIBS)"] != 0
+!IF [$(SH) $(WIN_SETUP) --checktag "$(WIRESHARK_LIB_DIR)"] != 0
 CHECK_TAG=_check_tag_
 !ELSE
 CHECK_TAG=
 !ENDIF
 # -------------
 
-LDFLAGS = /NOLOGO /INCREMENTAL:no $(LOCAL_LDFLAGS)
+LDFLAGS = /NOLOGO /INCREMENTAL:NO $(LOCAL_LDFLAGS)
 
 # We use GENERATED_CFLAGS to get around flex's non-LLP64-compliant output
-GENERATED_CFLAGS=-DHAVE_CONFIG_H $(LOCAL_CFLAGS) $(GLIB_CFLAGS) /I. /Iwiretap \
+GENERATED_CFLAGS=\
+       $(STANDARD_CFLAGS) \
+       -D_NEED_VAR_IMPORT_ \
+       /I.  /Iwiretap $(GLIB_CFLAGS) \
        $(ZLIB_CFLAGS) /I$(PCAP_DIR)\include $(AIRPCAP_CFLAGS) \
-       $(C_ARES_CFLAGS) $(ADNS_CFLAGS) $(PCRE_CFLAGS) $(GNUTLS_CFLAGS) \
-       $(PYTHON_CFLAGS) $(SMI_CFLAGS) $(GEOIP_CFLAGS) \
-       -D_U_="" -D_NEED_VAR_IMPORT_
-CFLAGS=-WX $(GENERATED_CFLAGS)
+       $(C_ARES_CFLAGS) $(ADNS_CFLAGS) $(GNUTLS_CFLAGS) \
+       $(PYTHON_CFLAGS) $(SMI_CFLAGS) $(GEOIP_CFLAGS)
 
-CVARSDLL=-DWIN32 -DNULL=0 -D_MT -D_DLL
+CFLAGS=$(WARNINGS_ARE_ERRORS) $(GENERATED_CFLAGS)
 
 .c.obj::
        $(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<
@@ -73,6 +74,7 @@ randpkt_OBJECTS = $(randpkt_SOURCES:.c=.obj)
 
 wireshark_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
        wsock32.lib user32.lib shell32.lib comctl32.lib \
+       $(GTHREAD_LIBS) \
        $(HHC_LIBS) \
        wsutil\libwsutil.lib \
        $(GNUTLS_LIBS) \
@@ -87,13 +89,13 @@ wireshark_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
        epan\ftypes\ftypes.lib \
        $(C_ARES_LIBS) \
        $(ADNS_LIBS) \
-       $(PCRE_LIBS) \
        $(ZLIB_LIBS)
 !ENDIF
 
 tshark_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
        wsock32.lib user32.lib \
        $(GLIB_LIBS) \
+       $(GTHREAD_LIBS) \
        wsutil\libwsutil.lib \
        $(GNUTLS_LIBS) \
        $(PYTHON_LIBS) \
@@ -107,7 +109,6 @@ tshark_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
        epan\ftypes\ftypes.lib \
        $(C_ARES_LIBS) \
        $(ADNS_LIBS) \
-       $(PCRE_LIBS) \
        $(ZLIB_LIBS)
 !ENDIF
 
@@ -127,7 +128,6 @@ rawshark_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
        epan\ftypes\ftypes.lib \
        $(C_ARES_LIBS) \
        $(ADNS_LIBS) \
-       $(PCRE_LIBS) \
        $(ZLIB_LIBS)
 !ENDIF
 
@@ -152,12 +152,11 @@ text2pcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
        wsutil\libwsutil.lib \
        $(GLIB_LIBS)
 
-dumpcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
+dumpcap_LIBS= \
        wsock32.lib user32.lib \
        wsutil\libwsutil.lib \
        $(GLIB_LIBS) \
-        $(GTHREAD_LIBS) \
-       $(PYTHON_LIBS)
+       $(GTHREAD_LIBS)
 
 dftest_LIBS=  wiretap\wiretap-$(WTAP_VERSION).lib \
        wsock32.lib user32.lib \
@@ -172,7 +171,6 @@ dftest_LIBS=  wiretap\wiretap-$(WTAP_VERSION).lib \
        epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
        $(C_ARES_LIBS) \
        $(ADNS_LIBS) \
-       $(PCRE_LIBS) \
        $(ZLIB_LIBS) \
        $(SMI_LIBS)
 !ENDIF
@@ -191,7 +189,7 @@ RESOURCES=image\wireshark.res image\libwireshark.res image\tshark.res \
        image\rawshark.res image\libwsutil.res
 
 
-all: $(LIBS_CHECK) config.h tools image codecs $(C_ARES_DLL) $(ADNS_DLL) $(ZLIB_DLL) wsutil wiretap epan $(EXECUTABLES) $(RESOURCES) doc help install-all
+all: $(LIBS_CHECK) config.h ui\qt\config.pri tools image codecs $(C_ARES_DLL) $(ADNS_DLL) $(ZLIB_DLL) wsutil wiretap epan $(EXECUTABLES) wireshark.bsc $(RESOURCES) doc help install-all
 
 !IFDEF MAKENSIS
 packaging: all
@@ -237,45 +235,75 @@ packaging_zip: all
        rm -f wireshark.zip
        zip -r -9 wireshark.zip $(INSTALL_DIR)/
 
-wireshark.bsc: *.sbr epan\*.sbr epan\dfilter\*.sbr epan\ftypes\*.sbr epan\wslua\*.sbr epan\dissectors\*.sbr gtk\*.sbr wiretap\*.sbr
-       rm -f $@
+!IFDEF WIRESHARK_GENERATE_BSC_FILE
+# FIXME: Add epan\wspython\*.sbr when we support Python embedding
+# Note: Certain .sbr files which cause bscmake warning "too many references... ignoring ..."
+wireshark.bsc: \
+       *.sbr                           \
+       codecs\*.sbr                    \
+       epan\*.sbr                      \
+       epan\crypt\*.sbr                \
+       epan\dfilter\*.sbr              \
+       epan\dissectors\*.sbr           \
+       epan\ftypes\*.sbr               \
+       epan\wslua\*.sbr                \
+       ui\*.sbr                        \
+       ui\gtk\*.sbr                    \
+       plugins\asn1\*.sbr              \
+       plugins\docsis\*.sbr            \
+       plugins\ethercat\*.sbr          \
+       plugins\giop\*.sbr              \
+       plugins\gryphon\*.sbr           \
+       plugins\irda\*.sbr              \
+       plugins\m2m\*.sbr               \
+       plugins\mate\*.sbr              \
+       plugins\opcua\*.sbr             \
+       plugins\profinet\*.sbr          \
+       lugins\stats_tree\*.sbr         \
+       plugins\unistim\*.sbr           \
+       plugins\wimax\*.sbr             \
+       plugins\wimaxasncp\*.sbr        \
+       wiretap\*.sbr                   \
+       wsutil\*.sbr
        $(BSCMAKE) @<<
                /o $@ $?
 <<
-       xcopy $@ $(INSTALL_DIR)\ /d
+!ELSE
+wireshark.bsc:
+!ENDIF
 
 pdb_zip: all
        cd $(INSTALL_DIR)
        rm -f ../wireshark-pdb-$(WIRESHARK_TARGET_PLATFORM)-$(VERSION).zip
-       zip -9 ../wireshark-pdb-$(WIRESHARK_TARGET_PLATFORM)-$(VERSION).zip *.pdb
+       zip -9 ../wireshark-pdb-$(WIRESHARK_TARGET_PLATFORM)-$(VERSION).zip *.pdb *.lib
        cd ..
 
 $(RESOURCES): image
 
 wiretap\wiretap-$(WTAP_VERSION).lib: image $(ZLIB_DLL) wiretap
 
-wireshark.exe  : $(LIBS_CHECK) config.h $(wireshark_OBJECTS) codecs epan gtk image\wireshark.res wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib codecs\codecs.lib gtk\libui.lib plugins
+wireshark.exe  : $(LIBS_CHECK) config.h $(wireshark_OBJECTS) codecs epan gtk ui win32 image\wireshark.res wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib codecs\codecs.lib ui\libui.lib ui\gtk\libgtkui.lib ui\win32\libgtkui_win32.lib plugins
        @echo Linking $@
        $(LINK) @<<
-               /OUT:wireshark.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:windows $(wireshark_LIBS) $(GTK_LIBS) codecs\codecs.lib gtk\libui.lib $(wireshark_OBJECTS) image\wireshark.res
+               /OUT:wireshark.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:windows $(wireshark_LIBS) $(GTK_LIBS) codecs\codecs.lib ui\gtk\libgtkui.lib ui\win32\libgtkui_win32.lib ui\libui.lib $(wireshark_OBJECTS) image\wireshark.res
 <<
 !IFDEF MANIFEST_INFO_REQUIRED
        mt.exe -nologo -manifest "wireshark.exe.manifest" -outputresource:wireshark.exe;1
 !ENDIF
 
-tshark.exe     : $(LIBS_CHECK) config.h $(tshark_OBJECTS) epan image\tshark.res wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib plugins
+tshark.exe     : $(LIBS_CHECK) config.h $(tshark_OBJECTS) epan cli ui image\tshark.res wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib plugins
        @echo Linking $@
        $(LINK) @<<
-               /OUT:tshark.exe $(conflags) $(conlibsdll) $(LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console $(tshark_LIBS) $(tshark_OBJECTS) image\tshark.res
+               /OUT:tshark.exe $(conflags) $(conlibsdll) $(LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console $(tshark_LIBS) $(tshark_OBJECTS) ui\cli\libcliui.lib ui\libui.lib image\tshark.res
 <<
 !IFDEF MANIFEST_INFO_REQUIRED
        mt.exe -nologo -manifest "tshark.exe.manifest" -outputresource:tshark.exe;1
 !ENDIF
 
-rawshark.exe   : $(LIBS_CHECK) config.h $(rawshark_OBJECTS) epan image\rawshark.res wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib plugins
+rawshark.exe   : $(LIBS_CHECK) config.h $(rawshark_OBJECTS) epan ui image\rawshark.res wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib plugins
        @echo Linking $@
        $(LINK) @<<
-               /OUT:rawshark.exe $(conflags) $(conlibsdll) $(LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console $(rawshark_LIBS) $(rawshark_OBJECTS) image\rawshark.res
+               /OUT:rawshark.exe $(conflags) $(conlibsdll) $(LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console $(rawshark_LIBS) $(rawshark_OBJECTS) ui\libui.lib image\rawshark.res
 <<
 !IFDEF MANIFEST_INFO_REQUIRED
        mt.exe -nologo -manifest "rawshark.exe.manifest" -outputresource:rawshark.exe;1
@@ -323,10 +351,10 @@ text2pcap.exe     : $(LIBS_CHECK) config.h text2pcap.obj text2pcap-scanner.obj wsuti
        mt.exe -nologo -manifest "text2pcap.exe.manifest" -outputresource:text2pcap.exe;1
 !ENDIF
 
-dftest.exe     : $(dftest_OBJECTS) epan
+dftest.exe     : $(dftest_OBJECTS) epan ui
        @echo Linking $@
        $(LINK) @<<
-               /OUT:dftest.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dftest_LIBS) $(dftest_OBJECTS)
+               /OUT:dftest.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dftest_LIBS) ui\libui.lib $(dftest_OBJECTS)
 <<
 !IFDEF MANIFEST_INFO_REQUIRED
        mt.exe -nologo -manifest "dftest.exe.manifest" -outputresource:dftest.exe;1
@@ -341,7 +369,7 @@ randpkt.exe : $(randpkt_OBJECTS)
        mt.exe -nologo -manifest "randpkt.exe.manifest" -outputresource:randpkt.exe;1
 !ENDIF
 
-dumpcap.exe    : $(LIBS_CHECK) config.h $(dumpcap_OBJECTS) wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib image\dumpcap.res
+dumpcap.exe    : $(LIBS_CHECK) config.h $(dumpcap_OBJECTS) wsutil\libwsutil.lib image\dumpcap.res
        @echo Linking $@
        $(LINK) @<<
                /OUT:dumpcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dumpcap_LIBS) $(dumpcap_OBJECTS) image\dumpcap.res
@@ -355,11 +383,9 @@ config.h   : config.h.win32 config.nmake
        sed -e s/@VERSION@/$(VERSION)/ \
            -e "s/@HAVE_C_ARES@/$(C_ARES_CONFIG)/" \
            -e "s/@HAVE_GNU_ADNS@/$(ADNS_CONFIG)/" \
-           -e "s/@HAVE_PCRE@/$(PCRE_CONFIG)/" \
            -e "s/@HAVE_KFW@/$(KFW_CONFIG)/" \
            -e "s/@HAVE_NETTLE@/$(NETTLE_CONFIG)/" \
            -e "s/@HAVE_LIBZ@/$(ZLIB_CONFIG)/" \
-           -e "s/@HAVE_GZCLEARERR@/$(ZLIB_GZCLEARERR_CONFIG)/" \
            -e "s/@HAVE_LIBPCAP@/$(WINPCAP_CONFIG)/" \
            -e "s/@HAVE_PCAP_FINDALLDEVS@/$(PCAP_FINDALLDEVS_CONFIG)/" \
            -e "s/@HAVE_PCAP_DATALINK_NAME_TO_VAL@/$(PCAP_DATALINK_NAME_TO_VAL_CONFIG)/" \
@@ -387,18 +413,48 @@ config.h  : config.h.win32 config.nmake
            -e "s/@PORTAUDIO_API_1@/$(PORTAUDIO_API_CONFIG)/" \
            -e "s/@HAVE_SMI@/$(SMI_CONFIG)/" \
            -e "s/@HAVE_GEOIP@/$(GEOIP_CONFIG)/" \
-           -e "s/@HAVE_NEW_PACKET_LIST@/$(NEW_PACKET_LIST_CONFIG)/" \
+           -e "s/@HAVE_GEOIP_V6@/$(GEOIP_V6_CONFIG)/" \
            -e "s/@INET6@/$(INET6_CONFIG)/" \
            -e "s/@HAVE_NTDDNDIS_H@/$(NTDDNDIS_CONFIG)/" \
+           -e "s/@PCAP_NG_DEFAULT@/$(PCAP_NG_DEFAULT)/" \
+           -e "s/@WANT_PACKET_EDITOR@/$(WANT_PACKET_EDITOR)/" \
            < config.h.win32 > $@
 
+ui\qt\config.pri: config.nmake Makefile.nmake
+       @echo Creating <<ui\qt\config.pri
+# Automatically generated from Makefile.nmake. Edit there, not here.
+VERSION = $(VERSION)
+!IFDEF MANIFEST_INFO_REQUIRED
+CONFIG += wireshark_manifest_info_required
+!ENDIF
+WIRESHARK_LIB_DIR = $(WIRESHARK_LIB_DIR:\=/)
+GLIB_DIR = $(GTK_DIR:\=/)
+C_ARES_DIR = $(C_ARES_DIR:\=/)
+ZLIB_DIR = $(ZLIB_DIR:\=/)
+GNUTLS_DIR = $(GNUTLS_DIR:\=/)
+SMI_DIR = $(SMI_DIR:\=/)
+KFW_DIR = $(KFW_DIR:\=/)
+LUA_DIR = $(LUA_DIR:\=/)
+PORTAUDIO_DIR = $(PORTAUDIO_DIR:\=/)
+
+MSVC_VARIANT = $(MSVC_VARIANT)
+
+QMAKE_CFLAGS         *= $(STANDARD_CFLAGS) $(PORTAUDIO_CFLAGS:\=/)
+QMAKE_CXXFLAGS       *= $(STANDARD_CFLAGS) $(PORTAUDIO_CFLAGS:\=/)
+QMAKE_LFLAGS         *= /LARGEADDRESSAWARE $(LDFLAGS)
+
+DEFINES += _NEED_VAR_IMPORT_
+
+<<KEEP
 
 ps.c: tools\rdps.py print.ps
        $(PYTHON) tools\rdps.py print.ps ps.c
 #
 # Build the version string
 #
-!IF EXIST(".svn/entries")
+!IF EXIST(".svn/wc.db")
+SVNENTRIES = .svn/wc.db
+!ELSE IF EXIST(".svn/entries")
 SVNENTRIES = .svn/entries
 !ELSE
 SVNENTRIES =
@@ -408,25 +464,6 @@ svnversion.h: $(SVNENTRIES)
        $(PERL) make-version.pl
 
 
-#
-# Build "tshark-tap-register.c", which contains a function
-# "register_all_tap_listeners()"
-# that calls the register routines for all TShark tap listeners.
-#
-# We do this by grepping through sources.
-#
-# Formatting conventions:  The name of the tap_listener_register_*
-# routines must start in column zero, or must be preceded only by
-# "void " starting in column zero, and must not be inside #if.
-#
-# The first argument is the name of the file to write.
-# The second argument is the directory in which the source files live.
-# All subsequent arguments are the files to scan.
-#
-tshark-tap-register.c: $(TSHARK_TAP_SRC) tools\make-tapreg-dotc
-       @echo Making tshark-tap-register.c
-       @$(SH) tools/make-tapreg-dotc tshark-tap-register.c . $(TSHARK_TAP_SRC)
-
 text2pcap-scanner.c : text2pcap-scanner.l
        $(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
 
@@ -437,25 +474,12 @@ text2pcap-scanner.obj : text2pcap-scanner.c
 # The following targets will rebuild their respective objs
 # if and when svnversion.h should change.
 #
+text2pcap.obj mergecap.obj capinfos.obj editcap.obj version_info.obj: svnversion.h
 
-text2pcap.obj : $*.c svnversion.h
-       $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c $*.c
-
-mergecap.obj : $*.c svnversion.h
-       $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c $*.c
 
-capinfos.obj : $*.c svnversion.h
-       $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c $*.c
-
-editcap.obj : $*.c svnversion.h
-       $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c $*.c
-
-version_info.obj : $*.c svnversion.h
-       $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c $*.c
-
-clean-local: clean-deps
+clean-local:
        rm -f $(wireshark_OBJECTS) $(tshark_OBJECTS) $(dumpcap_OBJECTS) $(rawshark_OBJECTS) \
-               $(EXECUTABLES) *.pdb *.exe.manifest \
+               $(EXECUTABLES) *.pdb *.sbr *.exe.manifest \
                capinfos.obj editcap.obj mergecap.obj text2pcap.obj \
                nio-ie5.obj update.obj \
                text2pcap-scanner.obj text2pcap-scanner.c rdps.obj \
@@ -465,6 +489,7 @@ clean-local: clean-deps
                $(RESOURCES) libwireshark.dll wiretap-$(WTAP_VERSION).dll \
                libwsutil.dll \
                wireshark.bsc
+       rm -rf $(INSTALL_DIR)
 
 clean: clean-local
        cd asn1
@@ -475,9 +500,15 @@ clean: clean-local
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
        cd ../codecs
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
-       cd ../gtk
+       cd ../ui
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
-       cd ../epan
+       cd gtk
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
+       cd ../win32
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
+       cd ../cli
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
+       cd ../../epan
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
        cd ../plugins
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
@@ -487,6 +518,8 @@ clean: clean-local
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
        cd ../doc
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
+       cd ../docbook
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
        cd ../help
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
        cd ../packaging/nsis
@@ -501,16 +534,14 @@ clean: clean-local
 # It does not remove generated files that are part of the distribution.
 distclean-local: clean-local
 !IFDEF ADNS_DIR
-!IF "$(MSVC_VARIANT)" != "MSVC6"
        rm -f $(ADNS_DLL) $(ADNS_LIBS)
 !ENDIF
-!ENDIF
 !IFDEF ZLIB_DIR
        rm -f $(ZLIB_DLL) $(ZLIB_DIR)\zlib1.dll.manifest \
                $(ZLIB_DIR)\include\zlib.h $(ZLIB_DIR)\include\zconf.h \
                $(ZLIB_DIR)\lib\zdll.lib
 !ENDIF
-       rm -f config.h $(BUILT_SOURCES)
+       rm -f config.h $(BUILT_SOURCES) wireshark-pdb*.zip
 
 distclean: distclean-local
        cd wiretap
@@ -519,9 +550,15 @@ distclean: distclean-local
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
        cd ../codecs
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
-       cd ../gtk
+       cd ../ui
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
+       cd gtk
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
+       cd ../win32
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
-       cd ../epan
+       cd ../cli
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
+       cd ../../epan
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
        cd ../plugins
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
@@ -531,6 +568,8 @@ distclean: distclean-local
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
        cd ../doc
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
+       cd ../docbook
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
        cd ../help
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
        cd ../packaging/nsis
@@ -554,9 +593,15 @@ maintainer-clean: maintainer-clean-local
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
        cd ../codecs
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
-       cd ../gtk
+       cd ../ui
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
+       cd gtk
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
+       cd ../win32
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
-       cd ../epan
+       cd ../cli
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
+       cd ../../epan
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
        cd ../plugins
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
@@ -566,6 +611,8 @@ maintainer-clean: maintainer-clean-local
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
        cd ../doc
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
+       cd ../docbook
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
        cd ../help
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
        cd ../packaging/nsis
@@ -587,21 +634,15 @@ image::
        cd ..
 
 !IFDEF ADNS_DIR
-# Non-MSVC6 variants have to avoid indirectly using msvcrt.dll,
+# MSVC variants supported by Wireshark have to avoid indirectly using msvcrt.dll,
 # therefore compile the adns dll from source ADNS_DIR package.
 # To avoid path problems, copy the adns sources to a temp dir,
 # compile and copy the resulting files back to (source) ADNS_DIR
 #
 # Unfortunately:
 # - we need to "patch" adns_dll.rep and adns_dll.rc (at least for MSVC2005EE)
-# - on MSVC6 we can't easily rebuild, because iphlpapi.h is needed
 #
 $(ADNS_DLL):
-!IF "$(MSVC_VARIANT)" == "MSVC6"
-       if not exist $(WIRESHARK_LIBS)\$(MSVC_VARIANT)\adns mkdir $(WIRESHARK_LIBS)\$(MSVC_VARIANT)\adns
-       copy $(ADNS_DIR)\adns_win32\lib\adns_dll.dll $(ADNS_DLL)
-       copy $(ADNS_DIR)\adns_win32\lib\adns_dll.lib $(ADNS_LIBS)
-!ELSE
        xcopy $(ADNS_DIR) adns.tmp /D /I /E /Y
        copy adns_dll.dep adns.tmp\adns_win32\adns_dll
        copy adns_dll.rc adns.tmp\adns_win32\adns_dll
@@ -612,23 +653,26 @@ $(ADNS_DLL):
 !IFDEF MANIFEST_INFO_REQUIRED
        mt.exe -nologo -manifest "adns_dll.dll.manifest" -outputresource:adns_dll.dll;2
 !ENDIF
-       if not exist $(WIRESHARK_LIBS)\$(MSVC_VARIANT)\adns mkdir $(WIRESHARK_LIBS)\$(MSVC_VARIANT)\adns
+       if not exist "$(WIRESHARK_LIB_DIR)\$(MSVC_VARIANT)\adns" mkdir "$(WIRESHARK_LIB_DIR)\$(MSVC_VARIANT)\adns"
        copy adns_dll.dll $(ADNS_DLL)
        copy adns_dll.lib $(ADNS_LIBS)
        cd ..\..\..
        rm -r -f adns.tmp
 !ENDIF
-!ENDIF
 
 !IFDEF ZLIB_DIR
-# Non-MSVC6 variants have to avoid indirectly using msvcrt.dll,
+# MSVC variants supported by Wireshark have to avoid indirectly using msvcrt.dll,
 # therefore compile the zlib dll from source ZLIB_DIR package.
 # To avoid path problems, copy the zlib sources to a temp dir,
 # compile and copy the resulting files back to (source) ZLIB_DIR
 $(ZLIB_DLL):
        xcopy $(ZLIB_DIR) zlib.tmp /D /I /E /Y
        cd zlib.tmp
-       $(MAKE) /$(MAKEFLAGS) -f win32/Makefile.msc zlib1.dll LOC="$(LOCAL_CFLAGS)"
+!if "$(WIRESHARK_TARGET_PLATFORM)" == "win32"
+       $(MAKE) /$(MAKEFLAGS) -f win32/Makefile.msc zlib1.dll LOC="-DASMV -DASMINF" OBJA="inffas32.obj match686.obj"
+!else
+       $(MAKE) /$(MAKEFLAGS) -f win32/Makefile.msc zlib1.dll AS=ml64 LOC="-DASMV -DASMINF" OBJA="inffasx64.obj gvmat64.obj inffas8664.obj"
+!endif
        if not exist $(ZLIB_DIR) mkdir $(ZLIB_DIR)
        if not exist $(ZLIB_DIR)\lib mkdir $(ZLIB_DIR)\lib
        if not exist $(ZLIB_DIR)\include mkdir $(ZLIB_DIR)\include
@@ -654,15 +698,30 @@ wiretap::
        cd ..
 
 codecs::
-        cd codecs
-        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
-        cd ..
+       cd codecs
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
+       cd ..
 
-gtk:: help config.h svnversion.h doxygen
-       cd gtk
+ui:: help config.h svnversion.h doxygen
+       cd ui
        $(MAKE) /$(MAKEFLAGS) /f Makefile.nmake libui.lib
        cd ..
 
+gtk:: help config.h svnversion.h doxygen
+       cd ui/gtk
+       $(MAKE) /$(MAKEFLAGS) /f Makefile.nmake libgtkui.lib
+       cd ../..
+
+win32::
+       cd ui/win32
+       $(MAKE) /$(MAKEFLAGS) /f Makefile.nmake libgtkui_win32.lib
+       cd ../..
+
+cli:: help config.h svnversion.h doxygen
+       cd ui/cli
+       $(MAKE) /$(MAKEFLAGS) /f Makefile.nmake libcliui.lib
+       cd ../..
+
 epan:: $(RESOURCES) $(ZLIB_DLL) wiretap\wiretap-$(WTAP_VERSION).lib $(BUILT_SOURCES) doxygen
        cd epan
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
@@ -678,6 +737,11 @@ doc::
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
        cd ..
 
+docbook::
+       cd docbook
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
+       cd ..
+
 help::
        cd help
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
@@ -711,14 +775,15 @@ REQUIRED_TOOLS=\
        $(LINK) \
        nmake \
 !IFDEF MANIFEST_INFO_REQUIRED
-       mt \
+       --windowsonly mt        \
 !ENDIF
        $(SH_PROG)      \
        $(YACC) \
        $(LEX)  \
        env     \
        grep    \
-       /usr/bin/find   \
+       --cygwinonly /usr/bin/find      \
+       peflags \
        $(PERL) \
        $(PYTHON)       \
        sed     \
@@ -726,6 +791,8 @@ REQUIRED_TOOLS=\
        wget
 
 verify_tools:
+# As win-setup.sh assumes the dir exists create it if it doesn't
+       @if not exist "$(WIRESHARK_LIB_DIR)" md "$(WIRESHARK_LIB_DIR)"
        @$(SH) $(WIN_SETUP) --appverify $(REQUIRED_TOOLS)
 
 # Targets and etc used to verify or download libraries
@@ -763,7 +830,7 @@ $(CHECK_TAG): _FORCE_
 
 !ENDIF
 
-# Download (if needed) and install all the required libraries into WIRESHARK_LIBS.
+# Download (if needed) and install all the required libraries into WIRESHARK_LIB_DIR.
 # A clean_setup is done first to ensure that the target dirs don't
 # contain old files remaining from a previous setup run.
 setup: verify_tools clean_setup process_libs
@@ -772,78 +839,76 @@ setup: verify_tools clean_setup process_libs
 # The process_libs target when invoked causes either a --libverify or a --download for all the required libraries.
 # (The choice is determined by the value of the macro WIN_SETUP_OPT).
 process_libs:
-    @if not exist $(WIRESHARK_LIBS) md $(WIRESHARK_LIBS)
+       @if not exist "$(WIRESHARK_LIB_DIR)" md "$(WIRESHARK_LIB_DIR)"
 !IFDEF GTK_DIR
-       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
+       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
                gtk2 gtk+-bundle_$(GTK_PKG)_$(WIRESHARK_TARGET_PLATFORM).zip
 !ENDIF
 !IFDEF KFW_DIR
-       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
+       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
                . kfw-3-2-2-i386-ws-vc6.zip
-#      @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
+#      @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
 #              . kfw-3-2-2.zip
 !ENDIF
 !IFDEF PCAP_DIR
-       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
+       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
                . WpdPack_$(PCAP_VERSION).zip
 !ENDIF
 !IFDEF AIRPCAP_DIR
-       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
+       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
                AirPcap_Devpack_4_1_0_1622 AirPcap_Devpack_4_1_0_1622.zip
 !ENDIF
 !IFDEF C_ARES_DIR
-       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
+       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
                . c-ares-$(C_ARES_PKG)-$(WIRESHARK_TARGET_PLATFORM)ws.zip
 !ENDIF
 !IFDEF ADNS_DIR
-       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
+       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
                . adns-1.0-win32-05ws.zip
 !ENDIF
-!IFDEF PCRE_DIR
-       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
-               pcre-7.0 pcre-7.0-bin.zip
-       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
-               pcre-7.0 pcre-7.0-lib.zip
-!ENDIF
 !IFDEF ZLIB_DIR
-       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
-               zlib123 zlib123ws.zip
+       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
+!if "$(WIRESHARK_TARGET_PLATFORM)" == "win32"
+               zlib125 zlib-1.2.5.zip
+!else
+               zlib125 zlib125ws.zip
+!endif
 !ENDIF
 !IFDEF LUA_DIR
-       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
+       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
                lua5.1.4 lua$(LUA_DIST)_lib.zip
 !ENDIF
 
 !IFDEF GNUTLS_PKG
-       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
+       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
                . gnutls-$(GNUTLS_PKG)-$(WIRESHARK_TARGET_PLATFORM)ws.zip
 !ENDIF
 !IFDEF PORTAUDIO_DIR
-       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
+       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
                . portaudio_v19_2.zip
 !ENDIF
 !IFDEF SMI_DIR
-       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
-               . libsmi-0.4.8.zip
+       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
+               . libsmi-$(SMI_PKG)-$(WIRESHARK_TARGET_PLATFORM)ws.zip
 !ENDIF
 !IFDEF GEOIP_DIR
-       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
+       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
                . GeoIP-1.4.6-$(WIRESHARK_TARGET_PLATFORM)ws.zip
 !ENDIF
 !IFDEF HHC_DIR
-       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
-               user-guide user-guide-28526.zip
+       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
+               user-guide user-guide-37310.zip
 !ENDIF
 !IFDEF UPX
-       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
+       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
                . upx303w.zip
 !ENDIF
 !IFDEF NASM
-       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
-               . nasm-2.02-win32.zip
+       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
+               . nasm-2.09.08-win32.zip
 !ENDIF
 !IF "$(WIN_SETUP_OPT)" == "--download"
-       @$(SH) $(WIN_SETUP) --settag "$(WIRESHARK_LIBS)"
+       @$(SH) $(WIN_SETUP) --settag "$(WIRESHARK_LIB_DIR)"
 !ENDIF
        @echo.
        @echo Wireshark is ready to build.
@@ -853,46 +918,52 @@ process_libs:
 # WHEN UPDATING LIBRARY VERSIONS, KEEP ALSO ONE FORMER VERSION SO
 # UPDATING REMOVES THE FORMER USER DIRS
 clean_setup:
-    rm -r -f $(WIRESHARK_LIBS)/adns-1.0-win32-05ws
-    rm -r -f $(WIRESHARK_LIBS)/c-ares-1.5.3ws
-    rm -r -f $(WIRESHARK_LIBS)/c-ares-1.6.0ws
-    rm -r -f $(WIRESHARK_LIBS)/c-ares-1.7.0-win??ws
-    rm -r -f $(WIRESHARK_LIBS)/c-ares-1.7.1-win??ws
-    rm -r -f $(WIRESHARK_LIBS)/gettext-0.14.5
-    rm -r -f $(WIRESHARK_LIBS)/gettext-runtime-0.17
-    rm -r -f $(WIRESHARK_LIBS)/gettext-runtime-0.17-1
-    rm -r -f $(WIRESHARK_LIBS)/gettext-0.17-1            # win64
-    rm -r -f $(WIRESHARK_LIBS)/glib
-    rm -r -f $(WIRESHARK_LIBS)/gnutls-2.8.1-1
-    rm -r -f $(WIRESHARK_LIBS)/gnutls-2.8.5-*-win??ws
-    rm -r -f $(WIRESHARK_LIBS)/gtk2
-    rm -r -f $(WIRESHARK_LIBS)/gtk+
-    rm -r -f $(WIRESHARK_LIBS)/gtk-wimp
-    rm -r -f $(WIRESHARK_LIBS)/kfw-2.5
-    rm -r -f $(WIRESHARK_LIBS)/kfw-3.2.2-ws1
-    rm -r -f $(WIRESHARK_LIBS)/kfw-3.2.2-i386-ws-vc6
-    rm -r -f $(WIRESHARK_LIBS)/libiconv-1.9.1.bin.woe32
-    rm -r -f $(WIRESHARK_LIBS)/lua5.1
-    rm -r -f $(WIRESHARK_LIBS)/lua5.1.4
-    rm -r -f $(WIRESHARK_LIBS)/libsmi-0.4.5
-    rm -r -f $(WIRESHARK_LIBS)/libsmi-0.4.8
-    rm -r -f $(WIRESHARK_LIBS)/nasm-2.00
-    rm -r -f $(WIRESHARK_LIBS)/nasm-2.02
-    rm -r -f $(WIRESHARK_LIBS)/pcre-6.4
-    rm -r -f $(WIRESHARK_LIBS)/pcre-7.0
-    rm -r -f $(WIRESHARK_LIBS)/portaudio_v19
-    rm -r -f $(WIRESHARK_LIBS)/portaudio_v19_2
-    rm -r -f $(WIRESHARK_LIBS)/user-guide
-    rm -r -f $(WIRESHARK_LIBS)/WpdPack
-    rm -r -f $(WIRESHARK_LIBS)/AirPcap_Devpack_1_0_0_594
-    rm -r -f $(WIRESHARK_LIBS)/AirPcap_Devpack_4_0_0_1480
-    rm -r -f $(WIRESHARK_LIBS)/AirPcap_Devpack_4_1_0_1622
-    rm -r -f $(WIRESHARK_LIBS)/zlib123
-    rm -r -f $(WIRESHARK_LIBS)/zlib123-dll
-    rm -r -f $(WIRESHARK_LIBS)/upx301w
-    rm -r -f $(WIRESHARK_LIBS)/upx303w
-    rm -r -f $(WIRESHARK_LIBS)/GeoIP-1.4.5ws
-    rm -r -f $(WIRESHARK_LIBS)/GeoIP-1.4.6-win??ws
+    cd "$(WIRESHARK_LIB_DIR)"
+    rm -r -f adns-1.0-win32-05ws
+    rm -r -f c-ares-1.5.3ws
+    rm -r -f c-ares-1.6.0ws
+    rm -r -f c-ares-1.7.0-win??ws
+    rm -r -f c-ares-1.7.1-win??ws
+    rm -r -f gettext-0.14.5
+    rm -r -f gettext-runtime-0.17
+    rm -r -f gettext-runtime-0.17-1
+    rm -r -f gettext-0.17-1            # win64
+    rm -r -f glib
+    rm -r -f gnutls-2.8.1-1
+    rm -r -f gnutls-2.8.5-*-win??ws
+    rm -r -f gnutls-2.10.3-*-win??ws
+    rm -r -f gtk2
+    rm -r -f gtk+
+    rm -r -f gtk-wimp
+    rm -r -f kfw-2.5
+    rm -r -f kfw-3.2.2-ws1
+    rm -r -f kfw-3.2.2-i386-ws-vc6
+    rm -r -f libiconv-1.9.1.bin.woe32
+    rm -r -f lua5.1
+    rm -r -f lua5.1.4
+    rm -r -f libsmi-0.4.5
+    rm -r -f libsmi-0.4.8
+    rm -r -f libsmi-win??-svn-40773
+    rm -r -f nasm-2.00
+    rm -r -f nasm-2.02
+    rm -r -f nasm-2.09.08
+    rm -r -f pcre-6.4
+    rm -r -f pcre-7.0
+    rm -r -f portaudio_v19
+    rm -r -f portaudio_v19_2
+    rm -r -f user-guide
+    rm -r -f WpdPack
+    rm -r -f AirPcap_Devpack_1_0_0_594
+    rm -r -f AirPcap_Devpack_4_0_0_1480
+    rm -r -f AirPcap_Devpack_4_1_0_1622
+    rm -r -f zlib123
+    rm -r -f zlib-1.2.5
+    rm -r -f zlib123-dll
+    rm -r -f upx301w
+    rm -r -f upx303w
+    rm -r -f GeoIP-1.4.5ws
+    rm -r -f GeoIP-1.4.6-win??ws
+    cd "$(MAKEDIR)"
 
 ################################################################################
 # Prepare the debug trees for running Wireshark/Tshark from there.
@@ -921,35 +992,41 @@ install-generated-files:
 !ENDIF
 !IFDEF ENABLE_LIBWIRESHARK
        xcopy epan\libwireshark.dll $(INSTALL_DIR) /d
+       if exist epan\libwireshark.lib xcopy .\epan\libwireshark.lib $(INSTALL_DIR) /d
        if exist epan\libwireshark.pdb xcopy .\epan\libwireshark.pdb $(INSTALL_DIR) /d
 !ENDIF
        xcopy ".\wiretap\wiretap-$(WTAP_VERSION).dll" $(INSTALL_DIR) /d
+       if exist ".\wiretap\wiretap-$(WTAP_VERSION).lib" xcopy ".\wiretap\wiretap-$(WTAP_VERSION).lib" $(INSTALL_DIR) /d
        if exist ".\wiretap\wiretap-$(WTAP_VERSION).pdb" xcopy ".\wiretap\wiretap-$(WTAP_VERSION).pdb" $(INSTALL_DIR) /d
        xcopy ".\wsutil\libwsutil.dll" $(INSTALL_DIR) /d
+       if exist ".\wsutil\libwsutil.lib" xcopy ".\wsutil\libwsutil.lib" $(INSTALL_DIR) /d
+       if exist ".\wsutil\libwsutil.pdb" xcopy ".\wsutil\libwsutil.pdb" $(INSTALL_DIR) /d
        if exist wireshark.exe copy wireshark.exe $(INSTALL_DIR)\wireshark.exe
        if exist wireshark.pdb copy wireshark.pdb $(INSTALL_DIR)\wireshark.pdb
+       if exist wireshark.bsc copy wireshark.bsc $(INSTALL_DIR)\wireshark.bsc
        if exist ".\docbook\user-guide.chm" xcopy ".\docbook\user-guide.chm" $(INSTALL_DIR) /d
-       if exist tshark.exe xcopy tshark.exe $(INSTALL_DIR) /d
-       if exist tshark.pdb xcopy tshark.pdb $(INSTALL_DIR) /d
-       if exist rawshark.exe xcopy rawshark.exe $(INSTALL_DIR) /d
-       if exist rawshark.pdb xcopy rawshark.pdb $(INSTALL_DIR) /d
+       if exist capinfos.exe xcopy capinfos.exe $(INSTALL_DIR) /d
+       if exist capinfos.pdb xcopy capinfos.pdb $(INSTALL_DIR) /d
        if exist dumpcap.exe xcopy dumpcap.exe $(INSTALL_DIR) /d
        if exist dumpcap.pdb xcopy dumpcap.pdb $(INSTALL_DIR) /d
+       if exist editcap.exe xcopy editcap.exe $(INSTALL_DIR) /d
+       if exist editcap.pdb xcopy editcap.pdb $(INSTALL_DIR) /d
        if exist mergecap.exe xcopy mergecap.exe $(INSTALL_DIR) /d
        if exist mergecap.pdb xcopy mergecap.pdb $(INSTALL_DIR) /d
+       if exist rawshark.exe xcopy rawshark.exe $(INSTALL_DIR) /d
+       if exist rawshark.pdb xcopy rawshark.pdb $(INSTALL_DIR) /d
        if exist text2pcap.exe xcopy text2pcap.exe $(INSTALL_DIR) /d
        if exist text2pcap.pdb xcopy text2pcap.pdb $(INSTALL_DIR) /d
-       if exist capinfos.exe xcopy capinfos.exe $(INSTALL_DIR) /d
-       if exist capinfos.pdb xcopy capinfos.pdb $(INSTALL_DIR) /d
-       if exist editcap.exe xcopy editcap.exe $(INSTALL_DIR) /d
-       if exist editcap.pdb xcopy editcap.pdb $(INSTALL_DIR) /d
+       if exist tshark.exe xcopy tshark.exe $(INSTALL_DIR) /d
+       if exist tshark.pdb xcopy tshark.pdb $(INSTALL_DIR) /d
        xcopy "doc\AUTHORS-SHORT" $(INSTALL_DIR) /d
        xcopy ".\manuf" $(INSTALL_DIR) /d
        xcopy ".\services" $(INSTALL_DIR) /d
-       $(TEXTIFY) ".\COPYING" $(INSTALL_DIR)
-       $(TEXTIFY) ".\NEWS" $(INSTALL_DIR)
-       $(TEXTIFY) ".\README" $(INSTALL_DIR)
-       $(TEXTIFY) ".\README.windows" $(INSTALL_DIR)
+       xcopy ".\pdml2html.xsl" $(INSTALL_DIR) /d
+       $(TEXTIFY) "./COPYING" $(INSTALL_DIR)
+       $(TEXTIFY) "./NEWS" $(INSTALL_DIR)
+       $(TEXTIFY) "./README" $(INSTALL_DIR)
+       $(TEXTIFY) "./README.windows" $(INSTALL_DIR)
        xcopy ".\cfilters" $(INSTALL_DIR) /d
        xcopy ".\colorfilters" $(INSTALL_DIR) /d
        xcopy ".\dfilters" $(INSTALL_DIR) /d
@@ -989,6 +1066,8 @@ install-generated-files:
        cd plugins
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake install-plugins
        cd ..
+       if not exist $(INSTALL_DIR)\ui mkdir $(INSTALL_DIR)\ui
+       xcopy "ui\gtk\ui\*.xml" $(INSTALL_DIR)\ui /d
 
 # "install-all" will copy all files needed to run Wireshark/Tshark
 # to the INSTALL_DIR, so you can run/debug Wireshark/Tshark from there.
@@ -1057,10 +1136,6 @@ install-all: install-generated-files
 !IFDEF ADNS_DIR
        xcopy $(ADNS_DLL) $(INSTALL_DIR) /d
 !ENDIF
-!IFDEF PCRE_DIR
-       xcopy $(PCRE_DIR)\bin\pcre3.dll $(INSTALL_DIR) /d
-       xcopy $(PCRE_DIR)\man\cat3\pcrepattern.3.txt $(INSTALL_DIR) /d
-!ENDIF
 !IFDEF KFW_DIR
        xcopy $(KFW_PATH)\comerr32.dll $(INSTALL_DIR) /d
        xcopy $(KFW_PATH)\krb5_32.dll $(INSTALL_DIR) /d
@@ -1071,6 +1146,11 @@ install-all: install-generated-files
        xcopy $(GNUTLS_DIR)\bin\libgnutls-26.dll $(INSTALL_DIR) /d
        xcopy $(GNUTLS_DIR)\bin\libgpg-error-0.dll $(INSTALL_DIR) /d
        xcopy $(GNUTLS_DIR)\bin\libtasn1-3.dll $(INSTALL_DIR) /d
+! IF "$(INTL_DLL)" != "libintl-8.dll"
+# The gtk+ bundle doesn't provide libintl-8.dll (which is the case
+# with the 32-bit package); use the GNUTLS version.
+       xcopy $(GNUTLS_DIR)\bin\libintl-8.dll $(INSTALL_DIR) /d
+! ENDIF
 !ENDIF
 !IFDEF LUA_DIR
        xcopy "$(LUA_DIR)\lua5.1.dll" $(INSTALL_DIR) /d
@@ -1078,14 +1158,18 @@ install-all: install-generated-files
 !IFDEF SMI_DIR
        if not exist $(INSTALL_DIR)\snmp mkdir $(INSTALL_DIR)\snmp
        if not exist $(INSTALL_DIR)\snmp\mibs mkdir $(INSTALL_DIR)\snmp\mibs
-       xcopy "$(SMI_DIR)\lib\smi.dll" $(INSTALL_DIR) /d
-       xcopy "$(SMI_DIR)\mibs\*" $(INSTALL_DIR)\snmp\mibs /d
+       xcopy "$(SMI_DIR)\bin\libsmi-2.dll" $(INSTALL_DIR) /d
+       xcopy "$(SMI_DIR)\share\mibs\iana\*" $(INSTALL_DIR)\snmp\mibs /d
+       xcopy "$(SMI_DIR)\share\mibs\ietf\*" $(INSTALL_DIR)\snmp\mibs /d
+       xcopy "$(SMI_DIR)\share\mibs\irtf\*" $(INSTALL_DIR)\snmp\mibs /d
+       xcopy "$(SMI_DIR)\share\mibs\tubs\*" $(INSTALL_DIR)\snmp\mibs /d
+       xcopy "$(SMI_DIR)\share\pibs\*" $(INSTALL_DIR)\snmp\mibs /d
+       xcopy "$(SMI_DIR)\share\yang\*.yang" $(INSTALL_DIR)\snmp\mibs /d
 !ENDIF
-
-clean-deps:
-       rm -rf $(INSTALL_DIR)
-       cd plugins
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean-deps
+       cd $(INSTALL_DIR)
+       peflags --dynamicbase=true --nxcompat=true *.dll
+       peflags --dynamicbase=true --nxcompat=true lib/gtk-2.0/*/engines/*.dll
+       peflags --dynamicbase=true --nxcompat=true lib/gtk-2.0/modules/*.dll
        cd ..
 
 checkapi_local:
@@ -1099,9 +1183,13 @@ checkapi: checkapi_local
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
        cd ../codecs
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
-       cd ../gtk
+       cd ../ui
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
-       cd ../epan
+       cd gtk
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
+       cd ../win32
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
+       cd ../../epan
 ##     $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
        cd ../epan/crypt
 ##     $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
@@ -1121,4 +1209,3 @@ checkapi: checkapi_local
 
 ####
 _FORCE_:  ## Assumption: no file named _FORCE_ exists in the current directory
-