Replace "svn" with "git" all over the place.
[metze/wireshark/wip.git] / Makefile.nmake
1 ## Makefile for building wireshark.exe with Microsoft C and nmake
2 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
3 #
4 # $Id$
5
6 # We "Deploy using XCopy," which is described at
7 # http://msdn.microsoft.com/en-us/library/ms235291.aspx
8
9 include config.nmake
10 include <win32.mak>
11
12 ############### no need to modify below this line #########
13
14 CC = cl
15 LINK= link
16 BSCMAKE= bscmake
17
18 WIN_SETUP=tools/$(WIRESHARK_TARGET_PLATFORM)-setup.sh
19
20 # -------------
21 # Checking  that the Wireshark Libraries are up-to-date:
22 #  1. win??-setup.sh --checktag is invoked during nmake "preprocessing".
23 #     If an error status is returned (ie: the libraries are not up-to-date)
24 #      then CHECK_TAG is defined as a non-null string.
25 #  2. The $(LIBS_CHECK) target is invoked during the nmake:
26 #     If $(CHECK_TAG) is non-null, then a "libraries not up to date" exit will occur.
27 #     If $(CHECK_TAG) is null, but either config.nmake or Makefile.nmake
28 #      are newer than the $(LIBS_CHECK) target, then a detailed verification
29 #      as to the required library package files will be made.
30 #
31 LIBS_CHECK=_libs_check_
32 !IF [$(SH) $(WIN_SETUP) --checktag "$(WIRESHARK_LIB_DIR)"] != 0
33 CHECK_TAG=_check_tag_
34 !ELSE
35 CHECK_TAG=
36 !ENDIF
37 # -------------
38
39 LDFLAGS = /NOLOGO /INCREMENTAL:NO $(LOCAL_LDFLAGS)
40
41 # We use GENERATED_CFLAGS to get around flex's non-LLP64-compliant output
42 GENERATED_CFLAGS=\
43         $(STANDARD_CFLAGS) \
44         /I.  /Iwiretap $(GLIB_CFLAGS) \
45         $(ZLIB_CFLAGS) /I$(PCAP_DIR)\include $(AIRPCAP_CFLAGS) \
46         $(C_ARES_CFLAGS) $(ADNS_CFLAGS) $(GNUTLS_CFLAGS) \
47         $(PYTHON_CFLAGS) $(SMI_CFLAGS) $(GEOIP_CFLAGS) $(WINSPARKLE_CFLAGS)
48
49 CFLAGS=$(WARNINGS_ARE_ERRORS) $(GENERATED_CFLAGS)
50
51 .c.obj::
52         $(CC) $(CFLAGS) -Fd.\ -c $<
53
54 PLATFORM_PCAP_SRC = \
55         capture-wpcap.c \
56         capture_wpcap_packet.c \
57         capture_win_ifnames.c
58
59 include Makefile.common
60
61 wireshark_OBJECTS = $(WIRESHARK_COMMON_SRC:.c=.obj)
62 tshark_OBJECTS = $(tshark_SOURCES:.c=.obj)
63 tfshark_OBJECTS = $(tfshark_SOURCES:.c=.obj)
64 rawshark_OBJECTS = $(rawshark_SOURCES:.c=.obj)
65 ###text2pcap_OBJECTS = $(text2pcap_SOURCES:.c=.obj)
66 mergecap_OBJECTS = $(mergecap_SOURCES:.c=.obj)
67 editcap_OBJECTS = $(editcap_SOURCES:.c=.obj)
68 capinfos_OBJECTS = $(capinfos_SOURCES:.c=.obj)
69 captype_OBJECTS = $(captype_SOURCES:.c=.obj)
70 dftest_OBJECTS = $(dftest_SOURCES:.c=.obj)
71 dumpcap_OBJECTS = $(dumpcap_SOURCES:.c=.obj)
72 randpkt_OBJECTS = $(randpkt_SOURCES:.c=.obj)
73
74 #
75 # psapi.lib see http://msdn.microsoft.com/en-us/library/windows/desktop/ms683219(v=vs.85).aspx
76 #
77
78 wireshark_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
79         wsock32.lib user32.lib shell32.lib comctl32.lib ole32.lib psapi.lib \
80         $(GTHREAD_LIBS) \
81         $(HHC_LIBS) \
82         wsutil\libwsutil.lib \
83         $(GNUTLS_LIBS) \
84         $(PYTHON_LIBS) \
85         $(WINSPARKLE_LIBS) \
86 !IFDEF ENABLE_LIBWIRESHARK
87         epan\libwireshark.lib \
88 !ELSE
89         epan\dissectors\dissectors.lib \
90         epan\wireshark.lib \
91         epan\crypt\airpdcap.lib \
92         epan\dfilter\dfilter.lib \
93         epan\ftypes\ftypes.lib \
94         $(C_ARES_LIBS) \
95         $(ADNS_LIBS) \
96         $(ZLIB_LIBS)
97 !ENDIF
98
99 tshark_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
100         wsock32.lib user32.lib psapi.lib \
101         $(GLIB_LIBS) \
102         $(GTHREAD_LIBS) \
103         wsutil\libwsutil.lib \
104         $(GNUTLS_LIBS) \
105         $(PYTHON_LIBS) \
106 !IFDEF ENABLE_LIBWIRESHARK
107         epan\libwireshark.lib \
108 !ELSE
109         epan\dissectors\dissectors.lib \
110         epan\wireshark.lib \
111         epan\crypt\airpdcap.lib \
112         epan\dfilter\dfilter.lib \
113         epan\ftypes\ftypes.lib \
114         $(C_ARES_LIBS) \
115         $(ADNS_LIBS) \
116         $(ZLIB_LIBS)
117 !ENDIF
118
119 tfshark_LIBS= filetap\filetap-$(FTAP_VERSION).lib \
120         wiretap\wiretap-$(WTAP_VERSION).lib \
121         wsock32.lib user32.lib psapi.lib \
122         $(GLIB_LIBS) \
123         $(GTHREAD_LIBS) \
124         wsutil\libwsutil.lib \
125         $(GNUTLS_LIBS) \
126         $(PYTHON_LIBS) \
127 !IFDEF ENABLE_LIBWIRESHARK
128         epan\libwireshark.lib \
129 !ELSE
130         epan\dissectors\dissectors.lib \
131         epan\wireshark.lib \
132         epan\dfilter\dfilter.lib \
133         epan\ftypes\ftypes.lib \
134         epan\wmem\wmem.lib
135 !ENDIF
136
137 rawshark_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
138         wsock32.lib user32.lib psapi.lib \
139         $(GLIB_LIBS) \
140         wsutil\libwsutil.lib \
141         $(GNUTLS_LIBS) \
142         $(PYTHON_LIBS) \
143 !IFDEF ENABLE_LIBWIRESHARK
144         epan\libwireshark.lib \
145 !ELSE
146         epan\dissectors\dissectors.lib \
147         epan\wireshark.lib \
148         epan\crypt\airpdcap.lib \
149         epan\dfilter\dfilter.lib \
150         epan\ftypes\ftypes.lib \
151         $(C_ARES_LIBS) \
152         $(ADNS_LIBS) \
153         $(ZLIB_LIBS)
154 !ENDIF
155
156 capinfos_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
157         wsock32.lib user32.lib shell32.lib \
158         wsutil\libwsutil.lib \
159         $(GLIB_LIBS) \
160         $(GCRYPT_LIBS)
161
162 captype_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
163         wsock32.lib user32.lib shell32.lib \
164         wsutil\libwsutil.lib \
165         $(GLIB_LIBS)
166
167 editcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
168         wsock32.lib user32.lib shell32.lib \
169         wsutil\libwsutil.lib \
170         $(GLIB_LIBS)
171
172 mergecap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
173         wsock32.lib user32.lib \
174         wsutil\libwsutil.lib \
175         $(GLIB_LIBS)
176
177 reordercap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
178         wsock32.lib user32.lib \
179         wsutil\libwsutil.lib \
180         $(GLIB_LIBS)
181
182 text2pcap_LIBS= \
183         wsock32.lib user32.lib \
184         wsutil\libwsutil.lib \
185         $(GLIB_LIBS)
186
187 dumpcap_LIBS= \
188         wsock32.lib user32.lib \
189         wsutil\libwsutil.lib \
190         $(GLIB_LIBS) \
191         $(GTHREAD_LIBS)
192
193 dftest_LIBS=  wiretap\wiretap-$(WTAP_VERSION).lib \
194         wsock32.lib user32.lib psapi.lib \
195         $(GLIB_LIBS) \
196         wsutil\libwsutil.lib \
197         $(GNUTLS_LIBS) \
198 !IFDEF ENABLE_LIBWIRESHARK
199         epan\libwireshark.lib \
200 !ELSE
201         epan\dissectors\dissectors.lib \
202         epan\wireshark.lib \
203         epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
204         $(C_ARES_LIBS) \
205         $(ADNS_LIBS) \
206         $(ZLIB_LIBS) \
207         $(SMI_LIBS)
208 !ENDIF
209
210 randpkt_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
211         user32.lib \
212         wsutil\libwsutil.lib \
213         $(GLIB_LIBS)
214
215 EXECUTABLES=wireshark.exe tshark.exe tfshark.exe rawshark.exe \
216         capinfos.exe captype.exe editcap.exe mergecap.exe text2pcap.exe \
217         randpkt.exe reordercap.exe dumpcap.exe dftest.exe
218
219 !IFDEF QT5_BASE_DIR
220 EXECUTABLES=$(EXECUTABLES) qtshark.exe
221 !ENDIF
222
223 RESOURCES=image\wireshark.res image\file_dlg_win32.res \
224         image\libwireshark.res image\tshark.res image\tfshark.res image\capinfos.res \
225         image\captype.res image\editcap.res image\mergecap.res \
226         image\text2pcap.res image\wiretap.res image\filetap.res image\dumpcap.res \
227         image\rawshark.res image\reordercap.res image\libwsutil.res
228
229
230 all: $(LIBS_CHECK) config.h ui\qt\config.pri tools image codecs $(C_ARES_DLL) $(ADNS_DLL) $(ZLIB_DLL) wsutil wiretap filetap epan $(EXECUTABLES) wireshark.bsc $(RESOURCES) help install-all
231
232 !IFDEF MAKENSIS
233 packaging: all
234         cd packaging
235         cd nsis
236         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
237         cd ..
238         cd ..
239 !ELSE
240 packaging: _FORCE_
241         @echo \? NSIS not available (MAKENSIS not defined in config.nmake)
242         @echo.
243         @exit 1
244 !ENDIF
245
246 packaging_papps: all
247         cd packaging
248         cd portableapps
249         cd win32
250         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
251         cd ..
252         cd ..
253         cd ..
254
255 # use (info-)zip from cygwin to pack things
256 packaging_zip: all
257 !IFDEF MSVCR_DLL
258         xcopy "$(MSVCR_DLL)" $(INSTALL_DIR)
259 !ENDIF
260 !IFDEF VCREDIST_EXE
261         @echo Including vcredist_$(TARGET_MACHINE).exe -- your recipient may need to run it!
262         xcopy "$(VCREDIST_EXE)" $(INSTALL_DIR)
263 !ENDIF
264         rm -f wireshark.zip
265         zip -r -9 wireshark.zip $(INSTALL_DIR)/
266
267 !IFDEF WIRESHARK_GENERATE_BSC_FILE
268 # FIXME: Add epan\wspython\*.sbr when we support Python embedding
269 # Note: Certain .sbr files cause bscmake warning "too many references... ignoring ..."
270 # XXX: It seems that using .bsc files with VS2010 doesn't work (isn't supported ?)
271 #      Using .bsc files with VS2008 may work
272 #      See: http://ask.wireshark.org/questions/8660/wireshark-building-and-debugging-on-visual-c-or-visual-studio
273 wireshark.bsc: \
274         *.sbr                           \
275         codecs\*.sbr                    \
276         epan\*.sbr                      \
277         epan\crypt\*.sbr                \
278         epan\dfilter\*.sbr              \
279         epan\dissectors\*.sbr           \
280         epan\ftypes\*.sbr               \
281         epan\wslua\*.sbr                \
282         filetap\*.sbr                   \
283         plugins\asn1\*.sbr              \
284         plugins\docsis\*.sbr            \
285         plugins\ethercat\*.sbr          \
286         plugins\gryphon\*.sbr           \
287         plugins\irda\*.sbr              \
288         plugins\m2m\*.sbr               \
289         plugins\mate\*.sbr              \
290         plugins\opcua\*.sbr             \
291         plugins\profinet\*.sbr          \
292         plugins\stats_tree\*.sbr        \
293         plugins\unistim\*.sbr           \
294         plugins\wimax\*.sbr             \
295         plugins\wimaxasncp\*.sbr        \
296         plugins\wimaxmacphy\*.sbr       \
297         ui\*.sbr                        \
298         ui\cli\*.sbr                    \
299         ui\gtk\*.sbr                    \
300         ui\win32\*.sbr                  \
301         wiretap\*.sbr                   \
302         wsutil\*.sbr
303         $(BSCMAKE) @<<
304                 /o $@ $?
305 <<
306 !ELSE
307 wireshark.bsc:
308 !ENDIF
309
310 pdb_zip: all
311         cd $(INSTALL_DIR)
312         rm -f ../[Ww]ireshark-pdb-$(WIRESHARK_TARGET_PLATFORM)-$(VERSION).zip
313         zip -9 ../Wireshark-pdb-$(WIRESHARK_TARGET_PLATFORM)-$(VERSION).zip *.pdb *.lib
314         cd ..
315
316 $(RESOURCES): image
317
318 ## Note: The proper "SUBSYSTEM" link option to be used for linking each of the Wireshark executables
319 ##       is specified in '$(guiflags)' or '$(conflags)' as used as part of the link options.
320 ##       (These variables are defined in win32.mak).
321 filetap\filetap-$(FTAP_VERSION).lib: image $(ZLIB_DLL) filetap
322 wiretap\wiretap-$(WTAP_VERSION).lib: image $(ZLIB_DLL) wiretap
323
324 wireshark.exe   : $(LIBS_CHECK) config.h $(wireshark_OBJECTS) codecs epan ui gtk win32 image\wireshark.res image\file_dlg_win32.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
325         @echo Linking $@
326         $(LINK) @<<
327                 /OUT:$(PROGRAM_NAME).exe $(guiflags) $(guilibsdll) $(LDFLAGS) /LARGEADDRESSAWARE $(wireshark_LIBS) $(GTK_LIBS) codecs\codecs.lib ui\gtk\libgtkui.lib ui\win32\libgtkui_win32.lib ui\libui.lib $(wireshark_OBJECTS) image\wireshark.res image\file_dlg_win32.res
328 <<
329 !IFDEF MANIFEST_INFO_REQUIRED
330         mt.exe -nologo -manifest "wireshark.exe.manifest" -outputresource:$(PROGRAM_NAME).exe;1
331 !ENDIF
332
333 qtshark.exe     : install-generated-files $(LIBS_CHECK) config.h epan ui qt wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib plugins
334
335 tshark.exe      : $(LIBS_CHECK) config.h $(tshark_OBJECTS) epan ui cli image\tshark.res wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib plugins
336         @echo Linking $@
337         $(LINK) @<<
338                 /OUT:tshark.exe $(conflags) $(conlibsdll) $(LDFLAGS) /LARGEADDRESSAWARE $(tshark_LIBS) $(tshark_OBJECTS) ui\cli\libcliui.lib ui\libui.lib image\tshark.res
339 <<
340 !IFDEF MANIFEST_INFO_REQUIRED
341         mt.exe -nologo -manifest "tshark.exe.manifest" -outputresource:tshark.exe;1
342 !ENDIF
343
344 tfshark.exe     : $(LIBS_CHECK) config.h $(tfshark_OBJECTS) epan ui cli image\tfshark.res wsutil\libwsutil.lib filetap\filetap-$(FTAP_VERSION).lib plugins
345         @echo Linking $@
346         $(LINK) @<<
347                 /OUT:tfshark.exe $(conflags) $(conlibsdll) $(LDFLAGS) /LARGEADDRESSAWARE $(tfshark_LIBS) $(tfshark_OBJECTS) ui\cli\libcliui.lib ui\libui.lib image\tfshark.res
348 <<
349 !IFDEF MANIFEST_INFO_REQUIRED
350         mt.exe -nologo -manifest "tfshark.exe.manifest" -outputresource:tfshark.exe;1
351 !ENDIF
352
353 rawshark.exe    : $(LIBS_CHECK) config.h $(rawshark_OBJECTS) epan ui image\rawshark.res wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib plugins
354         @echo Linking $@
355         $(LINK) @<<
356                 /OUT:rawshark.exe $(conflags) $(conlibsdll) $(LDFLAGS) /LARGEADDRESSAWARE $(rawshark_LIBS) $(rawshark_OBJECTS) ui\libui.lib image\rawshark.res
357 <<
358 !IFDEF MANIFEST_INFO_REQUIRED
359         mt.exe -nologo -manifest "rawshark.exe.manifest" -outputresource:rawshark.exe;1
360 !ENDIF
361
362 # Linking with setargv.obj enables "wildcard expansion" of command-line arguments
363 capinfos.exe    : $(LIBS_CHECK) config.h $(capinfos_OBJECTS) wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib image\capinfos.res
364         @echo Linking $@
365         $(LINK) @<<
366                 /OUT:capinfos.exe $(conflags) $(conlibsdll) $(LDFLAGS) $(capinfos_OBJECTS) $(capinfos_LIBS) setargv.obj image\capinfos.res
367 <<
368 !IFDEF MANIFEST_INFO_REQUIRED
369         mt.exe -nologo -manifest "capinfos.exe.manifest" -outputresource:capinfos.exe;1
370 !ENDIF
371
372 # Linking with setargv.obj enables "wildcard expansion" of command-line arguments
373 captype.exe     : $(LIBS_CHECK) config.h $(captype_OBJECTS) wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib image\captype.res
374         @echo Linking $@
375         $(LINK) @<<
376                 /OUT:captype.exe $(conflags) $(conlibsdll) $(LDFLAGS) $(captype_OBJECTS) $(captype_LIBS) setargv.obj image\captype.res
377 <<
378 !IFDEF MANIFEST_INFO_REQUIRED
379         mt.exe -nologo -manifest "captype.exe.manifest" -outputresource:captype.exe;1
380 !ENDIF
381
382 editcap.exe     : $(LIBS_CHECK) config.h $(editcap_OBJECTS) wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib image\editcap.res
383         @echo Linking $@
384         $(LINK) @<<
385                 /OUT:editcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) $(editcap_OBJECTS) $(editcap_LIBS) image\editcap.res
386 <<
387 !IFDEF MANIFEST_INFO_REQUIRED
388         mt.exe -nologo -manifest "editcap.exe.manifest" -outputresource:editcap.exe;1
389 !ENDIF
390
391 # Linking with setargv.obj enables "wildcard expansion" of command-line arguments
392 mergecap.exe    : $(LIBS_CHECK)  config.h $(mergecap_OBJECTS) wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib image\mergecap.res
393         @echo Linking $@
394         $(LINK) @<<
395                 /OUT:mergecap.exe $(conflags) $(conlibsdll) $(LDFLAGS) $(mergecap_OBJECTS) $(mergecap_LIBS) image\mergecap.res
396 <<
397 !IFDEF MANIFEST_INFO_REQUIRED
398         mt.exe -nologo -manifest "mergecap.exe.manifest" -outputresource:mergecap.exe;1
399 !ENDIF
400
401 reordercap.exe  : $(LIBS_CHECK)  config.h reordercap.obj wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib image\reordercap.res
402         @echo Linking $@
403         $(LINK) @<<
404                 /OUT:reordercap.exe $(conflags) $(conlibsdll) $(LDFLAGS) reordercap.obj $(reordercap_LIBS) setargv.obj image\reordercap.res
405 <<
406 !IFDEF MANIFEST_INFO_REQUIRED
407         mt.exe -nologo -manifest "reordercap.exe.manifest" -outputresource:reordercap.exe;1
408 !ENDIF
409
410 text2pcap.exe   : $(LIBS_CHECK) config.h text2pcap.obj text2pcap-scanner.obj pcapio.obj wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib image\text2pcap.res
411         @echo Linking $@
412         $(LINK) @<<
413                 /OUT:text2pcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) text2pcap.obj text2pcap-scanner.obj pcapio.obj $(text2pcap_LIBS) image\text2pcap.res
414 <<
415 !IFDEF MANIFEST_INFO_REQUIRED
416         mt.exe -nologo -manifest "text2pcap.exe.manifest" -outputresource:text2pcap.exe;1
417 !ENDIF
418
419 dftest.exe      : $(dftest_OBJECTS) epan ui
420         @echo Linking $@
421         $(LINK) @<<
422                 /OUT:dftest.exe $(conflags) $(conlibsdll) $(LDFLAGS) $(dftest_LIBS) ui\libui.lib $(dftest_OBJECTS)
423 <<
424 !IFDEF MANIFEST_INFO_REQUIRED
425         mt.exe -nologo -manifest "dftest.exe.manifest" -outputresource:dftest.exe;1
426 !ENDIF
427
428 randpkt.exe     : $(randpkt_OBJECTS)
429         @echo Linking $@
430         $(LINK) @<<
431                 /OUT:randpkt.exe $(conflags) $(conlibsdll) $(LDFLAGS) $(randpkt_LIBS) $(randpkt_OBJECTS)
432 <<
433 !IFDEF MANIFEST_INFO_REQUIRED
434         mt.exe -nologo -manifest "randpkt.exe.manifest" -outputresource:randpkt.exe;1
435 !ENDIF
436
437 dumpcap.exe     : $(LIBS_CHECK) config.h $(dumpcap_OBJECTS) wsutil\libwsutil.lib image\dumpcap.res
438         @echo Linking $@
439         $(LINK) @<<
440                 /OUT:dumpcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) $(dumpcap_LIBS) $(dumpcap_OBJECTS) image\dumpcap.res
441 <<
442 !IFDEF MANIFEST_INFO_REQUIRED
443         mt.exe -nologo -manifest "dumpcap.exe.manifest" -outputresource:dumpcap.exe;1
444 !ENDIF
445
446
447 config.h        : config.h.win32 config.nmake
448         sed -e s/@VERSION@/$(VERSION)/ \
449             -e s/@VERSION_MAJOR@/$(VERSION_MAJOR)/ \
450             -e s/@VERSION_MINOR@/$(VERSION_MINOR)/ \
451             -e s/@VERSION_MICRO@/$(VERSION_MICRO)/ \
452             -e "s/@HAVE_C_ARES@/$(C_ARES_CONFIG)/" \
453             -e "s/@HAVE_GNU_ADNS@/$(ADNS_CONFIG)/" \
454             -e "s/@HAVE_KFW@/$(KFW_CONFIG)/" \
455             -e "s/@HAVE_NETTLE@/$(NETTLE_CONFIG)/" \
456             -e "s/@HAVE_LIBZ@/$(ZLIB_CONFIG)/" \
457             -e "s/@HAVE_LIBPCAP@/$(WINPCAP_CONFIG)/" \
458             -e "s/@HAVE_PCAP_FINDALLDEVS@/$(PCAP_FINDALLDEVS_CONFIG)/" \
459             -e "s/@HAVE_PCAP_DATALINK_NAME_TO_VAL@/$(PCAP_DATALINK_NAME_TO_VAL_CONFIG)/" \
460             -e "s/@HAVE_PCAP_DATALINK_VAL_TO_NAME@/$(PCAP_DATALINK_VAL_TO_NAME_CONFIG)/" \
461             -e "s/@HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION@/$(PCAP_DATALINK_VAL_TO_DESCRIPTION_CONFIG)/" \
462             -e "s/@HAVE_PCAP_BREAKLOOP@/$(PCAP_BREAKLOOP_CONFIG)/" \
463             -e "s/@HAVE_REMOTE@/$(PCAP_HAVE_REMOTE_CONFIG)/" \
464             -e "s/@HAVE_PCAP_REMOTE@/$(PCAP_REMOTE_CONFIG)/" \
465             -e "s/@HAVE_PCAP_OPEN@/$(PCAP_OPEN_CONFIG)/" \
466             -e "s/@HAVE_PCAP_OPEN_DEAD@/$(PCAP_OPEN_DEAD_CONFIG)/" \
467             -e "s/@HAVE_PCAP_LIST_DATALINKS@/$(PCAP_LIST_DATALINKS_CONFIG)/" \
468             -e "s/@HAVE_PCAP_FREE_DATALINKS@/$(PCAP_FREE_DATALINKS_CONFIG)/" \
469             -e "s/@HAVE_PCAP_SET_DATALINK@/$(PCAP_SET_DATALINK_CONFIG)/" \
470             -e "s/@HAVE_PCAP_SETSAMPLING@/$(PCAP_SETSAMPLING_CONFIG)/" \
471             -e "s/@HAVE_BPF_IMAGE@/$(BPF_IMAGE_CONFIG)/" \
472             -e "s/@HAVE_LIBGNUTLS@/$(GNUTLS_CONFIG)/" \
473             -e "s/@HAVE_LIBGCRYPT@/$(LIBGCRYPT_CONFIG)/" \
474             -e "s/@HAVE_LUA@/$(LUA_CONFIG)/" \
475             -e "s/@HAVE_LUA@/$(LUA_VERSION)/" \
476             -e "s/@HAVE_PYTHON@/$(PYTHON_CONFIG)/" \
477             -e "s/@HAVE_AIRPCAP@/$(AIRPCAP_CONFIG)/" \
478             -e "s/@HAVE_AIRPDCAP@/$(AIRPDCAP_CONFIG)/" \
479             -e "s/@HAVE_LIBPORTAUDIO@/$(PORTAUDIO_CONFIG)/" \
480             -e "s/@PORTAUDIO_API_1@/$(PORTAUDIO_API_CONFIG)/" \
481             -e "s/@HAVE_SMI@/$(SMI_CONFIG)/" \
482             -e "s/@HAVE_GEOIP@/$(GEOIP_CONFIG)/" \
483             -e "s/@HAVE_GEOIP_V6@/$(GEOIP_V6_CONFIG)/" \
484             -e "s/@HAVE_SOFTWARE_UPDATE@/$(WINSPARKLE_CONFIG)/" \
485             -e "s/@INET6@/$(INET6_CONFIG)/" \
486             -e "s/@HAVE_NTDDNDIS_H@/$(NTDDNDIS_CONFIG)/" \
487             -e "s/@PCAP_NG_DEFAULT@/$(PCAP_NG_DEFAULT)/" \
488             -e "s/@WANT_PACKET_EDITOR@/$(WANT_PACKET_EDITOR)/" \
489             < config.h.win32 > $@
490
491 ui\qt\config.pri: config.nmake Makefile.nmake
492         @echo Creating <<ui\qt\config.pri
493 # Automatically generated from Makefile.nmake. Edit there, not here.
494 # qmake apparently requires a three-part numeric VERSION.
495 PROGRAM_NAME = $(PROGRAM_NAME)
496 VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_MICRO)
497 VERSION_FULL = $(VERSION)
498 WTAP_VERSION = $(WTAP_VERSION)
499 INSTALL_DIR = $(INSTALL_DIR)
500 !IFDEF MANIFEST_INFO_REQUIRED
501 CONFIG += wireshark_manifest_info_required
502 !ENDIF
503 !IFDEF KFW_DIR
504 CONFIG += wireshark_use_kfw
505 !ENDIF
506 WIRESHARK_LIB_DIR = $(WIRESHARK_LIB_DIR:\=/)
507 GLIB_DIR = $(GTK_DIR:\=/)
508 C_ARES_DIR = $(C_ARES_DIR:\=/)
509 ZLIB_DIR = $(ZLIB_DIR:\=/)
510 GNUTLS_DIR = $(GNUTLS_DIR:\=/)
511 SMI_DIR = $(SMI_DIR:\=/)
512 KFW_DIR = $(KFW_DIR:\=/)
513 LUA_DIR = $(LUA_DIR:\=/)
514 GEOIP_DIR = $(GEOIP_DIR:\=/)
515 WINSPARKLE_DIR = $(WINSPARKLE_DIR:\=/)
516
517 INTL_DLL = $(INTL_DLL)
518
519 guilibsdll = $(guilibsdll)
520
521 HHC_LIBS = $(HHC_LIBS)
522
523 SH = $(SH)
524 PYTHON = $(PYTHON)
525
526 MSVC_VARIANT = $(MSVC_VARIANT)
527 MSVCR_DLL = "$(MSVCR_DLL:\=/)"
528
529 QMAKE_CFLAGS         *= $(STANDARD_CFLAGS)
530 # NOMINMAX keeps windows.h from defining "min" and "max" via windef.h.
531 # This avoids conflicts with the C++ standard library.
532 QMAKE_CXXFLAGS       *= $(STANDARD_CFLAGS) /DNOMINMAX
533 QMAKE_LFLAGS         *= /LARGEADDRESSAWARE $(LDFLAGS)
534
535 <<KEEP
536
537 #
538 # Build the version string
539 #
540 # XXX - Makefile.am uses FORCE for this.
541 !IF EXIST(".git/index")
542 GITINDEX = .git/index
543 !ELSE IF EXIST(".svn/wc.db")
544 GITINDEX = .svn/wc.db
545 !ELSE IF EXIST(".svn/entries")
546 GITINDEX = .svn/entries
547 !ELSE
548 GITINDEX =
549 !ENDIF
550 version.h: $(GITINDEX)
551         rm -f version.h
552         $(PERL) make-version.pl
553
554
555 text2pcap-scanner.c : text2pcap-scanner.l
556         $(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
557
558 text2pcap-scanner.obj : text2pcap-scanner.c
559         $(CC) $(GENERATED_CFLAGS) -Fd.\ -c $?
560
561 #
562 # The following targets will rebuild their respective objs
563 # if and when version.h should change.
564 #
565 text2pcap.obj mergecap.obj capinfos.obj captype.obj editcap.obj reordercap.obj version_info.obj: version.h
566
567
568 clean-local:
569         rm -f $(wireshark_OBJECTS) $(tshark_OBJECTS) $(tfshark_OBJECTS) $(dumpcap_OBJECTS) $(rawshark_OBJECTS) \
570                 $(EXECUTABLES) *.pdb *.sbr *.exe.manifest \
571                 capinfos.obj capinfos.exp capinfos.lib \
572                 captype.obj captype.exp captype.lib \
573                 editcap.obj editcap.exp editcap.lib \
574                 mergecap.obj text2pcap.obj \
575                 reordercap.obj nio-ie5.obj update.obj \
576                 text2pcap-scanner.obj text2pcap-scanner.c \
577                 config.h ps.c $(LIBS_CHECK) \
578                 dftest.obj dftest.exe randpkt.obj randpkt.exe \
579                 doxygen.cfg \
580                 $(RESOURCES) libwireshark.dll wiretap-$(WTAP_VERSION).dll \
581                 libwsutil.dll \
582                 wireshark.bsc
583         rm -rf $(INSTALL_DIR)
584         rm -rf wireshark-qt-release
585
586 clean: clean-local
587         cd asn1
588         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
589         cd ../wiretap
590         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
591         cd ../wsutil
592         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
593         cd ../filetap
594         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
595         cd ../codecs
596         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
597         cd ../ui
598         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
599         cd gtk
600         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
601 !IFDEF QT5_BASE_DIR
602         cd ../qt
603         -$(MAKE) clean
604 !ENDIF
605         cd ../win32
606         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
607         cd ../cli
608         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
609         cd ../../epan
610         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
611         cd ../plugins
612         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
613         cd ../tools
614         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
615         cd ../image
616         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
617         cd ../doc
618         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
619         cd ../docbook
620         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
621         cd ../help
622         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
623         cd ../packaging/nsis
624         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
625         cd ../portableapps/win32
626         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
627         cd ../../..
628
629 # "distclean" removes all files not part of the distribution.
630 # It does not remove generated files that are part of the distribution.
631 distclean-local: clean-local
632 !IFDEF ADNS_DIR
633         rm -f $(ADNS_DLL) $(ADNS_LIBS)
634 !ENDIF
635 !IFDEF ZLIB_DIR
636         rm -f $(ZLIB_DLL) $(ZLIB_DIR)\zlib1.dll.manifest \
637                 $(ZLIB_DIR)\include\zlib.h $(ZLIB_DIR)\include\zconf.h \
638                 $(ZLIB_DIR)\lib\zdll.lib
639 !ENDIF
640         rm -f config.h $(BUILT_SOURCES) wireshark-pdb*.zip
641
642 distclean: distclean-local
643         cd wiretap
644         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
645         cd ../filetap
646         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
647         cd ../wsutil
648         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
649         cd ../codecs
650         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
651         cd ../ui
652         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
653         cd gtk
654         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
655 !IFDEF QT5_BASE_DIR
656         cd ../qt
657         -$(MAKE) distclean
658 !ENDIF
659         cd ../win32
660         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
661         cd ../cli
662         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
663         cd ../../epan
664         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
665         cd ../plugins
666         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
667         cd ../tools
668         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
669         cd ../image
670         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
671         cd ../doc
672         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
673         cd ../docbook
674         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
675         cd ../help
676         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
677         cd ../packaging/nsis
678         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
679         cd ../portableapps/win32
680         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
681         cd ../../..
682
683 # Make "maintainer-clean" only if you would like to remove ALL generated
684 # files.
685 # Be sure to have python and perl installed to regenerate them.
686 maintainer-clean-local: distclean-local
687         rm -f $(GENERATED_FILES)
688
689 maintainer-clean: maintainer-clean-local
690         cd wiretap
691         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
692         cd ../filetap
693         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
694         cd ../wsutil
695         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
696         cd ../codecs
697         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
698         cd ../ui
699         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
700         cd gtk
701         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
702 !IFDEF QT5_BASE_DIR
703         cd ../qt
704         -$(MAKE) distclean
705 !ENDIF
706         cd ../win32
707         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
708         cd ../cli
709         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
710         cd ../../epan
711         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
712         cd ../plugins
713         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
714         cd ../tools
715         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
716         cd ../image
717         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
718         cd ../doc
719         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
720         cd ../docbook
721         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
722         cd ../help
723         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
724         cd ../packaging/nsis
725         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
726         cd ../portableapps/win32
727         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
728         cd ../../..
729
730 tools::
731         cd tools
732         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
733         cd ..
734
735 image::
736         cd image
737         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
738         cd ..
739
740 !IFDEF ADNS_DIR
741 # MSVC variants supported by Wireshark have to avoid indirectly using msvcrt.dll,
742 # therefore compile the adns dll from source ADNS_DIR package.
743 # To avoid path problems, copy the adns sources to a temp dir,
744 # compile and copy the resulting files back to (source) ADNS_DIR
745 #
746 # Unfortunately:
747 # - we need to "patch" adns_dll.rep and adns_dll.rc (at least for MSVC2005EE)
748 #
749 $(ADNS_DLL):
750         xcopy $(ADNS_DIR) adns.tmp /D /I /E /Y
751         copy adns_dll.dep adns.tmp\adns_win32\adns_dll
752         copy adns_dll.rc adns.tmp\adns_win32\adns_dll
753         cd adns.tmp\adns_win32\adns_dll
754         set CFG=adns_dll - Win32 Release
755         $(MAKE) /$(MAKEFLAGS) -f adns_dll.mak LOC="$(LOCAL_CFLAGS)"
756         cd ..\lib
757 !IFDEF MANIFEST_INFO_REQUIRED
758         mt.exe -nologo -manifest "adns_dll.dll.manifest" -outputresource:adns_dll.dll;2
759 !ENDIF
760         if not exist "$(WIRESHARK_LIB_DIR)\$(MSVC_VARIANT)\adns" mkdir "$(WIRESHARK_LIB_DIR)\$(MSVC_VARIANT)\adns"
761         copy adns_dll.dll $(ADNS_DLL)
762         copy adns_dll.lib $(ADNS_LIBS)
763         cd ..\..\..
764         rm -r -f adns.tmp
765 !ENDIF
766
767 !IFDEF ZLIB_DIR
768 # MSVC variants supported by Wireshark have to avoid indirectly using msvcrt.dll,
769 # therefore compile the zlib dll from source ZLIB_DIR package.
770 # To avoid path problems, copy the zlib sources to a temp dir,
771 # compile and copy the resulting files back to (source) ZLIB_DIR
772 $(ZLIB_DLL):
773         xcopy $(ZLIB_DIR) zlib.tmp /D /I /E /Y
774         cd zlib.tmp
775 !if "$(WIRESHARK_TARGET_PLATFORM)" == "win32"
776         $(MAKE) /$(MAKEFLAGS) -f win32/Makefile.msc zlib1.dll LOC="-DASMV -DASMINF" OBJA="inffas32.obj match686.obj"
777 !else
778         $(MAKE) /$(MAKEFLAGS) -f win32/Makefile.msc zlib1.dll AS=ml64 LOC="-DASMV -DASMINF" OBJA="inffasx64.obj gvmat64.obj inffas8664.obj"
779 !endif
780         if not exist $(ZLIB_DIR) mkdir $(ZLIB_DIR)
781         if not exist $(ZLIB_DIR)\lib mkdir $(ZLIB_DIR)\lib
782         if not exist $(ZLIB_DIR)\include mkdir $(ZLIB_DIR)\include
783 !IFDEF MANIFEST_INFO_REQUIRED
784         mt.exe -nologo -manifest "zlib1.dll.manifest" -outputresource:zlib1.dll;2
785 !ENDIF
786         copy zlib1.dll $(ZLIB_DIR)
787         copy zdll.lib $(ZLIB_DIR)\lib
788         copy zconf.h $(ZLIB_DIR)\include
789         copy zlib.h $(ZLIB_DIR)\include
790         cd ..
791         rm -r -f zlib.tmp
792 !ENDIF
793
794 wsutil::
795         cd wsutil
796         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
797         cd ..
798
799 wiretap::
800         cd wiretap
801         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
802         cd ..
803
804 filetap::
805         cd filetap
806         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
807         cd ..
808
809 codecs::
810         cd codecs
811         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
812         cd ..
813
814 ui:: help config.h version.h doxygen
815         cd ui
816         $(MAKE) /$(MAKEFLAGS) /f Makefile.nmake libui.lib
817         cd ..
818
819 gtk:: help config.h version.h doxygen
820         cd ui/gtk
821         $(MAKE) /$(MAKEFLAGS) /f Makefile.nmake libgtkui.lib
822         cd ../..
823
824 # The Visual C++ static analyzer currently fails with error C2171
825 # when compiling summary_dialog.cpp. If/when this ever gets fixed
826 # we can remove the ENABLE_CODE_ANALYSIS check.
827 qt:: help config.h version.h doxygen
828 !IFDEF QT5_BASE_DIR
829         cd ui/qt
830         $(QT5_BASE_DIR)\bin\qmake CONFIG+=release QtShark.pro
831 !IFDEF ENABLE_CODE_ANALYSIS
832         -nmake
833 !ELSE
834         nmake
835 !ENDIF
836         cd ../..
837 !ENDIF
838
839 win32::
840         cd ui/win32
841         $(MAKE) /$(MAKEFLAGS) /f Makefile.nmake libgtkui_win32.lib
842         cd ../..
843
844 cli:: help config.h version.h doxygen
845         cd ui/cli
846         $(MAKE) /$(MAKEFLAGS) /f Makefile.nmake libcliui.lib
847         cd ../..
848
849 epan:: $(RESOURCES) $(ZLIB_DLL) wiretap\wiretap-$(WTAP_VERSION).lib filetap\filetap-$(FTAP_VERSION).lib $(BUILT_SOURCES) doxygen
850         cd epan
851         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
852         cd ..
853
854 plugins::
855         cd plugins
856         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
857         cd ..
858
859 doc::
860         cd doc
861         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
862         cd ..
863
864 docbook::
865         cd docbook
866         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
867         cd ..
868
869 help::
870         cd help
871         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
872         cd ..
873
874 doxygen.cfg: config.nmake doxygen.cfg.in
875         sed -e s/@VERSION@/$(VERSION)/ \
876             < doxygen.cfg.in > $@
877
878 doxygen-run:
879 !IFDEF DOXYGEN
880         $(DOXYGEN) doxygen.cfg
881 !ENDIF
882
883 doxygen: doxygen.cfg doxygen-run
884
885 services: tools\make-services.py
886         $(PYTHON) tools/make-services.py
887
888 ################################################################################
889 # Prepare build environment by downloading and installing required libraries
890 ################################################################################
891
892 # The required tools to build Wireshark.
893 #
894 # The 'find' tool is available both in \WINNT\System32 and in cygwin's /usr/bin.
895 # We only need the cygwin version (for some shell scripts).
896 # In the PATH, System32 is before cygwin's dir, so explicitly check for /usr/bin/find.
897 REQUIRED_TOOLS=\
898         $(CC) \
899         $(LINK) \
900         nmake \
901 !IFDEF MANIFEST_INFO_REQUIRED
902         --windowsonly mt        \
903 !ENDIF
904         $(SH_PROG)      \
905         $(YACC) \
906         $(LEX)  \
907         env     \
908         grep    \
909         --cygwinonly /usr/bin/find      \
910         peflags \
911         $(PERL) \
912         $(PYTHON)       \
913 !IFDEF QT5_BASE_DIR
914         --windowsonly $(QT5_BASE_DIR)\bin\qmake \
915 !ENDIF
916         sed     \
917         unzip   \
918         wget
919
920 verify_tools:
921 # As win-setup.sh assumes the dir exists create it if it doesn't
922         @if not exist "$(WIRESHARK_LIB_DIR)" md "$(WIRESHARK_LIB_DIR)"
923         @$(SH) $(WIN_SETUP) --appverify $(REQUIRED_TOOLS)
924
925 # Targets and etc used to verify or download libraries
926
927 !IFNDEF WIN_SETUP_OPT
928 WIN_SETUP_OPT=--download
929 !ENDIF
930
931 # Verify that the required library 'package' (zip) files have been downloaded.
932 # (It seems reasonable to assume that if the files have been downloaded
933 #  then they have been installed).
934 check_libs:
935         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake WIN_SETUP_OPT=--libverify process_libs
936
937 # Verify library packages:
938 #  If $(CHECK_TAG) is non-null then checktag failed; Exit with an error message. (See beginning of this Makefile).
939 #  Otherwise do detailed library package files verification only if Makefile.nmake or config.make have been updated
940 #  (or dummy file doesn't exist because of 'make clean' or whatever).
941 #  Note that the creation/modification time of a file after a git pull of that file
942 #   is the time of the update (not the time of the file in the repository).
943 # touch is only called if libverify succeeds.
944 $(LIBS_CHECK):  $(CHECK_TAG) config.nmake Makefile.nmake
945         @echo  Verifying library package files ...
946         @$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake WIN_SETUP_OPT=--libverify process_libs
947         @touch $@
948
949 # Target for "checktag failed" (libraries not up to date).
950 # Defined only if "checktag" failed (see beginning of this Makefile).
951 !IF "$(CHECK_TAG)" != ""
952 $(CHECK_TAG): _FORCE_
953         @echo \? Wireshark Libraries not up-to-date \?
954         @echo \? Do you need to run "nmake -f Makefile.nmake setup" \?
955         @echo.
956         @exit 1
957
958 !ENDIF
959
960 # Download (if needed) and install all the required libraries into WIRESHARK_LIB_DIR.
961 # A clean_setup is done first to ensure that the target dirs don't
962 # contain old files remaining from a previous setup run.
963 setup: verify_tools clean_setup process_libs
964
965 install_qt:
966         $(SH) $(WIN_SETUP) --download "C:\Qt" \
967                 . Qt-5.1.1-MSVC2010-$(WIRESHARK_TARGET_PLATFORM)-ws.zip
968         
969 # The process_libs target when invoked causes either a --libverify or a --download for all the required libraries.
970 # (The choice is determined by the value of the macro WIN_SETUP_OPT).
971 process_libs:
972         @if not exist "$(WIRESHARK_LIB_DIR)" md "$(WIRESHARK_LIB_DIR)"
973         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
974                 . WinPcap_$(WINPCAP_VERSION).exe
975 !IFNDEF QT5_BASE_DIR
976 !MESSAGE Can't find Qt. This will become a problem at some point.
977 !ENDIF
978 !IFDEF GTK_DIR
979         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
980                 "$(GTK_NAME)" gtk+-bundle_$(GTK_PKG)_$(WIRESHARK_TARGET_PLATFORM)$(PKG_SUFIX).zip
981 !ENDIF
982 !IFDEF KFW_DIR
983         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
984                 . kfw-3-2-2-i386-ws-vc6.zip
985 #       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
986 #               . kfw-3-2-2.zip
987 !ENDIF
988 !IFDEF PCAP_DIR
989         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
990                 . WpdPack_$(WPD_VERSION).zip
991 !ENDIF
992 !IFDEF AIRPCAP_DIR
993         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
994                 AirPcap_Devpack_4_1_0_1622 AirPcap_Devpack_4_1_0_1622.zip
995 !ENDIF
996 !IFDEF C_ARES_DIR
997         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
998                 . c-ares-$(C_ARES_PKG)-$(WIRESHARK_TARGET_PLATFORM)ws.zip
999 !ENDIF
1000 !IFDEF ADNS_DIR
1001         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
1002                 . adns-1.0-win32-05ws.zip
1003 !ENDIF
1004 !IFDEF ZLIB_DIR
1005         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
1006 !if "$(WIRESHARK_TARGET_PLATFORM)" == "win32"
1007                 zlib125 zlib-1.2.5.zip
1008 !else
1009                 zlib125 zlib125ws.zip
1010 !endif
1011 !ENDIF
1012 !IFDEF LUA_DIR
1013         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
1014                 lua5.1.4 lua$(LUA_DIST)_lib.zip
1015 !ENDIF
1016
1017 !IFDEF GNUTLS_PKG
1018         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
1019                 . gnutls-$(GNUTLS_PKG)-$(WIRESHARK_TARGET_PLATFORM)ws.zip
1020 !ENDIF
1021 !IFDEF PORTAUDIO_DIR
1022         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
1023                 . portaudio_v19_2.zip
1024 !ENDIF
1025 !IFDEF SMI_DIR
1026         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
1027                 . libsmi-$(SMI_PKG)-$(WIRESHARK_TARGET_PLATFORM)ws.zip
1028 !ENDIF
1029 !IFDEF GEOIP_DIR
1030         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
1031                 GeoIP-$(GEOIP_PKG)-$(WIRESHARK_TARGET_PLATFORM)ws GeoIP-$(GEOIP_PKG)-$(WIRESHARK_TARGET_PLATFORM)ws.zip
1032 !ENDIF
1033 !IFDEF WINSPARKLE_DIR
1034         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
1035                 . WinSparkle-$(WINSPARKLE_PKG).zip
1036 !ENDIF
1037 !IFDEF HHC_DIR
1038         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
1039                 user-guide user-guide-52567.zip
1040 !ENDIF
1041 !IFDEF UPX
1042         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
1043                 . upx303w.zip
1044 !ENDIF
1045 !IFDEF NASM
1046         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIB_DIR)" \
1047                 . nasm-2.09.08-win32.zip
1048 !ENDIF
1049 !IF "$(WIN_SETUP_OPT)" == "--download"
1050         @$(SH) $(WIN_SETUP) --settag "$(WIRESHARK_LIB_DIR)"
1051 !ENDIF
1052         @echo.
1053         @echo Wireshark is ready to build.
1054
1055 # Cleanup files installed by the setup target. It will not remove the
1056 # downloaded zip files.
1057 # WHEN UPDATING LIBRARY VERSIONS, KEEP ALSO ONE FORMER VERSION SO
1058 # UPDATING REMOVES THE FORMER USER DIRS
1059 clean_setup:
1060         cd "$(WIRESHARK_LIB_DIR)"
1061         rm -r -f adns-1.0-win32-05ws
1062         rm -r -f c-ares-1.5.3ws
1063         rm -r -f c-ares-1.6.0ws
1064         rm -r -f c-ares-1.7.0-win??ws
1065         rm -r -f c-ares-1.7.1-win??ws
1066         rm -r -f c-ares-1.9.1-1-win??ws
1067         rm -r -f gettext-0.14.5
1068         rm -r -f gettext-runtime-0.17
1069         rm -r -f gettext-runtime-0.17-1
1070         rm -r -f gettext-0.17-1            # win64
1071         rm -r -f glib
1072         rm -r -f gnutls-2.8.1-1
1073         rm -r -f gnutls-2.8.5-*-win??ws
1074         rm -r -f gnutls-2.10.3-*-win??ws
1075         rm -r -f gnutls-2.12.18-*-win??ws
1076 !IF "$(GTK_NAME)" == "gtk2"
1077         rm -r -f gtk2
1078 !ELSE
1079         rm -r -f gtk3
1080 !ENDIF
1081         rm -r -f gtk+
1082         rm -r -f gtk-wimp
1083         rm -r -f kfw-2.5
1084         rm -r -f kfw-3-2-2-final
1085         rm -r -f kfw-3.2.2-ws1
1086         rm -r -f kfw-3-2-2-i386-ws-vc6
1087         rm -r -f libiconv-1.9.1.bin.woe32
1088         rm -r -f lua5.1
1089         rm -r -f lua5.1.4
1090         rm -r -f libsmi-0.4.5
1091         rm -r -f libsmi-0.4.8
1092         rm -r -f libsmi-svn-40773-win??ws
1093         rm -r -f nasm-2.00
1094         rm -r -f nasm-2.02
1095         rm -r -f nasm-2.09.08
1096         rm -r -f pcre-6.4
1097         rm -r -f pcre-7.0
1098         rm -r -f portaudio_v19
1099         rm -r -f portaudio_v19_2
1100         rm -r -f upx301w
1101         rm -r -f upx303w
1102         rm -r -f user-guide
1103         rm -r -f zlib123
1104         rm -r -f zlib125
1105         rm -r -f zlib-1.2.5
1106         rm -r -f zlib123-dll
1107         rm -r -f AirPcap_Devpack_1_0_0_594
1108         rm -r -f AirPcap_Devpack_4_0_0_1480
1109         rm -r -f AirPcap_Devpack_4_1_0_1622
1110         rm -r -f GeoIP-1.4.5ws
1111         rm -r -f GeoIP-1.4.6-win??ws
1112         rm -r -f GeoIP-1.4.8-win??ws
1113         rm -r -f GeoIP-1.4.8-*-win??ws
1114         rm -r -f GeoIP-1.5.1-*-win??ws
1115         rm -r -f WinSparkle-0.3-44-g2c8d9d3-win??ws
1116         rm -r -f WpdPack
1117         cd "$(MAKEDIR)"
1118
1119 ################################################################################
1120 # Prepare the debug trees for running Wireshark/Tshark from there.
1121 ################################################################################
1122
1123
1124 # prepare debugging of Wireshark in INSTALL_DIR
1125 debug-wireshark: wireshark.exe install-generated-files
1126
1127 # prepare debugging of tshark in INSTALL_DIR
1128 debug-tshark: tshark.exe install-generated-files
1129
1130 # prepare debugging of tfshark in INSTALL_DIR
1131 debug-tfshark: tfshark.exe install-generated-files
1132
1133 # prepare debugging of rawshark in INSTALL_DIR
1134 debug-rawshark: rawshark.exe install-generated-files
1135
1136 # prepare debugging of dumpcap in INSTALL_DIR
1137 debug-dumpcap: dumpcap.exe install-generated-files
1138
1139
1140 # install generated files (exe, "our" libs, ...)
1141 install-generated-files: doc
1142         set copycmd=/y
1143         if not exist $(INSTALL_DIR) mkdir $(INSTALL_DIR)
1144 !IF DEFINED (MSVCR_DLL) && "$(MSVC_VARIANT)" == "MSVC2008"
1145         xcopy "$(MSVCR_DLL)" $(INSTALL_DIR)\*.* /d
1146 !ENDIF
1147 !IFDEF ENABLE_LIBWIRESHARK
1148         xcopy epan\libwireshark.dll $(INSTALL_DIR) /d
1149         if exist epan\libwireshark.lib xcopy .\epan\libwireshark.lib $(INSTALL_DIR) /d
1150         if exist epan\libwireshark.pdb xcopy .\epan\libwireshark.pdb $(INSTALL_DIR) /d
1151 !ENDIF
1152         xcopy ".\wiretap\wiretap-$(WTAP_VERSION).dll" $(INSTALL_DIR) /d
1153         if exist ".\wiretap\wiretap-$(WTAP_VERSION).lib" xcopy ".\wiretap\wiretap-$(WTAP_VERSION).lib" $(INSTALL_DIR) /d
1154         if exist ".\wiretap\wiretap-$(WTAP_VERSION).pdb" xcopy ".\wiretap\wiretap-$(WTAP_VERSION).pdb" $(INSTALL_DIR) /d
1155         xcopy ".\filetap\filetap-$(FTAP_VERSION).dll" $(INSTALL_DIR) /d
1156         if exist ".\filetap\filetap-$(FTAP_VERSION).lib" xcopy ".\filetap\filetap-$(FTAP_VERSION).lib" $(INSTALL_DIR) /d
1157         if exist ".\filetap\filetap-$(FTAP_VERSION).pdb" xcopy ".\filetap\filetap-$(FTAP_VERSION).pdb" $(INSTALL_DIR) /d
1158         xcopy ".\wsutil\libwsutil.dll" $(INSTALL_DIR) /d
1159         if exist ".\wsutil\libwsutil.lib" xcopy ".\wsutil\libwsutil.lib" $(INSTALL_DIR) /d
1160         if exist ".\wsutil\libwsutil.pdb" xcopy ".\wsutil\libwsutil.pdb" $(INSTALL_DIR) /d
1161         if exist $(PROGRAM_NAME).exe xcopy $(PROGRAM_NAME).exe $(INSTALL_DIR) /d
1162         if exist $(PROGRAM_NAME).pdb xcopy $(PROGRAM_NAME).pdb $(INSTALL_DIR) /d
1163         if exist $(PROGRAM_NAME).bsc xcopy $(PROGRAM_NAME).bsc $(INSTALL_DIR) /d
1164         if exist ".\docbook\user-guide.chm" xcopy ".\docbook\user-guide.chm" $(INSTALL_DIR) /d
1165         if exist capinfos.exe xcopy capinfos.exe $(INSTALL_DIR) /d
1166         if exist capinfos.pdb xcopy capinfos.pdb $(INSTALL_DIR) /d
1167         if exist captype.exe xcopy captype.exe $(INSTALL_DIR) /d
1168         if exist captype.pdb xcopy captype.pdb $(INSTALL_DIR) /d
1169         if exist dumpcap.exe xcopy dumpcap.exe $(INSTALL_DIR) /d
1170         if exist dumpcap.pdb xcopy dumpcap.pdb $(INSTALL_DIR) /d
1171         if exist editcap.exe xcopy editcap.exe $(INSTALL_DIR) /d
1172         if exist editcap.pdb xcopy editcap.pdb $(INSTALL_DIR) /d
1173         if exist mergecap.exe xcopy mergecap.exe $(INSTALL_DIR) /d
1174         if exist mergecap.pdb xcopy mergecap.pdb $(INSTALL_DIR) /d
1175         if exist reordercap.exe xcopy reordercap.exe $(INSTALL_DIR) /d
1176         if exist reordercap.pdb xcopy reordercap.pdb $(INSTALL_DIR) /d
1177         if exist rawshark.exe xcopy rawshark.exe $(INSTALL_DIR) /d
1178         if exist rawshark.pdb xcopy rawshark.pdb $(INSTALL_DIR) /d
1179         if exist text2pcap.exe xcopy text2pcap.exe $(INSTALL_DIR) /d
1180         if exist text2pcap.pdb xcopy text2pcap.pdb $(INSTALL_DIR) /d
1181         if exist tfshark.exe xcopy tfshark.exe $(INSTALL_DIR) /d
1182         if exist tfshark.pdb xcopy tfshark.pdb $(INSTALL_DIR) /d
1183         if exist tshark.exe xcopy tshark.exe $(INSTALL_DIR) /d
1184         if exist tshark.pdb xcopy tshark.pdb $(INSTALL_DIR) /d
1185         xcopy "doc\AUTHORS-SHORT" $(INSTALL_DIR) /d
1186         xcopy ".\manuf" $(INSTALL_DIR) /d
1187         xcopy ".\services" $(INSTALL_DIR) /d
1188         xcopy ".\pdml2html.xsl" $(INSTALL_DIR) /d
1189         $(TEXTIFY) "./COPYING" $(INSTALL_DIR)
1190         $(TEXTIFY) "./NEWS" $(INSTALL_DIR)
1191         $(TEXTIFY) "./README" $(INSTALL_DIR)
1192         $(TEXTIFY) "./README.windows" $(INSTALL_DIR)
1193         xcopy ".\cfilters" $(INSTALL_DIR) /d
1194         xcopy ".\colorfilters" $(INSTALL_DIR) /d
1195         xcopy ".\dfilters" $(INSTALL_DIR) /d
1196         xcopy ".\smi_modules" $(INSTALL_DIR) /d
1197 !IFDEF LUA_DIR
1198         xcopy ".\epan\wslua\init.lua" $(INSTALL_DIR) /d
1199         xcopy ".\epan\wslua\console.lua" $(INSTALL_DIR) /d
1200 !ENDIF
1201 !IFDEF PYTHON_DIR
1202         if not exist $(INSTALL_DIR)\python mkdir $(INSTALL_DIR)\python
1203         xcopy ".\epan\wspython\register-dissector.py" $(INSTALL_DIR)\python /d
1204         xcopy ".\epan\wspython\wspy_dissector.py" $(INSTALL_DIR)\python /d
1205         xcopy ".\epan\wspython\wspy_libws.py" $(INSTALL_DIR)\python /d
1206 !ENDIF
1207         xcopy ipmap.html $(INSTALL_DIR) /d
1208         xcopy doc\*.html $(INSTALL_DIR) /d
1209         if not exist $(INSTALL_DIR)\help mkdir $(INSTALL_DIR)\help
1210         xcopy ".\help\*.*" $(INSTALL_DIR)\help /d
1211 # you can't reliably use xcopy to rename files "on the fly" (so copy first, then rename)
1212         xcopy ".\help\faq.txt" $(INSTALL_DIR) /d
1213         $(UNIX2DOS) $(INSTALL_DIR)/help/*.txt
1214         if not exist $(INSTALL_DIR)\dtds mkdir $(INSTALL_DIR)\dtds
1215         xcopy ".\dtds\*.*" $(INSTALL_DIR)\dtds /d
1216         if not exist $(INSTALL_DIR)\asn1 mkdir $(INSTALL_DIR)\asn1
1217         echo create empty asn1 default.tt file to prevent problems 2> $(INSTALL_DIR)\asn1\default.tt
1218         if not exist $(INSTALL_DIR)\radius mkdir $(INSTALL_DIR)\radius
1219         xcopy ".\radius\*.*" $(INSTALL_DIR)\radius /d
1220         if not exist $(INSTALL_DIR)\diameter mkdir $(INSTALL_DIR)\diameter
1221         xcopy ".\diameter\*.dtd" $(INSTALL_DIR)\diameter /d
1222         xcopy ".\diameter\*.xml" $(INSTALL_DIR)\diameter /d
1223         if not exist $(INSTALL_DIR)\tpncp mkdir $(INSTALL_DIR)\tpncp
1224         xcopy ".\tpncp\*.dat" $(INSTALL_DIR)\tpncp /d
1225         if not exist $(INSTALL_DIR)\wimaxasncp mkdir $(INSTALL_DIR)\wimaxasncp
1226         xcopy ".\wimaxasncp\*.*" $(INSTALL_DIR)\wimaxasncp /d
1227         if not exist $(INSTALL_DIR)\plugins mkdir $(INSTALL_DIR)\plugins
1228         if not exist $(INSTALL_DIR)\plugins\$(VERSION) mkdir $(INSTALL_DIR)\plugins\$(VERSION)
1229         cd plugins
1230         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake install-plugins
1231         cd ..
1232         if not exist $(INSTALL_DIR)\profiles mkdir $(INSTALL_DIR)\profiles
1233         if not exist $(INSTALL_DIR)\profiles\Bluetooth mkdir $(INSTALL_DIR)\profiles\Bluetooth
1234         xcopy ".\profiles\Bluetooth\colorfilters" $(INSTALL_DIR)\profiles\Bluetooth /d
1235         if not exist $(INSTALL_DIR)\profiles\Classic mkdir $(INSTALL_DIR)\profiles\Classic
1236         xcopy ".\profiles\Classic\colorfilters" $(INSTALL_DIR)\profiles\Classic /d
1237
1238 # "install-all" will copy all files needed to run Wireshark/Tshark
1239 # to the INSTALL_DIR, so you can run/debug Wireshark/Tshark from there.
1240 install-all: install-generated-files
1241         set copycmd=/y
1242         if not exist $(INSTALL_DIR) mkdir $(INSTALL_DIR)
1243 !IF "$(GTK_INST_VERSION)" == "3.4" || "$(GTK_INST_VERSION)" == "3.6"
1244         xcopy $(GTK_DIR)\bin\libgdk-3-0.dll $(INSTALL_DIR) /d
1245         xcopy $(GTK_DIR)\bin\libgtk-3-0.dll $(INSTALL_DIR) /d
1246 !ELSE
1247         xcopy $(GTK_DIR)\bin\libgdk-win32-2.0-0.dll $(INSTALL_DIR) /d
1248         xcopy $(GTK_DIR)\bin\libgtk-win32-2.0-0.dll $(INSTALL_DIR) /d
1249 !ENDIF
1250         xcopy $(GTK_DIR)\bin\libgdk_pixbuf-2.0-0.dll $(INSTALL_DIR) /d
1251         xcopy $(GTK_DIR)\bin\libatk-1.0-0.dll $(INSTALL_DIR) /d
1252         xcopy $(GTK_DIR)\bin\libpango-1.0-0.dll $(INSTALL_DIR) /d
1253         xcopy $(GTK_DIR)\bin\libpangowin32-1.0-0.dll $(INSTALL_DIR) /d
1254         if not exist $(INSTALL_DIR)\lib mkdir $(INSTALL_DIR)\lib
1255         if not exist $(INSTALL_DIR)\etc mkdir $(INSTALL_DIR)\etc
1256         if not exist $(INSTALL_DIR)\$(GTK_ETC_DIR) mkdir $(INSTALL_DIR)\$(GTK_ETC_DIR)
1257         xcopy $(GTK_DIR)\$(GTK_ETC_DIR)\*.* $(INSTALL_DIR)\$(GTK_ETC_DIR) /d
1258 #       if not exist $(INSTALL_DIR)\etc\pango mkdir $(INSTALL_DIR)\etc\pango
1259 #       xcopy $(GTK_DIR)\etc\pango\pango.* $(INSTALL_DIR)\etc\pango /d
1260 !IF "$(GTK_INST_VERSION)" == "3.4" || "$(GTK_INST_VERSION)" == "3.6"
1261         if not exist $(INSTALL_DIR)\lib\gtk-3.0 mkdir $(INSTALL_DIR)\lib\gtk-3.0
1262         if not exist $(INSTALL_DIR)\lib\gtk-3.0\$(GTK_LIB_DIR) mkdir $(INSTALL_DIR)\lib\gtk-3.0\$(GTK_LIB_DIR)
1263         xcopy ".\ui\win32\settings.ini" $(INSTALL_DIR)\$(GTK_ETC_DIR) /d
1264 !ELSE
1265         if not exist $(INSTALL_DIR)\lib\gtk-2.0 mkdir $(INSTALL_DIR)\lib\gtk-2.0
1266         if not exist $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR) mkdir $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)
1267         if not exist $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\loaders mkdir $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\loaders
1268         if exist $(GTK_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\loaders xcopy $(GTK_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\loaders\libpixbufloader-*.dll $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\loaders /d
1269 !ENDIF
1270 !IFDEF GTK_ENGINES_DIR
1271         if not exist $(INSTALL_DIR)\$(GTK_ENGINES_DIR) mkdir $(INSTALL_DIR)\$(GTK_ENGINES_DIR)
1272         xcopy $(GTK_DIR)\$(GTK_ENGINES_DIR)\libpixmap.dll $(INSTALL_DIR)\$(GTK_ENGINES_DIR) /d
1273         xcopy $(GTK_DIR)\$(GTK_ENGINES_DIR)\libwimp.dll $(INSTALL_DIR)\$(GTK_ENGINES_DIR) /d
1274 !ENDIF
1275 !IFDEF GTK_THEMES_DIR
1276         xcopy "$(GTK_DIR)\$(GTK_THEMES_DIR)\gtkrc" $(INSTALL_DIR)\$(GTK_ETC_DIR) /d
1277 !ENDIF
1278 !IFDEF GTK_MODULES_DIR
1279         if not exist $(INSTALL_DIR)\$(GTK_MODULES_DIR) mkdir $(INSTALL_DIR)\$(GTK_MODULES_DIR)
1280         xcopy $(GTK_DIR)\$(GTK_MODULES_DIR)\libgail.dll $(INSTALL_DIR)\$(GTK_MODULES_DIR) /d
1281 !ENDIF
1282 !IFDEF NEED_CAIRO_GOBJECT_DLL
1283         xcopy $(GTK_DIR)\bin\libcairo-gobject-2.dll $(INSTALL_DIR)  /d
1284 !ENDIF
1285 !IFDEF NEED_CAIRO_DLL
1286         xcopy $(GTK_DIR)\bin\libcairo-2.dll $(INSTALL_DIR)  /d
1287         xcopy $(GTK_DIR)\bin\libpangocairo-1.0-0.dll $(INSTALL_DIR) /d
1288 !ENDIF
1289 !IFDEF NEED_EXPAT_DLL
1290         xcopy $(GTK_DIR)\bin\$(EXPAT_DLL) $(INSTALL_DIR) /d
1291 !ENDIF
1292 !IFDEF NEED_FFI_DLL
1293         xcopy $(GTK_DIR)\bin\$(FFI_DLL) $(INSTALL_DIR) /d
1294 !ENDIF
1295 !IFDEF NEED_FONTCONFIG_DLL
1296         xcopy $(GTK_DIR)\bin\$(FONTCONFIG_DLL) $(INSTALL_DIR) /d
1297 !ENDIF
1298 !IFDEF NEED_FREETYPE_DLL
1299         xcopy $(GTK_DIR)\bin\libpangoft2-1.0-0.dll $(INSTALL_DIR) /d
1300         xcopy $(GTK_DIR)\bin\$(FREETYPE_DLL) $(INSTALL_DIR) /d
1301 !ENDIF
1302 !IFDEF NEED_JASPER_DLL
1303         xcopy $(GTK_DIR)\bin\$(JASPER_DLL) $(INSTALL_DIR) /d
1304 !ENDIF
1305 !IFDEF NEED_JPEG_DLL
1306         xcopy $(GTK_DIR)\bin\$(JPEG_DLL) $(INSTALL_DIR) /d
1307 !ENDIF
1308 !IFDEF NEED_LZMA_DLL
1309         xcopy $(GTK_DIR)\bin\$(LZMA_DLL) $(INSTALL_DIR) /d
1310 !ENDIF
1311 !IFDEF NEED_PIXMAN_DLL
1312         xcopy $(GTK_DIR)\bin\$(PIXMAN_DLL) $(INSTALL_DIR) /d
1313 !ENDIF
1314 !IFDEF NEED_PNG_DLL
1315         xcopy $(GTK_DIR)\bin\$(PNG_DLL) $(INSTALL_DIR) /d
1316 !ENDIF
1317 !IFDEF NEED_TIFF_DLL
1318         xcopy $(GTK_DIR)\bin\$(TIFF_DLL) $(INSTALL_DIR) /d
1319 !ENDIF
1320 !IFDEF NEED_XML_DLL
1321         xcopy $(GTK_DIR)\bin\$(XML_DLL) $(INSTALL_DIR) /d
1322 !ENDIF
1323 !IFDEF GTK_SCHEMAS_DIR
1324         if not exist $(INSTALL_DIR)\$(GTK_SCHEMAS_DIR) mkdir $(INSTALL_DIR)\$(GTK_SCHEMAS_DIR)
1325         if not exist $(GTK_DIR)\$(GTK_SCHEMAS_DIR)\gschemas.compiled $(GTK_DIR)\bin\glib-compile-schemas $(GTK_DIR)\$(GTK_SCHEMAS_DIR)
1326         xcopy $(GTK_DIR)\$(GTK_SCHEMAS_DIR)\gschemas.compiled  $(INSTALL_DIR)\$(GTK_SCHEMAS_DIR) /d
1327 !ENDIF
1328         xcopy $(GTK_DIR)\bin\libgio-2.0-0.dll $(INSTALL_DIR) /d
1329         xcopy $(GTK_DIR)\bin\libglib-2.0-0.dll $(INSTALL_DIR) /d
1330         xcopy $(GTK_DIR)\bin\libgmodule-2.0-0.dll $(INSTALL_DIR) /d
1331         xcopy $(GTK_DIR)\bin\libgobject-2.0-0.dll $(INSTALL_DIR) /d
1332         xcopy $(GTK_DIR)\bin\libgthread-2.0-0.dll $(INSTALL_DIR) /d
1333         xcopy $(GTK_DIR)\bin\$(INTL_DLL) $(INSTALL_DIR) /d
1334 !IFDEF ZLIB_DIR
1335         xcopy $(ZLIB_DLL) $(INSTALL_DIR) /d
1336 !ENDIF
1337 !IFDEF C_ARES_DIR
1338         xcopy $(C_ARES_DLL) $(INSTALL_DIR) /d
1339 !ENDIF
1340 !IFDEF ADNS_DIR
1341         xcopy $(ADNS_DLL) $(INSTALL_DIR) /d
1342 !ENDIF
1343 !IFDEF KFW_DIR
1344         xcopy $(KFW_PATH)\comerr32.dll $(INSTALL_DIR) /d
1345         xcopy $(KFW_PATH)\krb5_32.dll $(INSTALL_DIR) /d
1346         xcopy $(KFW_PATH)\k5sprt32.dll $(INSTALL_DIR) /d
1347 !ENDIF
1348 !IFDEF GNUTLS_DIR
1349         xcopy $(GNUTLS_DIR)\bin\libgcrypt-11.dll $(INSTALL_DIR) /d
1350         xcopy $(GNUTLS_DIR)\bin\libgnutls-26.dll $(INSTALL_DIR) /d
1351         xcopy $(GNUTLS_DIR)\bin\libgpg-error-0.dll $(INSTALL_DIR) /d
1352         xcopy $(GNUTLS_DIR)\bin\libtasn1-3.dll $(INSTALL_DIR) /d
1353 ! IF "$(INTL_DLL)" != "libintl-8.dll"
1354 # The gtk+ bundle doesn't provide libintl-8.dll (which is the case
1355 # with the 32-bit package); use the GNUTLS version.
1356         xcopy $(GNUTLS_DIR)\bin\libintl-8.dll $(INSTALL_DIR) /d
1357 ! ENDIF
1358 !ENDIF
1359 !IFDEF LUA_DIR
1360         xcopy "$(LUA_DIR)\lua5.1.dll" $(INSTALL_DIR) /d
1361 !ENDIF
1362 !IFDEF SMI_DIR
1363         if not exist $(INSTALL_DIR)\snmp mkdir $(INSTALL_DIR)\snmp
1364         if not exist $(INSTALL_DIR)\snmp\mibs mkdir $(INSTALL_DIR)\snmp\mibs
1365         xcopy "$(SMI_DIR)\bin\libsmi-2.dll" $(INSTALL_DIR) /d
1366         xcopy "$(SMI_DIR)\share\mibs\iana\*" $(INSTALL_DIR)\snmp\mibs /d
1367         xcopy "$(SMI_DIR)\share\mibs\ietf\*" $(INSTALL_DIR)\snmp\mibs /d
1368         xcopy "$(SMI_DIR)\share\mibs\irtf\*" $(INSTALL_DIR)\snmp\mibs /d
1369         xcopy "$(SMI_DIR)\share\mibs\site\*" $(INSTALL_DIR)\snmp\mibs /d
1370         xcopy "$(SMI_DIR)\share\mibs\tubs\*" $(INSTALL_DIR)\snmp\mibs /d
1371         xcopy "$(SMI_DIR)\share\pibs\*" $(INSTALL_DIR)\snmp\mibs /d
1372         xcopy "$(SMI_DIR)\share\yang\*.yang" $(INSTALL_DIR)\snmp\mibs /d
1373 !ENDIF
1374 !IFDEF GEOIP_DIR
1375         xcopy "$(GEOIP_DIR)\bin\libGeoip-1.dll" $(INSTALL_DIR) /d
1376 !ENDIF
1377 !IFDEF WINSPARKLE_DIR
1378         xcopy "$(WINSPARKLE_DIR)\WinSparkle.dll" $(INSTALL_DIR) /d
1379 !ENDIF
1380         cd $(INSTALL_DIR)
1381         peflags --dynamicbase=true --nxcompat=true *.dll
1382 !IF "$(GTK_INST_VERSION)" == "3.4" || "$(GTK_INST_VERSION)" == "3.6"
1383 !ELSE
1384         peflags --dynamicbase=true --nxcompat=true lib/gtk-2.0/*/engines/*.dll
1385         peflags --dynamicbase=true --nxcompat=true lib/gtk-2.0/modules/*.dll
1386 !ENDIF
1387         cd ..
1388
1389 checkapi_local:
1390         $(PERL) tools/checkAPIs.pl -build \
1391         $(WIRESHARK_COMMON_SRC) \
1392         $(TSHARK_TAP_SRC) \
1393 #       $(EXTRA_wireshark_SOURCES)
1394
1395 checkapi: checkapi_local
1396         cd wiretap
1397         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1398         cd ../filetap
1399         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1400         cd ../codecs
1401         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1402         cd ../ui
1403         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1404         cd gtk
1405         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1406         cd ../win32
1407         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1408         cd ../../epan
1409 ##      $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1410         cd ../epan/crypt
1411 ##      $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1412         cd ../dfilter
1413         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1414         cd ../ftypes
1415 ##      $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1416         cd ../wslua
1417 ##      $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1418         cd ../dissectors
1419         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1420         cd ..
1421         cd ../plugins
1422         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1423         cd ../wsutil
1424         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1425
1426 ####
1427 _FORCE_:  ## Assumption: no file named _FORCE_ exists in the current directory