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