b8335c8c365ebd2f6999a197fdc394607c3b9787
[obnox/wireshark/wip.git] / Makefile.nmake
1 ## Makefile for building wireshark.exe with Microsoft C and nmake
2 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
3 #
4 # $Id$
5
6 # We "Deploy using XCopy," which is described at
7 # http://msdn.microsoft.com/en-us/library/ms235291.aspx
8
9 include config.nmake
10 include <win32.mak>
11
12 ############### no need to modify below this line #########
13
14 CC = cl
15 LINK= link
16 BSCMAKE= bscmake
17
18 WIN_SETUP=tools/$(WIRESHARK_TARGET_PLATFORM)-setup.sh
19
20 # -------------
21 # Checking  that the Wireshark Libraries are up-to-date:
22 #  1. win??-setup.sh --checktag is invoked during nmake "preprocessing".
23 #     If an error status is returned (ie: the libraries are not up-to-date)
24 #      then CHECK_TAG is defined as a non-null string.
25 #  2. The $(LIBS_CHECK) target is invoked during the nmake:
26 #     If $(CHECK_TAG) is non-null, then a "libraries not up to date" exit will occur.
27 #     If $(CHECK_TAG) is null, but either config.nmake or Makefile.nmake
28 #      are newer than the $(LIBS_CHECK) target, then a detailed verification
29 #      as to the required library package files will be made.
30 #
31 LIBS_CHECK=_libs_check_
32 !IF [$(SH) $(WIN_SETUP) --checktag "$(WIRESHARK_LIBS)"] != 0
33 CHECK_TAG=_check_tag_
34 !ELSE
35 CHECK_TAG=
36 !ENDIF
37 # -------------
38
39 LDFLAGS = /NOLOGO /INCREMENTAL:no $(LOCAL_LDFLAGS)
40
41 # We use GENERATED_CFLAGS to get around flex's non-LLP64-compliant output
42 GENERATED_CFLAGS=-DHAVE_CONFIG_H $(LOCAL_CFLAGS) $(GLIB_CFLAGS) /I. /Iwiretap \
43         $(ZLIB_CFLAGS) /I$(PCAP_DIR)\include \
44         $(AIRPCAP_CFLAGS) \
45         $(C_ARES_CFLAGS) $(ADNS_CFLAGS) $(PCRE_CFLAGS) $(GNUTLS_CFLAGS) \
46         $(LUA_CFLAGS) $(PYTHON_CFLAGS) $(SMI_CFLAGS) $(GEOIP_CFLAGS) \
47         -D_U_="" -D_NEED_VAR_IMPORT_
48 CFLAGS=-WX $(GENERATED_CFLAGS)
49
50 CVARSDLL=-DWIN32 -DNULL=0 -D_MT -D_DLL
51
52 .c.obj::
53         $(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<
54
55 PLATFORM_SRC = capture-wpcap.c capture_wpcap_packet.c
56
57 WTAP_PLUGIN_SOURCES = \
58        epan/plugins.c \
59        epan/report_err.c \
60        epan/filesystem.c
61
62 include Makefile.common
63
64 wireshark_OBJECTS = $(wireshark_SOURCES:.c=.obj)
65 tshark_OBJECTS = $(tshark_SOURCES:.c=.obj)
66 rawshark_OBJECTS = $(rawshark_SOURCES:.c=.obj)
67 ###text2pcap_OBJECTS = $(text2pcap_SOURCES:.c=.obj)
68 ###mergecap_OBJECTS = $(mergecap_SOURCES:.c=.obj)
69 editcap_OBJECTS = $(editcap_SOURCES:.c=.obj)
70 capinfos_OBJECTS = $(capinfos_SOURCES:.c=.obj)
71 dftest_OBJECTS = $(dftest_SOURCES:.c=.obj)
72 dumpcap_OBJECTS = $(dumpcap_SOURCES:.c=.obj)
73 randpkt_OBJECTS = $(randpkt_SOURCES:.c=.obj)
74
75 wireshark_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
76         wsock32.lib user32.lib shell32.lib comctl32.lib \
77         $(HHC_LIBS) \
78         wsutil\libwsutil.lib \
79         $(GNUTLS_LIBS) \
80         $(PYTHON_LIBS) \
81 !IFDEF ENABLE_LIBWIRESHARK
82         epan\libwireshark.lib \
83 !ELSE
84         epan\dissectors\dissectors.lib \
85         epan\wireshark.lib \
86         epan\crypt\airpdcap.lib \
87         epan\dfilter\dfilter.lib \
88         epan\ftypes\ftypes.lib \
89         $(C_ARES_LIBS) \
90         $(ADNS_LIBS) \
91         $(PCRE_LIBS) \
92         $(ZLIB_LIBS)
93 !ENDIF
94
95 tshark_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
96         wsock32.lib user32.lib \
97         $(GLIB_LIBS) \
98         wsutil\libwsutil.lib \
99         $(GNUTLS_LIBS) \
100         $(PYTHON_LIBS) \
101 !IFDEF ENABLE_LIBWIRESHARK
102         epan\libwireshark.lib \
103 !ELSE
104         epan\dissectors\dissectors.lib \
105         epan\wireshark.lib \
106         epan\crypt\airpdcap.lib \
107         epan\dfilter\dfilter.lib \
108         epan\ftypes\ftypes.lib \
109         $(C_ARES_LIBS) \
110         $(ADNS_LIBS) \
111         $(PCRE_LIBS) \
112         $(ZLIB_LIBS)
113 !ENDIF
114
115 rawshark_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
116         wsock32.lib user32.lib \
117         $(GLIB_LIBS) \
118         wsutil\libwsutil.lib \
119         $(GNUTLS_LIBS) \
120         $(PYTHON_LIBS) \
121 !IFDEF ENABLE_LIBWIRESHARK
122         epan\libwireshark.lib \
123 !ELSE
124         epan\dissectors\dissectors.lib \
125         epan\wireshark.lib \
126         epan\crypt\airpdcap.lib \
127         epan\dfilter\dfilter.lib \
128         epan\ftypes\ftypes.lib \
129         $(C_ARES_LIBS) \
130         $(ADNS_LIBS) \
131         $(PCRE_LIBS) \
132         $(ZLIB_LIBS)
133 !ENDIF
134
135 capinfos_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
136         wsock32.lib user32.lib shell32.lib \
137         wsutil\libwsutil.lib \
138         $(GLIB_LIBS) \
139         $(GCRYPT_LIBS)
140
141 editcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
142         wsock32.lib user32.lib shell32.lib \
143         wsutil\libwsutil.lib \
144         $(GLIB_LIBS)
145
146 mergecap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
147         wsock32.lib user32.lib \
148         wsutil\libwsutil.lib \
149         $(GLIB_LIBS)
150
151 text2pcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
152         wsock32.lib user32.lib \
153         wsutil\libwsutil.lib \
154         $(GLIB_LIBS)
155
156 dumpcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
157         wsock32.lib user32.lib \
158         wsutil\libwsutil.lib \
159         $(GLIB_LIBS) \
160         $(GTHREAD_LIBS) \
161         $(GNUTLS_LIBS) \
162         $(PYTHON_LIBS)
163
164 dftest_LIBS=  wiretap\wiretap-$(WTAP_VERSION).lib \
165         wsock32.lib user32.lib \
166         $(GLIB_LIBS) \
167         wsutil\libwsutil.lib \
168         $(GNUTLS_LIBS) \
169 !IFDEF ENABLE_LIBWIRESHARK
170         epan\libwireshark.lib \
171 !ELSE
172         epan\dissectors\dissectors.lib \
173         epan\wireshark.lib \
174         epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
175         $(C_ARES_LIBS) \
176         $(ADNS_LIBS) \
177         $(PCRE_LIBS) \
178         $(ZLIB_LIBS) \
179         $(SMI_LIBS)
180 !ENDIF
181
182 randpkt_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
183         user32.lib \
184         wsutil\libwsutil.lib \
185         $(GLIB_LIBS)
186
187 EXECUTABLES=wireshark.exe tshark.exe rawshark.exe \
188         capinfos.exe editcap.exe mergecap.exe text2pcap.exe randpkt.exe dumpcap.exe
189
190 RESOURCES=image\wireshark.res image\libwireshark.res image\tshark.res \
191         image\capinfos.res image\editcap.res image\mergecap.res \
192         image\text2pcap.res image\wiretap.res image\dumpcap.res \
193         image\rawshark.res image\libwsutil.res
194
195
196 all: $(LIBS_CHECK) config.h tools image codecs $(C_ARES_DLL) $(ADNS_DLL) $(ZLIB_DLL) wsutil wiretap epan $(EXECUTABLES) $(RESOURCES) doc help install-all
197
198 !IFDEF MAKENSIS
199 packaging: all
200         cd packaging
201         cd nsis
202         $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
203         cd ..
204         cd ..
205 !ELSE
206 packaging: _FORCE_
207         @echo \? NSIS not available (MAKENSIS not defined in config.nmake)
208         @echo.
209         @exit 1
210 !ENDIF
211
212 packaging_u3: all
213         cd packaging
214         cd u3
215         cd win32
216         $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
217         cd ..
218         cd ..
219         cd ..
220
221 packaging_papps: all
222         cd packaging
223         cd portableapps
224         cd win32
225         $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
226         cd ..
227         cd ..
228         cd ..
229
230 # use (info-)zip from cygwin to pack things
231 packaging_zip: all
232 !IFDEF MSVCR_DLL
233         xcopy "$(MSVCR_DLL)" $(INSTALL_DIR)
234 !ENDIF
235 !IFDEF VCREDIST_EXE
236         @echo Including vcredist_$(TARGET_MACHINE).exe -- your recipient may need to run it!
237         xcopy "$(VCREDIST_EXE)" $(INSTALL_DIR)
238 !ENDIF
239         rm -f wireshark.zip
240         zip -r -9 wireshark.zip $(INSTALL_DIR)/
241
242 wireshark.bsc: *.sbr epan\*.sbr epan\dfilter\*.sbr epan\ftypes\*.sbr epan\wslua\*.sbr epan\dissectors\*.sbr gtk\*.sbr wiretap\*.sbr
243         rm -f $@
244         $(BSCMAKE) @<<
245                 /o $@ $?
246 <<
247         xcopy $@ $(INSTALL_DIR)\ /d
248
249 $(RESOURCES): image
250
251 wiretap\wiretap-$(WTAP_VERSION).lib: image $(ZLIB_DLL) wiretap
252
253 wireshark.exe   : $(LIBS_CHECK) config.h $(wireshark_OBJECTS) codecs epan gtk image\wireshark.res wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib codecs\codecs.lib gtk\libui.lib plugins
254         @echo Linking $@
255         $(LINK) @<<
256                 /OUT:wireshark.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:windows $(wireshark_LIBS) $(GTK_LIBS) codecs\codecs.lib gtk\libui.lib $(wireshark_OBJECTS) image\wireshark.res
257 <<
258 !IFDEF MANIFEST_INFO_REQUIRED
259         mt.exe -nologo -manifest "wireshark.exe.manifest" -outputresource:wireshark.exe;1
260 !ENDIF
261
262 tshark.exe      : $(LIBS_CHECK) config.h $(tshark_OBJECTS) epan image\tshark.res wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib plugins
263         @echo Linking $@
264         $(LINK) @<<
265                 /OUT:tshark.exe $(conflags) $(conlibsdll) $(LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console $(tshark_LIBS) $(tshark_OBJECTS) image\tshark.res
266 <<
267 !IFDEF MANIFEST_INFO_REQUIRED
268         mt.exe -nologo -manifest "tshark.exe.manifest" -outputresource:tshark.exe;1
269 !ENDIF
270
271 rawshark.exe    : $(LIBS_CHECK) config.h $(rawshark_OBJECTS) epan image\rawshark.res wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib plugins
272         @echo Linking $@
273         $(LINK) @<<
274                 /OUT:rawshark.exe $(conflags) $(conlibsdll) $(LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console $(rawshark_LIBS) $(rawshark_OBJECTS) image\rawshark.res
275 <<
276 !IFDEF MANIFEST_INFO_REQUIRED
277         mt.exe -nologo -manifest "rawshark.exe.manifest" -outputresource:rawshark.exe;1
278 !ENDIF
279
280 # XXX: This makefile does not properly handle doing a 'nmake ... capinfos.exe' directly since some of the .objs
281 #      (e.g. epan\plugins.obj) must be built first using epan\Makefile.nmake (which happens for 'nmake ... all').
282 # Linking with setargv.obj enables "wildcard expansion" of command-line arguments
283 capinfos.exe    : $(LIBS_CHECK) config.h $(capinfos_OBJECTS) wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib image\capinfos.res
284         @echo Linking $@
285         $(LINK) @<<
286                 /OUT:capinfos.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(capinfos_OBJECTS) $(capinfos_LIBS) setargv.obj image\capinfos.res
287 <<
288 !IFDEF MANIFEST_INFO_REQUIRED
289         mt.exe -nologo -manifest "capinfos.exe.manifest" -outputresource:capinfos.exe;1
290 !ENDIF
291
292 # XXX: This makefile does not properly handle doing a 'nmake ... editcap.exe' directly since some of the .objs
293 #      (e.g. epan\plugins.obj) must be built first using epan\Makefile.nmake (which happens for 'nmake ... all').
294 editcap.exe     : $(LIBS_CHECK) config.h $(editcap_OBJECTS) wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib image\editcap.res
295         @echo Linking $@
296         $(LINK) @<<
297                 /OUT:editcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(editcap_OBJECTS) $(editcap_LIBS) image\editcap.res
298 <<
299 !IFDEF MANIFEST_INFO_REQUIRED
300         mt.exe -nologo -manifest "editcap.exe.manifest" -outputresource:editcap.exe;1
301 !ENDIF
302
303 # Linking with setargv.obj enables "wildcard expansion" of command-line arguments
304 mergecap.exe    : $(LIBS_CHECK)  config.h mergecap.obj merge.obj wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib image\mergecap.res
305         @echo Linking $@
306         $(LINK) @<<
307                 /OUT:mergecap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console mergecap.obj merge.obj $(mergecap_LIBS) setargv.obj image\mergecap.res
308 <<
309 !IFDEF MANIFEST_INFO_REQUIRED
310         mt.exe -nologo -manifest "mergecap.exe.manifest" -outputresource:mergecap.exe;1
311 !ENDIF
312
313 text2pcap.exe   : $(LIBS_CHECK) config.h text2pcap.obj text2pcap-scanner.obj wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib image\text2pcap.res
314         @echo Linking $@
315         $(LINK) @<<
316                 /OUT:text2pcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console text2pcap.obj text2pcap-scanner.obj $(text2pcap_LIBS) image\text2pcap.res
317 <<
318 !IFDEF MANIFEST_INFO_REQUIRED
319         mt.exe -nologo -manifest "text2pcap.exe.manifest" -outputresource:text2pcap.exe;1
320 !ENDIF
321
322 dftest.exe      : $(dftest_OBJECTS) epan
323         @echo Linking $@
324         $(LINK) @<<
325                 /OUT:dftest.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dftest_LIBS) $(dftest_OBJECTS)
326 <<
327 !IFDEF MANIFEST_INFO_REQUIRED
328         mt.exe -nologo -manifest "dftest.exe.manifest" -outputresource:dftest.exe;1
329 !ENDIF
330
331 randpkt.exe     : $(randpkt_OBJECTS)
332         @echo Linking $@
333         $(LINK) @<<
334                 /OUT:randpkt.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(randpkt_LIBS) $(randpkt_OBJECTS)
335 <<
336 !IFDEF MANIFEST_INFO_REQUIRED
337         mt.exe -nologo -manifest "randpkt.exe.manifest" -outputresource:randpkt.exe;1
338 !ENDIF
339
340 dumpcap.exe     : $(LIBS_CHECK) config.h $(dumpcap_OBJECTS) wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib image\dumpcap.res
341         @echo Linking $@
342         $(LINK) @<<
343                 /OUT:dumpcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dumpcap_LIBS) $(dumpcap_OBJECTS) image\dumpcap.res
344 <<
345 !IFDEF MANIFEST_INFO_REQUIRED
346         mt.exe -nologo -manifest "dumpcap.exe.manifest" -outputresource:dumpcap.exe;1
347 !ENDIF
348
349
350 config.h        : config.h.win32 config.nmake
351         sed -e s/@VERSION@/$(VERSION)/ \
352             -e "s/@HAVE_C_ARES@/$(C_ARES_CONFIG)/" \
353             -e "s/@HAVE_GNU_ADNS@/$(ADNS_CONFIG)/" \
354             -e "s/@HAVE_PCRE@/$(PCRE_CONFIG)/" \
355             -e "s/@HAVE_KFW@/$(KFW_CONFIG)/" \
356             -e "s/@HAVE_NETTLE@/$(NETTLE_CONFIG)/" \
357             -e "s/@HAVE_LIBZ@/$(ZLIB_CONFIG)/" \
358             -e "s/@HAVE_LIBPCAP@/$(WINPCAP_CONFIG)/" \
359             -e "s/@HAVE_PCAP_FINDALLDEVS@/$(PCAP_FINDALLDEVS_CONFIG)/" \
360             -e "s/@HAVE_PCAP_DATALINK_NAME_TO_VAL@/$(PCAP_DATALINK_NAME_TO_VAL_CONFIG)/" \
361             -e "s/@HAVE_PCAP_DATALINK_VAL_TO_NAME@/$(PCAP_DATALINK_VAL_TO_NAME_CONFIG)/" \
362             -e "s/@HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION@/$(PCAP_DATALINK_VAL_TO_DESCRIPTION_CONFIG)/" \
363             -e "s/@HAVE_PCAP_BREAKLOOP@/$(PCAP_BREAKLOOP_CONFIG)/" \
364             -e "s/@HAVE_REMOTE@/$(PCAP_HAVE_REMOTE_CONFIG)/" \
365             -e "s/@HAVE_PCAP_REMOTE@/$(PCAP_REMOTE_CONFIG)/" \
366             -e "s/@HAVE_PCAP_OPEN@/$(PCAP_OPEN_CONFIG)/" \
367             -e "s/@HAVE_PCAP_LIST_DATALINKS@/$(PCAP_LIST_DATALINKS_CONFIG)/" \
368             -e "s/@HAVE_PCAP_FREE_DATALINKS@/$(PCAP_FREE_DATALINKS_CONFIG)/" \
369             -e "s/@HAVE_PCAP_SET_DATALINK@/$(PCAP_SET_DATALINK_CONFIG)/" \
370             -e "s/@HAVE_PCAP_SETSAMPLING@/$(PCAP_SETSAMPLING_CONFIG)/" \
371             -e "s/@HAVE_LIBWIRESHARKDLL@/$(LIBWIRESHARK_CONFIG)/" \
372             -e "s/@HAVE_LIBGNUTLS@/$(GNUTLS_CONFIG)/" \
373             -e "s/@HAVE_LIBGCRYPT@/$(LIBGCRYPT_CONFIG)/" \
374             -e "s/@HAVE_LUA@/$(LUA_CONFIG)/" \
375             -e "s/@HAVE_LUA_5_1@/$(LUA_VERSION)/" \
376             -e "s/@HAVE_PYTHON@/$(PYTHON_CONFIG)/" \
377             -e "s/@HAVE_AIRPCAP@/$(AIRPCAP_CONFIG)/" \
378             -e "s/@HAVE_AIRPDCAP@/$(AIRPDCAP_CONFIG)/" \
379             -e "s/@HAVE_LIBPORTAUDIO@/$(PORTAUDIO_CONFIG)/" \
380             -e "s/@PORTAUDIO_API_1@/$(PORTAUDIO_API_CONFIG)/" \
381             -e "s/@HAVE_SMI@/$(SMI_CONFIG)/" \
382             -e "s/@HAVE_GEOIP@/$(GEOIP_CONFIG)/" \
383             -e "s/@HAVE_NEW_PACKET_LIST@/$(NEW_PACKET_LIST_CONFIG)/" \
384             -e "s/@INET6@/$(INET6_CONFIG)/" \
385             -e "s/@HAVE_NTDDNDIS_H@/$(NTDDNDIS_CONFIG)/" \
386             < config.h.win32 > $@
387
388
389 ps.c: tools\rdps.py print.ps
390         $(PYTHON) tools\rdps.py print.ps ps.c
391 #
392 # Build the version string
393 #
394 !IF EXIST(".svn/entries")
395 SVNENTRIES = .svn/entries
396 !ELSE
397 SVNENTRIES =
398 !ENDIF
399 svnversion.h: $(SVNENTRIES)
400         rm -f svnversion.h
401         $(PERL) make-version.pl
402
403
404 #
405 # Build "tshark-tap-register.c", which contains a function
406 # "register_all_tap_listeners()"
407 # that calls the register routines for all TShark tap listeners.
408 #
409 # We do this by grepping through sources.
410 #
411 # Formatting conventions:  The name of the tap_listener_register_*
412 # routines must start in column zero, or must be preceded only by
413 # "void " starting in column zero, and must not be inside #if.
414 #
415 # The first argument is the name of the file to write.
416 # The second argument is the directory in which the source files live.
417 # All subsequent arguments are the files to scan.
418 #
419 tshark-tap-register.c: $(TSHARK_TAP_SRC) tools\make-tapreg-dotc
420         @echo Making tshark-tap-register.c
421         @$(SH) tools/make-tapreg-dotc tshark-tap-register.c . $(TSHARK_TAP_SRC)
422
423 text2pcap-scanner.c : text2pcap-scanner.l
424         $(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
425
426 text2pcap-scanner.obj : text2pcap-scanner.c
427         $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c $?
428
429 #
430 # The following targets will rebuild their respective objs
431 # if and when svnversion.h should change.
432 #
433
434 text2pcap.obj : $*.c svnversion.h
435         $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c $*.c
436
437 mergecap.obj : $*.c svnversion.h
438         $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c $*.c
439
440 capinfos.obj : $*.c svnversion.h
441         $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c $*.c
442
443 editcap.obj : $*.c svnversion.h
444         $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c $*.c
445
446 version_info.obj : $*.c svnversion.h
447         $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c $*.c
448
449 clean-local: clean-deps
450         rm -f $(wireshark_OBJECTS) $(tshark_OBJECTS) $(dumpcap_OBJECTS) $(rawshark_OBJECTS) \
451                 $(EXECUTABLES) *.pdb *.exe.manifest \
452                 capinfos.obj editcap.obj mergecap.obj text2pcap.obj \
453                 nio-ie5.obj update.obj \
454                 text2pcap-scanner.obj text2pcap-scanner.c rdps.obj \
455                 rdps.pdb rdps.exe rdps.ilk config.h ps.c $(LIBS_CHECK) \
456                 dftest.obj dftest.exe randpkt.obj randpkt.ext \
457                 doxygen.cfg \
458                 $(RESOURCES) libwireshark.dll wiretap-$(WTAP_VERSION).dll \
459                 libwsutil.dll \
460                 wireshark.bsc
461
462 clean: clean-local
463         cd asn1
464         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
465         cd ../wiretap
466         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
467         cd ../wsutil
468         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
469         cd ../codecs
470         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
471         cd ../gtk
472         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
473         cd ../epan
474         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
475         cd ../plugins
476         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
477         cd ../tools
478         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
479         cd ../image
480         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
481         cd ../doc
482         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
483         cd ../help
484         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
485         cd ../packaging/nsis
486         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
487         cd ../u3/win32
488         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
489         cd ../../portableapps/win32
490         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
491         cd ../../..
492
493 # "distclean" removes all files not part of the distribution.
494 # It does not remove generated files that are part of the distribution.
495 distclean-local: clean-local
496 !IFDEF ADNS_DIR
497 !IF "$(MSVC_VARIANT)" != "MSVC6"
498         rm -f $(ADNS_DLL) $(ADNS_LIBS)
499 !ENDIF
500 !ENDIF
501 !IFDEF ZLIB_DIR
502         rm -f $(ZLIB_DLL) $(ZLIB_DIR)\zlib1.dll.manifest \
503                 $(ZLIB_DIR)\include\zlib.h $(ZLIB_DIR)\include\zconf.h \
504                 $(ZLIB_DIR)\lib\zdll.lib
505 !ENDIF
506         rm -f config.h $(BUILT_SOURCES)
507
508 distclean: distclean-local
509         cd wiretap
510         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
511         cd ../wsutil
512         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
513         cd ../codecs
514         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
515         cd ../gtk
516         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
517         cd ../epan
518         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
519         cd ../plugins
520         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
521         cd ../tools
522         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
523         cd ../image
524         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
525         cd ../doc
526         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
527         cd ../help
528         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
529         cd ../packaging/nsis
530         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
531         cd ../u3/win32
532         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
533         cd ../../portableapps/win32
534         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
535         cd ../../..
536
537 # Make "maintainer-clean" only if you would like to remove ALL generated
538 # files.
539 # Be sure to have python and perl installed to regenerate them.
540 maintainer-clean-local: distclean-local
541         rm -f $(GENERATED_FILES)
542
543 maintainer-clean: maintainer-clean-local
544         cd wiretap
545         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
546         cd ../wsutil
547         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
548         cd ../codecs
549         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
550         cd ../gtk
551         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
552         cd ../epan
553         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
554         cd ../plugins
555         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
556         cd ../tools
557         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
558         cd ../image
559         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
560         cd ../doc
561         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
562         cd ../help
563         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
564         cd ../packaging/nsis
565         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
566         cd ../u3/win32
567         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
568         cd ../../portableapps/win32
569         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
570         cd ../../..
571
572 tools::
573         cd tools
574         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
575         cd ..
576
577 image::
578         cd image
579         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
580         cd ..
581
582 !IFDEF ADNS_DIR
583 # Non-MSVC6 variants have to avoid indirectly using msvcrt.dll,
584 # therefore compile the adns dll from source ADNS_DIR package.
585 # To avoid path problems, copy the adns sources to a temp dir,
586 # compile and copy the resulting files back to (source) ADNS_DIR
587 #
588 # Unfortunately:
589 # - we need to "patch" adns_dll.rep and adns_dll.rc (at least for MSVC2005EE)
590 # - on MSVC6 we can't easily rebuild, because iphlpapi.h is needed
591 #
592 $(ADNS_DLL):
593 !IF "$(MSVC_VARIANT)" == "MSVC6"
594         if not exist $(WIRESHARK_LIBS)\$(MSVC_VARIANT)\adns mkdir $(WIRESHARK_LIBS)\$(MSVC_VARIANT)\adns
595         copy $(ADNS_DIR)\adns_win32\lib\adns_dll.dll $(ADNS_DLL)
596         copy $(ADNS_DIR)\adns_win32\lib\adns_dll.lib $(ADNS_LIBS)
597 !ELSE
598         xcopy $(ADNS_DIR) adns.tmp /D /I /E /Y
599         copy adns_dll.dep adns.tmp\adns_win32\adns_dll
600         copy adns_dll.rc adns.tmp\adns_win32\adns_dll
601         cd adns.tmp\adns_win32\adns_dll
602         set CFG=adns_dll - Win32 Release
603         $(MAKE) /$(MAKEFLAGS) -f adns_dll.mak LOC="$(LOCAL_CFLAGS)"
604         cd ..\lib
605 !IFDEF MANIFEST_INFO_REQUIRED
606         mt.exe -nologo -manifest "adns_dll.dll.manifest" -outputresource:adns_dll.dll;2
607 !ENDIF
608         if not exist $(WIRESHARK_LIBS)\$(MSVC_VARIANT)\adns mkdir $(WIRESHARK_LIBS)\$(MSVC_VARIANT)\adns
609         copy adns_dll.dll $(ADNS_DLL)
610         copy adns_dll.lib $(ADNS_LIBS)
611         cd ..\..\..
612         rm -r -f adns.tmp
613 !ENDIF
614 !ENDIF
615
616 !IFDEF ZLIB_DIR
617 # Non-MSVC6 variants have to avoid indirectly using msvcrt.dll,
618 # therefore compile the zlib dll from source ZLIB_DIR package.
619 # To avoid path problems, copy the zlib sources to a temp dir,
620 # compile and copy the resulting files back to (source) ZLIB_DIR
621 $(ZLIB_DLL):
622         xcopy $(ZLIB_DIR) zlib.tmp /D /I /E /Y
623         cd zlib.tmp
624         $(MAKE) /$(MAKEFLAGS) -f win32/Makefile.msc zlib1.dll LOC="$(LOCAL_CFLAGS)"
625         if not exist $(ZLIB_DIR) mkdir $(ZLIB_DIR)
626         if not exist $(ZLIB_DIR)\lib mkdir $(ZLIB_DIR)\lib
627         if not exist $(ZLIB_DIR)\include mkdir $(ZLIB_DIR)\include
628 !IFDEF MANIFEST_INFO_REQUIRED
629         mt.exe -nologo -manifest "zlib1.dll.manifest" -outputresource:zlib1.dll;2
630 !ENDIF
631         copy zlib1.dll $(ZLIB_DIR)
632         copy zdll.lib $(ZLIB_DIR)\lib
633         copy zconf.h $(ZLIB_DIR)\include
634         copy zlib.h $(ZLIB_DIR)\include
635         cd ..
636         rm -r -f zlib.tmp
637 !ENDIF
638
639 wsutil::
640         cd wsutil
641         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
642         cd ..
643
644 wiretap::
645         cd wiretap
646         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
647         cd ..
648
649 codecs::
650         cd codecs
651         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
652         cd ..
653
654 gtk:: help config.h svnversion.h doxygen
655         cd gtk
656         $(MAKE) /$(MAKEFLAGS) /f Makefile.nmake libui.lib
657         cd ..
658
659 epan:: $(RESOURCES) $(ZLIB_DLL) wiretap\wiretap-$(WTAP_VERSION).lib $(BUILT_SOURCES) doxygen
660         cd epan
661         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
662         cd ..
663
664 plugins::
665         cd plugins
666         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
667         cd ..
668
669 doc::
670         cd doc
671         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
672         cd ..
673
674 help::
675         cd help
676         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
677         cd ..
678
679 doxygen.cfg: config.nmake doxygen.cfg.in
680         sed -e s/@VERSION@/$(VERSION)/ \
681             < doxygen.cfg.in > $@
682
683 doxygen-run:
684 !IFDEF DOXYGEN
685         $(DOXYGEN) doxygen.cfg
686 !ENDIF
687
688 doxygen: doxygen.cfg doxygen-run
689
690
691 ################################################################################
692 # Prepare build environment by downloading and installing required libraries
693 ################################################################################
694
695 # The required tools to build Wireshark.
696 #
697 # The 'find' tool is available both in \WINNT\System32 and in cygwin's /usr/bin.
698 # We only need the cygwin version (for some shell scripts).
699 # In the PATH, System32 is before cygwin's dir, so explicitly check for /usr/bin/find.
700 REQUIRED_TOOLS=\
701         $(CC) \
702         $(LINK) \
703         nmake \
704 !IFDEF MANIFEST_INFO_REQUIRED
705         mt \
706 !ENDIF
707         $(SH_PROG)      \
708         $(YACC) \
709         $(LEX)  \
710         env     \
711         grep    \
712         /usr/bin/find   \
713         $(PERL) \
714         $(PYTHON)       \
715         sed     \
716         unzip   \
717         wget
718
719 verify_tools:
720         @$(SH) $(WIN_SETUP) --appverify $(REQUIRED_TOOLS)
721
722 # Targets and etc used to verify or download libraries
723
724 !IFNDEF WIN_SETUP_OPT
725 WIN_SETUP_OPT=--download
726 !ENDIF
727
728 # Verify that the required library 'package' (zip) files have been downloaded.
729 # (It seems reasonable to assume that if the files have been downloaded
730 #  then they have been installed).
731 check_libs:
732         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake WIN_SETUP_OPT=--libverify process_libs
733
734 # Verify library packages:
735 #  If $(CHECK_TAG) is non-null then checktag failed; Exit with an error message. (See beginning of this Makefile).
736 #  Otherwise do detailed library package files verification only if Makefile.nmake or config.make have been updated
737 #  (or dummy file doesn't exist because of 'make clean' or whatever).
738 #  Note that the creation/modification time of a file after an svn update of that file
739 #   is the time of the update (not the time of the file in the repository).
740 # touch is only called if libverify succeeds.
741 $(LIBS_CHECK):  $(CHECK_TAG) config.nmake Makefile.nmake
742         @echo  Verifying library package files ...
743         @$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake WIN_SETUP_OPT=--libverify process_libs
744         @touch $@
745
746 # Target for "checktag failed" (libraries not up to date).
747 # Defined only if "checktag" failed (see beginning of this Makefile).
748 !IF "$(CHECK_TAG)" != ""
749 $(CHECK_TAG): _FORCE_
750         @echo \? Wireshark Libraries not up-to-date \?
751         @echo \? Do you need to run "nmake -f Makefile.nmake setup" \?
752         @echo.
753         @exit 1
754
755 !ENDIF
756
757 # Download (if needed) and install all the required libraries into WIRESHARK_LIBS.
758 # A clean_setup is done first to ensure that the target dirs don't
759 # contain old files remaining from a previous setup run.
760 setup: verify_tools clean_setup process_libs
761
762
763 # The process_libs target when invoked causes either a --libverify or a --download for all the required libraries.
764 # (The choice is determined by the value of the macro WIN_SETUP_OPT).
765 process_libs:
766     @if not exist $(WIRESHARK_LIBS) md $(WIRESHARK_LIBS)
767 !IFDEF GTK_DIR
768         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
769                 gtk2 gtk+-bundle_$(GTK_PKG)_$(WIRESHARK_TARGET_PLATFORM).zip
770 !ENDIF
771 !IFDEF KFW_DIR
772         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
773                 . kfw-3-2-2-i386-ws-vc6.zip
774 #       @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
775 #               . kfw-3-2-2.zip
776 !ENDIF
777 !IFDEF PCAP_DIR
778         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
779                 . WpdPack_$(PCAP_VERSION).zip
780 !ENDIF
781 !IFDEF AIRPCAP_DIR
782         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
783                 AirPcap_Devpack_4_1_0_1622 AirPcap_Devpack_4_1_0_1622.zip
784 !ENDIF
785 !IFDEF C_ARES_DIR
786         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
787                 . c-ares-$(C_ARES_PKG)-$(WIRESHARK_TARGET_PLATFORM)ws.zip
788 !ENDIF
789 !IFDEF ADNS_DIR
790         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
791                 . adns-1.0-win32-05ws.zip
792 !ENDIF
793 !IFDEF PCRE_DIR
794         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
795                 pcre-7.0 pcre-7.0-bin.zip
796         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
797                 pcre-7.0 pcre-7.0-lib.zip
798 !ENDIF
799 !IFDEF ZLIB_DIR
800         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
801                 zlib123 zlib123ws.zip
802 !ENDIF
803 !IFDEF LUA_DIR
804         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
805                 lua5.1.4 lua$(LUA_DIST)_lib.zip
806 !ENDIF
807
808 !IFDEF GNUTLS_PKG
809         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
810                 . gnutls-$(GNUTLS_PKG)-$(WIRESHARK_TARGET_PLATFORM)ws.zip
811 !ENDIF
812 !IFDEF PORTAUDIO_DIR
813         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
814                 . portaudio_v19_2.zip
815 !ENDIF
816 !IFDEF SMI_DIR
817         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
818                 . libsmi-0.4.8.zip
819 !ENDIF
820 !IFDEF GEOIP_DIR
821         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
822                 . GeoIP-1.4.6-$(WIRESHARK_TARGET_PLATFORM)ws.zip
823 !ENDIF
824 !IFDEF HHC_DIR
825         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
826                 user-guide user-guide-28526.zip
827 !ENDIF
828 !IFDEF UPX
829         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
830                 . upx303w.zip
831 !ENDIF
832 !IFDEF NASM
833         @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
834                 . nasm-2.02-win32.zip
835 !ENDIF
836 !IF "$(WIN_SETUP_OPT)" == "--download"
837         @$(SH) $(WIN_SETUP) --settag "$(WIRESHARK_LIBS)"
838 !ENDIF
839         @echo.
840         @echo Wireshark is ready to build.
841
842 # Cleanup files installed by the setup target. It will not remove the
843 # downloaded zip files.
844 # WHEN UPDATING LIBRARY VERSIONS, KEEP ALSO ONE FORMER VERSION SO
845 # UPDATING REMOVES THE FORMER USER DIRS
846 clean_setup:
847     rm -r -f $(WIRESHARK_LIBS)/adns-1.0-win32-05ws
848     rm -r -f $(WIRESHARK_LIBS)/c-ares-1.5.3ws
849     rm -r -f $(WIRESHARK_LIBS)/c-ares-1.6.0ws
850     rm -r -f $(WIRESHARK_LIBS)/c-ares-1.7.0-win??ws
851     rm -r -f $(WIRESHARK_LIBS)/c-ares-1.7.1-win??ws
852     rm -r -f $(WIRESHARK_LIBS)/gettext-0.14.5
853     rm -r -f $(WIRESHARK_LIBS)/gettext-runtime-0.17
854     rm -r -f $(WIRESHARK_LIBS)/gettext-runtime-0.17-1
855     rm -r -f $(WIRESHARK_LIBS)/gettext-0.17-1            # win64
856     rm -r -f $(WIRESHARK_LIBS)/glib
857     rm -r -f $(WIRESHARK_LIBS)/gnutls-2.8.1-1
858     rm -r -f $(WIRESHARK_LIBS)/gnutls-2.8.5-*-win??ws
859     rm -r -f $(WIRESHARK_LIBS)/gtk2
860     rm -r -f $(WIRESHARK_LIBS)/gtk+
861     rm -r -f $(WIRESHARK_LIBS)/gtk-wimp
862     rm -r -f $(WIRESHARK_LIBS)/kfw-2.5
863     rm -r -f $(WIRESHARK_LIBS)/kfw-3.2.2-ws1
864     rm -r -f $(WIRESHARK_LIBS)/kfw-3.2.2-i386-ws-vc6
865     rm -r -f $(WIRESHARK_LIBS)/libiconv-1.9.1.bin.woe32
866     rm -r -f $(WIRESHARK_LIBS)/lua5.1
867     rm -r -f $(WIRESHARK_LIBS)/lua5.1.4
868     rm -r -f $(WIRESHARK_LIBS)/libsmi-0.4.5
869     rm -r -f $(WIRESHARK_LIBS)/libsmi-0.4.8
870     rm -r -f $(WIRESHARK_LIBS)/nasm-2.00
871     rm -r -f $(WIRESHARK_LIBS)/nasm-2.02
872     rm -r -f $(WIRESHARK_LIBS)/pcre-6.4
873     rm -r -f $(WIRESHARK_LIBS)/pcre-7.0
874     rm -r -f $(WIRESHARK_LIBS)/portaudio_v19
875     rm -r -f $(WIRESHARK_LIBS)/portaudio_v19_2
876     rm -r -f $(WIRESHARK_LIBS)/user-guide
877     rm -r -f $(WIRESHARK_LIBS)/WpdPack
878     rm -r -f $(WIRESHARK_LIBS)/AirPcap_Devpack_1_0_0_594
879     rm -r -f $(WIRESHARK_LIBS)/AirPcap_Devpack_4_0_0_1480
880     rm -r -f $(WIRESHARK_LIBS)/AirPcap_Devpack_4_1_0_1622
881     rm -r -f $(WIRESHARK_LIBS)/zlib123
882     rm -r -f $(WIRESHARK_LIBS)/zlib123-dll
883     rm -r -f $(WIRESHARK_LIBS)/upx301w
884     rm -r -f $(WIRESHARK_LIBS)/upx303w
885     rm -r -f $(WIRESHARK_LIBS)/GeoIP-1.4.5ws
886     rm -r -f $(WIRESHARK_LIBS)/GeoIP-1.4.6-win??ws
887
888 ################################################################################
889 # Prepare the debug trees for running Wireshark/Tshark from there.
890 ################################################################################
891
892
893 # prepare debugging of Wireshark in INSTALL_DIR
894 debug-wireshark: wireshark.exe install-generated-files
895
896 # prepare debugging of tshark in INSTALL_DIR
897 debug-tshark: tshark.exe install-generated-files
898
899 # prepare debugging of rawshark in INSTALL_DIR
900 debug-rawshark: rawshark.exe install-generated-files
901
902 # prepare debugging of dumpcap in INSTALL_DIR
903 debug-dumpcap: dumpcap.exe install-generated-files
904
905
906 # install generated files (exe, "our" libs, ...)
907 install-generated-files:
908         set copycmd=/y
909         if not exist $(INSTALL_DIR) mkdir $(INSTALL_DIR)
910 !IF DEFINED (MSVCR_DLL) && "$(MSVC_VARIANT)" == "MSVC2008"
911         xcopy "$(MSVCR_DLL)" $(INSTALL_DIR)\*.* /d
912 !ENDIF
913 !IFDEF ENABLE_LIBWIRESHARK
914         xcopy epan\libwireshark.dll $(INSTALL_DIR) /d
915         if exist epan\libwireshark.pdb xcopy .\epan\libwireshark.pdb $(INSTALL_DIR) /d
916 !ENDIF
917         xcopy ".\wiretap\wiretap-$(WTAP_VERSION).dll" $(INSTALL_DIR) /d
918         if exist ".\wiretap\wiretap-$(WTAP_VERSION).pdb" xcopy ".\wiretap\wiretap-$(WTAP_VERSION).pdb" $(INSTALL_DIR) /d
919         xcopy ".\wsutil\libwsutil.dll" $(INSTALL_DIR) /d
920         if exist wireshark.exe copy wireshark.exe $(INSTALL_DIR)\wireshark.exe
921         if exist wireshark.pdb copy wireshark.pdb $(INSTALL_DIR)\wireshark.pdb
922         if exist ".\docbook\user-guide.chm" xcopy ".\docbook\user-guide.chm" $(INSTALL_DIR) /d
923         if exist tshark.exe xcopy tshark.exe $(INSTALL_DIR) /d
924         if exist tshark.pdb xcopy tshark.pdb $(INSTALL_DIR) /d
925         if exist rawshark.exe xcopy rawshark.exe $(INSTALL_DIR) /d
926         if exist rawshark.pdb xcopy rawshark.pdb $(INSTALL_DIR) /d
927         if exist dumpcap.exe xcopy dumpcap.exe $(INSTALL_DIR) /d
928         if exist dumpcap.pdb xcopy dumpcap.pdb $(INSTALL_DIR) /d
929         if exist mergecap.exe xcopy mergecap.exe $(INSTALL_DIR) /d
930         if exist mergecap.pdb xcopy mergecap.pdb $(INSTALL_DIR) /d
931         if exist text2pcap.exe xcopy text2pcap.exe $(INSTALL_DIR) /d
932         if exist text2pcap.pdb xcopy text2pcap.pdb $(INSTALL_DIR) /d
933         if exist capinfos.exe xcopy capinfos.exe $(INSTALL_DIR) /d
934         if exist capinfos.pdb xcopy capinfos.pdb $(INSTALL_DIR) /d
935         if exist editcap.exe xcopy editcap.exe $(INSTALL_DIR) /d
936         if exist editcap.pdb xcopy editcap.pdb $(INSTALL_DIR) /d
937         xcopy "doc\AUTHORS-SHORT" $(INSTALL_DIR) /d
938         xcopy ".\manuf" $(INSTALL_DIR) /d
939         xcopy ".\services" $(INSTALL_DIR) /d
940         $(TEXTIFY) ".\COPYING" $(INSTALL_DIR)
941         $(TEXTIFY) ".\NEWS" $(INSTALL_DIR)
942         $(TEXTIFY) ".\README" $(INSTALL_DIR)
943         $(TEXTIFY) ".\README.windows" $(INSTALL_DIR)
944         xcopy ".\cfilters" $(INSTALL_DIR) /d
945         xcopy ".\colorfilters" $(INSTALL_DIR) /d
946         xcopy ".\dfilters" $(INSTALL_DIR) /d
947         xcopy ".\smi_modules" $(INSTALL_DIR) /d
948 !IFDEF LUA_DIR
949         xcopy ".\epan\wslua\init.lua" $(INSTALL_DIR) /d
950         xcopy ".\epan\wslua\console.lua" $(INSTALL_DIR) /d
951 !ENDIF
952 !IFDEF PYTHON_DIR
953         if not exist $(INSTALL_DIR)\python mkdir $(INSTALL_DIR)\python
954         xcopy ".\epan\wspython\register-dissector.py" $(INSTALL_DIR)\python /d
955         xcopy ".\epan\wspython\wspy_dissector.py" $(INSTALL_DIR)\python /d
956         xcopy ".\epan\wspython\wspy_libws.py" $(INSTALL_DIR)\python /d
957 !ENDIF
958         xcopy ipmap.html $(INSTALL_DIR) /d
959         xcopy doc\*.html $(INSTALL_DIR) /d
960         if not exist $(INSTALL_DIR)\help mkdir $(INSTALL_DIR)\help
961         xcopy ".\help\*.*" $(INSTALL_DIR)\help /d
962 # you can't reliably use xcopy to rename files "on the fly" (so copy first, then rename)
963         xcopy ".\help\faq.txt" $(INSTALL_DIR) /d
964         $(UNIX2DOS) $(INSTALL_DIR)/help/*.txt
965         if not exist $(INSTALL_DIR)\dtds mkdir $(INSTALL_DIR)\dtds
966         xcopy ".\dtds\*.*" $(INSTALL_DIR)\dtds /d
967         if not exist $(INSTALL_DIR)\asn1 mkdir $(INSTALL_DIR)\asn1
968         echo create empty asn1 default.tt file to prevent problems 2> $(INSTALL_DIR)\asn1\default.tt
969         if not exist $(INSTALL_DIR)\radius mkdir $(INSTALL_DIR)\radius
970         xcopy ".\radius\*.*" $(INSTALL_DIR)\radius /d
971         if not exist $(INSTALL_DIR)\diameter mkdir $(INSTALL_DIR)\diameter
972         xcopy ".\diameter\*.dtd" $(INSTALL_DIR)\diameter /d
973         xcopy ".\diameter\*.xml" $(INSTALL_DIR)\diameter /d
974         if not exist $(INSTALL_DIR)\tpncp mkdir $(INSTALL_DIR)\tpncp
975         xcopy ".\tpncp\*.dat" $(INSTALL_DIR)\tpncp /d
976         if not exist $(INSTALL_DIR)\wimaxasncp mkdir $(INSTALL_DIR)\wimaxasncp
977         xcopy ".\wimaxasncp\*.*" $(INSTALL_DIR)\wimaxasncp /d
978         if not exist $(INSTALL_DIR)\plugins mkdir $(INSTALL_DIR)\plugins
979         if not exist $(INSTALL_DIR)\plugins\$(VERSION) mkdir $(INSTALL_DIR)\plugins\$(VERSION)
980         cd plugins
981         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake install-plugins
982         cd ..
983
984 # "install-all" will copy all files needed to run Wireshark/Tshark
985 # to the INSTALL_DIR, so you can run/debug Wireshark/Tshark from there.
986 install-all: install-generated-files
987         set copycmd=/y
988         if not exist $(INSTALL_DIR) mkdir $(INSTALL_DIR)
989         xcopy $(GTK_DIR)\bin\libgdk-win32-2.0-0.dll $(INSTALL_DIR) /d
990         xcopy $(GTK_DIR)\bin\libgdk_pixbuf-2.0-0.dll $(INSTALL_DIR) /d
991         xcopy $(GTK_DIR)\bin\libgtk-win32-2.0-0.dll $(INSTALL_DIR) /d
992         xcopy $(GTK_DIR)\bin\libatk-1.0-0.dll $(INSTALL_DIR) /d
993         xcopy $(GTK_DIR)\bin\libpango-1.0-0.dll $(INSTALL_DIR) /d
994         xcopy $(GTK_DIR)\bin\libpangowin32-1.0-0.dll $(INSTALL_DIR) /d
995         if not exist $(INSTALL_DIR)\etc mkdir $(INSTALL_DIR)\etc
996         if not exist $(INSTALL_DIR)\etc\gtk-2.0 mkdir $(INSTALL_DIR)\etc\gtk-2.0
997         if not exist $(INSTALL_DIR)\etc\pango mkdir $(INSTALL_DIR)\etc\pango
998         if not exist $(INSTALL_DIR)\lib mkdir $(INSTALL_DIR)\lib
999         if not exist $(INSTALL_DIR)\lib\gtk-2.0 mkdir $(INSTALL_DIR)\lib\gtk-2.0
1000         if not exist $(INSTALL_DIR)\lib\gtk-2.0\modules mkdir $(INSTALL_DIR)\lib\gtk-2.0\modules
1001         if not exist $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR) mkdir $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)
1002         if not exist $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\loaders mkdir $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\loaders
1003         if not exist $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\engines mkdir $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\engines
1004         xcopy $(GTK_DIR)\etc\gtk-2.0\*.* $(INSTALL_DIR)\etc\gtk-2.0 /d
1005         if exist $(GTK_DIR)\etc\pango xcopy $(GTK_DIR)\etc\pango\pango.* $(INSTALL_DIR)\etc\pango /d
1006         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
1007         xcopy $(GTK_DIR)\lib\gtk-2.0\modules\libgail.dll $(INSTALL_DIR)\lib\gtk-2.0\modules /d
1008         xcopy $(GTK_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\engines\libpixmap.dll $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\engines /d
1009 !IFDEF NEED_LIBPNG_DLL
1010         xcopy $(GTK_DIR)\bin\$(PNG_DLL) $(INSTALL_DIR) /d
1011 !ENDIF
1012 !IFDEF NEED_LIBTIFF_DLL
1013         xcopy $(GTK_DIR)\bin\$(TIFF_DLL) $(INSTALL_DIR) /d
1014 !ENDIF
1015 !IFDEF NEED_LIBJPEG_DLL
1016         xcopy $(GTK_DIR)\bin\$(JPEG_DLL) $(INSTALL_DIR) /d
1017 !ENDIF
1018 !IFDEF NEED_CAIRO_DLL
1019         xcopy $(GTK_DIR)\bin\libcairo-2.dll $(INSTALL_DIR)  /d
1020         xcopy $(GTK_DIR)\bin\libpangocairo-1.0-0.dll $(INSTALL_DIR) /d
1021 !ENDIF
1022 !IFDEF NEED_FREETYPE_DLL
1023         xcopy $(GTK_DIR)\bin\libpangoft2-1.0-0.dll $(INSTALL_DIR) /d
1024         xcopy $(GTK_DIR)\bin\$(FREETYPE_DLL) $(INSTALL_DIR) /d
1025 !ENDIF
1026 !IFDEF NEED_FONTCONFIG_DLL
1027         xcopy $(GTK_DIR)\bin\$(FONTCONFIG_DLL) $(INSTALL_DIR) /d
1028 !ENDIF
1029 !IFDEF NEED_EXPAT_DLL
1030         xcopy $(GTK_DIR)\bin\$(EXPAT_DLL) $(INSTALL_DIR) /d
1031 !ENDIF
1032         if not exist $(INSTALL_DIR)\$(GTK_WIMP_DLLDST_DIR) mkdir $(INSTALL_DIR)\$(GTK_WIMP_DLLDST_DIR)
1033         xcopy "$(GTK_WIMP_DLLSRC_DIR)\libwimp.dll" $(INSTALL_DIR)\$(GTK_WIMP_DLLDST_DIR) /d
1034         if not exist $(INSTALL_DIR)\$(GTK_WIMP_RCDST_DIR) mkdir $(INSTALL_DIR)\$(GTK_WIMP_RCDST_DIR)
1035         xcopy "$(GTK_WIMP_RCSRC_DIR)\gtkrc" $(INSTALL_DIR)\$(GTK_WIMP_RCDST_DIR) /d
1036         xcopy $(GTK_DIR)\bin\libgio-2.0-0.dll $(INSTALL_DIR) /d
1037         xcopy $(GTK_DIR)\bin\libglib-2.0-0.dll $(INSTALL_DIR) /d
1038         xcopy $(GTK_DIR)\bin\libgmodule-2.0-0.dll $(INSTALL_DIR) /d
1039         xcopy $(GTK_DIR)\bin\libgobject-2.0-0.dll $(INSTALL_DIR) /d
1040         xcopy $(GTK_DIR)\bin\libgthread-2.0-0.dll $(INSTALL_DIR) /d
1041         xcopy $(GTK_DIR)\bin\$(INTL_DLL) $(INSTALL_DIR) /d
1042 !IFDEF ZLIB_DIR
1043         xcopy $(ZLIB_DLL) $(INSTALL_DIR) /d
1044 !ENDIF
1045 !IFDEF C_ARES_DIR
1046         xcopy $(C_ARES_DLL) $(INSTALL_DIR) /d
1047 !ENDIF
1048 !IFDEF ADNS_DIR
1049         xcopy $(ADNS_DLL) $(INSTALL_DIR) /d
1050 !ENDIF
1051 !IFDEF PCRE_DIR
1052         xcopy $(PCRE_DIR)\bin\pcre3.dll $(INSTALL_DIR) /d
1053         xcopy $(PCRE_DIR)\man\cat3\pcrepattern.3.txt $(INSTALL_DIR) /d
1054 !ENDIF
1055 !IFDEF KFW_DIR
1056         xcopy $(KFW_PATH)\comerr32.dll $(INSTALL_DIR) /d
1057         xcopy $(KFW_PATH)\krb5_32.dll $(INSTALL_DIR) /d
1058         xcopy $(KFW_PATH)\k5sprt32.dll $(INSTALL_DIR) /d
1059 !ENDIF
1060 !IFDEF GNUTLS_DIR
1061         xcopy $(GNUTLS_DIR)\bin\libgcrypt-11.dll $(INSTALL_DIR) /d
1062         xcopy $(GNUTLS_DIR)\bin\libgnutls-26.dll $(INSTALL_DIR) /d
1063         xcopy $(GNUTLS_DIR)\bin\libgpg-error-0.dll $(INSTALL_DIR) /d
1064         xcopy $(GNUTLS_DIR)\bin\libtasn1-3.dll $(INSTALL_DIR) /d
1065 !ENDIF
1066 !IFDEF LUA_DIR
1067         xcopy "$(LUA_DIR)\lua5.1.dll" $(INSTALL_DIR) /d
1068 !ENDIF
1069 !IFDEF SMI_DIR
1070         if not exist $(INSTALL_DIR)\snmp mkdir $(INSTALL_DIR)\snmp
1071         if not exist $(INSTALL_DIR)\snmp\mibs mkdir $(INSTALL_DIR)\snmp\mibs
1072         xcopy "$(SMI_DIR)\lib\smi.dll" $(INSTALL_DIR) /d
1073         xcopy "$(SMI_DIR)\mibs\*" $(INSTALL_DIR)\snmp\mibs /d
1074 !ENDIF
1075
1076 clean-deps:
1077         rm -rf $(INSTALL_DIR)
1078         cd plugins
1079         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean-deps
1080         cd ..
1081
1082 checkapi_local:
1083         $(PERL) tools/checkAPIs.pl \
1084         $(wireshark_SOURCES) \
1085         $(TSHARK_TAP_SRC) \
1086 #       $(EXTRA_wireshark_SOURCES)
1087
1088 checkapi: checkapi_local
1089         cd wiretap
1090         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1091         cd ../codecs
1092         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1093         cd ../gtk
1094         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1095         cd ../epan
1096 ##      $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1097         cd ../epan/crypt
1098 ##      $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1099         cd ../dfilter
1100         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1101         cd ../ftypes
1102 ##      $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1103         cd ../wslua
1104 ##      $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1105         cd ../dissectors
1106         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1107         cd ..
1108         cd ../plugins
1109         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1110         cd ../wsutil
1111         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1112
1113 ####
1114 _FORCE_:  ## Assumption: no file named _FORCE_ exists in the current directory
1115