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