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