Use 'igncr' as needed with Bash (workaround for bug report 1162);
[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 include config.nmake
7 include <win32.mak>
8
9 ############### no need to modify below this line #########
10
11 CC = cl          
12 LINK= link
13          
14 LDFLAGS = /NOLOGO /INCREMENTAL:no /MACHINE:I386 $(LOCAL_LDFLAGS)
15
16 CFLAGS=-DHAVE_CONFIG_H $(LOCAL_CFLAGS) $(GLIB_CFLAGS) /I. /Iwiretap \
17         $(ZLIB_CFLAGS) /I$(PCAP_DIR)\include \
18         $(NET_SNMP_CFLAGS) \
19         $(ADNS_CFLAGS) $(PCRE_CFLAGS) $(GNUTLS_CFLAGS) $(LUA_CFLAGS) \
20         -D_U_="" -D_NEED_VAR_IMPORT_
21
22 CVARSDLL=-DWIN32 -DNULL=0 -D_MT -D_DLL
23
24 .c.obj::
25         $(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<
26
27 PLATFORM_SRC = capture-wpcap.c capture_wpcap_packet.c
28
29 include Makefile.common
30
31 wireshark_OBJECTS = $(wireshark_SOURCES:.c=.obj)
32 tshark_OBJECTS = $(tshark_SOURCES:.c=.obj)
33 dftest_OBJECTS = $(dftest_SOURCES:.c=.obj)
34 dumpcap_OBJECTS = $(dumpcap_SOURCES:.c=.obj)
35 randpkt_OBJECTS = $(randpkt_SOURCES:.c=.obj)
36
37 EXTRA_OBJECTS = \
38         mkstemp.obj     \
39         strptime.obj
40
41 wireshark_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
42         wsock32.lib user32.lib shell32.lib comctl32.lib \
43         $(NET_SNMP_LIBS) \
44         $(HHC_LIBS) \
45 !IFDEF ENABLE_LIBWIRESHARK
46         epan\libwireshark.lib \
47 !ELSE
48         epan\dissectors\dissectors.lib \
49         epan\wireshark.lib \
50         epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
51         $(ADNS_LIBS) \
52         $(PCRE_LIBS) \
53         $(ZLIB_LIBS) \
54         $(GNUTLS_LIBS) 
55 !ENDIF
56
57 tshark_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
58         wsock32.lib user32.lib \
59         $(GLIB_LIBS) \
60         $(NET_SNMP_LIBS) \
61 !IFDEF ENABLE_LIBWIRESHARK
62         epan\libwireshark.lib \
63 !ELSE
64         epan\dissectors\dissectors.lib \
65         epan\wireshark.lib \
66         epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
67         $(ADNS_LIBS) \
68         $(PCRE_LIBS) \
69         $(ZLIB_LIBS) \
70         $(GNUTLS_LIBS)
71 !ENDIF
72
73 capinfos_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
74         wsock32.lib user32.lib \
75         $(GLIB_LIBS)
76
77 editcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
78         wsock32.lib user32.lib \
79         $(GLIB_LIBS)
80
81 mergecap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
82         wsock32.lib user32.lib \
83         $(GLIB_LIBS)
84
85 dumpcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
86         wsock32.lib user32.lib \
87         $(GLIB_LIBS)
88
89 dftest_LIBS=  wiretap\wiretap-$(WTAP_VERSION).lib \
90         wsock32.lib user32.lib \
91         $(GLIB_LIBS) \
92         $(NET_SNMP_LIBS) \
93 !IFDEF ENABLE_LIBWIRESHARK
94         epan\libwireshark.lib \
95 !ELSE
96         epan\dissectors\dissectors.lib \
97         epan\wireshark.lib \
98         epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
99         $(ADNS_LIBS) \
100         $(PCRE_LIBS) \
101         $(ZLIB_LIBS) \
102         $(GNUTLS_LIBS)  
103 !ENDIF
104
105 randpkt_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
106         user32.lib \
107         $(GLIB_LIBS) \
108         $(NET_SNMP_LIBS)
109
110 EXECUTABLES=wireshark.exe wireshark-gtk2.exe tshark.exe \
111         capinfos.exe editcap.exe mergecap.exe text2pcap.exe randpkt.exe dumpcap.exe
112
113 RESOURCES=image\wireshark.res image\libwireshark.res image\tshark.res \
114         image\capinfos.res image\editcap.res image\mergecap.res \
115         image\text2pcap.res image\wiretap.res image\dumpcap.res
116
117 all: config.h tools image codecs wiretap epan $(EXECUTABLES) $(RESOURCES) doc install-deps
118
119 packaging: all
120         cd packaging
121         cd nsis
122         $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
123         cd ..
124         cd ..
125
126 separate_packaging: all
127         cd packaging
128         cd nsis
129 !IFDEF GTK1_DIR
130         $(MAKE) /$(MAKEFLAGS) -f makefile.nmake GTK1_ONLY="USE"
131 !ENDIF
132 !IFDEF GTK2_DIR
133         $(MAKE) /$(MAKEFLAGS) -f makefile.nmake GTK2_ONLY="USE"
134 !ENDIF
135         cd ..
136         cd ..
137
138 packaging_u3: all
139         cd packaging
140         cd u3
141         cd win32
142         $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
143         cd ..
144         cd ..
145         cd ..
146
147 # use (info-)zip from cygwin to pack things
148 packaging_zip1: all
149         rm -f wireshark-gtk1.zip
150         zip -r -9 wireshark-gtk1.zip $(INSTALL1_DIR)/*.*
151
152 # use (info-)zip from cygwin to pack things
153 packaging_zip2: all
154         rm -f wireshark-gtk2.zip
155         zip -r -9 wireshark-gtk2.zip $(INSTALL2_DIR)/*.*
156
157 packaging_zip: packaging_zip1 packaging_zip2
158
159
160 $(RESOURCES): image
161
162 wiretap\wiretap-$(WTAP_VERSION).lib: image wiretap
163
164 !IFNDEF GTK1_DIR
165 wireshark.exe   : 
166 !ELSE
167 wireshark.exe   : config.h svnversion.h $(wireshark_OBJECTS) getopt.obj codecs epan gtk image\wireshark.res wiretap\wiretap-$(WTAP_VERSION).lib codecs\codecs.lib gtk\libui.lib plugins
168         @echo Linking $@
169         $(LINK) @<<
170                 /OUT:wireshark.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:windows $(wireshark_LIBS) getopt.obj $(GTK1_LIBS) codecs\codecs.lib gtk\libui.lib $(wireshark_OBJECTS) image\wireshark.res
171 <<
172 !ENDIF
173
174 !IFNDEF GTK2_DIR
175 wireshark-gtk2.exe      : 
176 !ELSE
177 wireshark-gtk2.exe      : config.h svnversion.h $(wireshark_OBJECTS) getopt.obj codecs epan gtk2 image\wireshark.res wiretap\wiretap-$(WTAP_VERSION).lib codecs\codecs.lib gtk2.tmp\libui.lib plugins
178         @echo Linking $@
179         $(LINK) @<<
180                 /OUT:wireshark-gtk2.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:windows $(wireshark_LIBS) getopt.obj $(GTK2_LIBS) codecs\codecs.lib gtk2.tmp\libui.lib $(wireshark_OBJECTS) image\wireshark.res
181 <<
182 !ENDIF
183
184 tshark.exe      : config.h svnversion.h $(tshark_OBJECTS) getopt.obj epan image\tshark.res wiretap\wiretap-$(WTAP_VERSION).lib plugins
185         @echo Linking $@
186         $(LINK) @<<
187                 /OUT:tshark.exe $(conflags) $(conlibsdll) $(LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console $(tshark_LIBS) $(tshark_OBJECTS) getopt.obj image\tshark.res
188 <<
189
190 capinfos.exe    : config.h capinfos.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\capinfos.res
191         @echo Linking $@
192         $(LINK) @<<
193                 /OUT:capinfos.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console capinfos.obj getopt.obj $(capinfos_LIBS) image\capinfos.res
194 <<
195
196 editcap.exe     : config.h editcap.obj getopt.obj strptime.obj epan\crypt-md5.obj wiretap\wiretap-$(WTAP_VERSION).lib image\editcap.res
197         @echo Linking $@
198         $(LINK) @<<
199                 /OUT:editcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console editcap.obj getopt.obj strptime.obj epan\crypt-md5.obj $(editcap_LIBS) image\editcap.res
200 <<
201
202 mergecap.exe    : config.h svnversion.h mergecap.obj merge.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\mergecap.res
203         @echo Linking $@
204         $(LINK) @<<
205                 /OUT:mergecap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console mergecap.obj merge.obj getopt.obj $(mergecap_LIBS) image\mergecap.res
206 <<
207
208 text2pcap.exe   : config.h text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
209         @echo Linking $@
210         $(LINK) @<<
211                 /OUT:text2pcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
212 <<
213
214 dftest.exe      : $(dftest_OBJECTS) epan
215         @echo Linking $@
216         $(LINK) @<<
217                 /OUT:dftest.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dftest_LIBS) $(dftest_OBJECTS)
218 <<
219
220 randpkt.exe     : $(randpkt_OBJECTS) getopt.obj
221         @echo Linking $@
222         $(LINK) @<<
223                 /OUT:randpkt.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(randpkt_LIBS) $(randpkt_OBJECTS) getopt.obj
224 <<
225
226 dumpcap.exe     : config.h svnversion.h $(dumpcap_OBJECTS) getopt.obj mkstemp.obj wiretap\wiretap-$(WTAP_VERSION).lib image\dumpcap.res 
227         @echo Linking $@
228         $(LINK) @<<
229                 /OUT:dumpcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dumpcap_LIBS) $(dumpcap_OBJECTS) getopt.obj mkstemp.obj image\dumpcap.res
230 <<
231
232
233 config.h        : config.h.win32 config.nmake
234         sed -e s/@VERSION@/$(VERSION)/ \
235             -e "s/@HAVE_GNU_ADNS@/$(ADNS_CONFIG)/" \
236             -e "s/@HAVE_PCRE@/$(PCRE_CONFIG)/" \
237             -e "s/@HAVE_KFW@/$(KFW_CONFIG)/" \
238             -e "s/@HAVE_NETTLE@/$(NETTLE_CONFIG)/" \
239             -e "s/@HAVE_LIBZ@/$(ZLIB_CONFIG)/" \
240             -e "s/@HAVE_LIBPCAP@/$(WINPCAP_CONFIG)/" \
241             -e "s/@HAVE_PCAP_FINDALLDEVS@/$(PCAP_FINDALLDEVS_CONFIG)/" \
242             -e "s/@HAVE_PCAP_DATALINK_NAME_TO_VAL@/$(PCAP_DATALINK_NAME_TO_VAL_CONFIG)/" \
243             -e "s/@HAVE_PCAP_DATALINK_VAL_TO_NAME@/$(PCAP_DATALINK_VAL_TO_NAME_CONFIG)/" \
244             -e "s/@HAVE_PCAP_BREAKLOOP@/$(PCAP_BREAKLOOP_CONFIG)/" \
245             -e "s/@HAVE_LIBWIRESHARKDLL@/$(LIBWIRESHARK_CONFIG)/" \
246             -e "s/@WPCAP_CONSTIFIED@/$(WPCAP_CONSTIFIED_CONFIG)/" \
247             -e "s/@HAVE_LIBGNUTLS@/$(GNUTLS_CONFIG)/" \
248             -e "s/@HAVE_LIBGCRYPT@/$(LIBGCRYPT_CONFIG)/" \
249             -e "s/@HAVE_LUA@/$(LUA_CONFIG)/" \
250             -e "s/@HAVE_LUA_5_1@/$(LUA_VERSION)/" \
251             -e "s/@HAVE_AIRPCAP@/$(AIRPCAP_CONFIG)/" \
252             -e "s/@HAVE_LIBPORTAUDIO@/$(PORTAUDIO_CONFIG)/" \
253             -e "s/@PORTAUDIO_API_1@/$(PORTAUDIO_API_CONFIG)/" \
254             -e "s/@HAVE_NET_SNMP@/$(NET_SNMP_CONFIG)/" \
255             -e "s/@HAVE_SOME_SNMP@/$(SOME_SNMP_CONFIG)/" \
256             < config.h.win32 > $@
257
258 ps.c    : rdps.exe print.ps
259         rdps print.ps ps.c
260
261
262 #
263 # Build the version string
264 #
265 !IF EXIST(".svn/entries")
266 SVNENTRIES = .svn/entries
267 !ELSE
268 SVNENTRIES =
269 !ENDIF
270 svnversion.h: $(SVNENTRIES)
271         rm -f svnversion.h
272         $(PERL) make-version.pl
273
274 #
275 # Build the short version of the authors file for the about dialog
276 #
277 AUTHORS-SHORT: AUTHORS make-authors-short.pl
278         $(PERL) perlnoutf.pl make-authors-short.pl < AUTHORS > AUTHORS-SHORT
279
280 #
281 # Build the short version of the authors file with formatting codes for
282 # the man page
283 #
284 AUTHORS-SHORT-FORMAT: AUTHORS-SHORT make-authors-format.pl
285     $(PERL) perlnoutf.pl make-authors-format.pl < AUTHORS-SHORT > AUTHORS-SHORT-FORMAT
286
287 #
288 # Build "tshark-tap-register.c", which contains a function 
289 # "register_all_tap_listeners()"
290 # that calls the register routines for all tehtereal tap listeners.
291 #
292 # We do this by grepping through sources.
293 #
294 # Formatting conventions:  The name of the tap_listener_register_* 
295 # routines must start in column zero, or must be preceded only by 
296 # "void " starting in column zero, and must not be inside #if.
297 #
298 # The first argument is the name of the file to write.
299 # The second argument is the directory in which the source files live.
300 # All subsequent arguments are the files to scan.
301 #
302 tshark-tap-register.c: $(TSHARK_TAP_SRC) make-tapreg-dotc
303         @echo Making tshark-tap-register.c
304         @$(SH) make-tapreg-dotc tshark-tap-register.c . $(TSHARK_TAP_SRC)
305
306 text2pcap-scanner.c : text2pcap-scanner.l
307         $(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
308
309 clean_gtk2.tmp:
310         rm -f gtk2.tmp/*.*
311         if exist gtk2.tmp rmdir gtk2.tmp
312
313 clean: clean_gtk2.tmp clean-deps
314         rm -f $(wireshark_OBJECTS) $(tshark_OBJECTS) $(EXTRA_OBJECTS) \
315                 $(EXECUTABLES) $(PDB_FILE) \
316                 capinfos.obj editcap.obj mergecap.obj text2pcap.obj getopt.obj\
317                 text2pcap-scanner.obj text2pcap-scanner.c rdps.obj \
318                 rdps.pdb rdps.exe rdps.ilk config.h ps.c AUTHORS-SHORT \
319                 AUTHORS-SHORT-FORMAT \
320                 dftest.obj dftest.exe randpkt.obj randpkt.ext dumpcap.obj \
321                 doxygen.cfg \
322                 $(RESOURCES) libwireshark.dll wiretap-$(WTAP_VERSION).dll
323         cd asn1
324         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
325         cd ..
326         cd wiretap
327         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
328         cd ../codecs
329         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
330         cd ../gtk
331         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
332         cd ../epan
333         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
334         cd ../plugins
335         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
336         cd ../tools
337         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
338         cd ../image
339         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
340         cd ../doc
341         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
342         cd ../help
343         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
344         cd ../packaging/nsis
345         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
346         cd ../u3/win32
347         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
348         cd ../../..
349
350 # "distclean" removes all files not part of the distribution.
351 # It does not remove generated files that are part of the distribution.
352 distclean: clean
353         rm -f config.h $(BUILT_SOURCES)
354         cd wiretap
355         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
356         cd ../codecs
357         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
358         cd ../gtk
359         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
360         cd ../epan
361         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
362         cd ../plugins
363         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
364         cd ../tools
365         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
366         cd ../image
367         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
368         cd ../doc
369         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
370         cd ../help
371         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
372         cd ../packaging/nsis
373         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
374         cd ../u3/win32
375         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
376         cd ../../..
377
378 # Make "maintainer-clean" only if you would like to remove ALL generated
379 # files.
380 # Be sure to have python and perl installed to regenerate them.
381 maintainer-clean: distclean
382         rm -f $(GENERATED_FILES)
383         cd wiretap
384         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
385         cd ../codecs
386         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
387         cd ../gtk
388         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
389         cd ../epan
390         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
391         cd ../plugins
392         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
393         cd ../tools
394         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
395         cd ../image
396         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
397         cd ../doc
398         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
399         cd ../help
400         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
401         cd ../packaging/nsis
402         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
403         cd ../u3/win32
404         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
405         cd ../../..
406
407 tools::
408         cd tools
409         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
410         cd ..
411
412 image::
413         cd image
414         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
415         cd ..
416
417 wiretap::
418         cd wiretap
419         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
420         cd ..
421
422 codecs::
423         cd codecs
424         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
425         cd ..
426
427 gtk:: help config.h svnversion.h AUTHORS-SHORT doxygen
428         cd gtk
429         $(MAKE) /$(MAKEFLAGS) /f Makefile.nmake GTK_CFLAGS="$(GTK1_CFLAGS)" GTK_LIBS="$(GTK1_LIBS)" libui.lib
430         cd ..
431
432 # copy all required files to gtk2.tmp (but only when newer than existing) and compile in that dir
433 gtk2:: help config.h svnversion.h AUTHORS-SHORT
434         if not exist gtk2.tmp mkdir gtk2.tmp
435         cd gtk
436         set copycmd=/y
437         xcopy Makefile.* ..\gtk2.tmp /d
438         xcopy *.c        ..\gtk2.tmp /d
439         xcopy *.h        ..\gtk2.tmp /d
440         cd ..\gtk2.tmp
441         $(MAKE) /$(MAKEFLAGS) /f Makefile.nmake GTK_CFLAGS="$(GTK2_CFLAGS)" GTK_LIBS="$(GTK2_LIBS)" libui.lib
442         cd ..
443
444 epan:: $(RESOURCES) $(BUILT_SOURCES) doxygen
445         cd epan
446         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
447         cd ..
448
449 plugins::
450         cd plugins
451         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
452         cd ..
453
454 doc::
455         cd doc
456         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
457         cd ..
458
459 help::
460         cd help
461         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
462         cd ..
463
464 doxygen.cfg: config.nmake doxygen.cfg.in
465         sed -e s/@VERSION@/$(VERSION)/ \
466             < doxygen.cfg.in > $@
467
468 doxygen-run:
469 !IFDEF DOXYGEN
470         $(DOXYGEN) doxygen.cfg
471 !ENDIF
472
473 doxygen: doxygen.cfg doxygen-run
474
475 ################################################################################
476 # Prepare build environment by downloading and installing required libraries
477 ################################################################################
478
479 # The required tools to build Wireshark.
480 #
481 # The 'find' tool is available both in \WINNT\System32 and in cygwin's /usr/bin.
482 # We only need the cygwin version (for some shell scripts).
483 # In the PATH, System32 is before cygwin's dir, so explicitly check for /usr/bin/find.
484 REQUIRED_TOOLS=\
485         $(CC) \
486         $(LINK) \
487         nmake \
488         $(SH_PROG)      \
489         $(YACC) \
490         $(LEX)  \
491         env     \
492         grep    \
493         /usr/bin/find   \
494         $(PERL) \
495         $(PYTHON)       \
496         sed     \
497         unzip   \
498         wget
499
500 verify_tools:
501         @$(SH) tools\win32-setup.sh --appverify $(REQUIRED_TOOLS)
502
503 # Download and install all the required libraries into WIRESHARK_LIBS.
504 # If you used this setup target before, consider doing a clean_setup.
505 setup: verify_tools
506     if not exist $(WIRESHARK_LIBS) md $(WIRESHARK_LIBS)
507 !IF "$(GTK2_INST_VERSION)" == "2.8"
508         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
509                 glib gtk2.8/glib-2.12.4.zip
510         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
511                 glib gtk2.8/glib-dev-2.12.4.zip
512 !ELSEIF "$(GTK2_INST_VERSION)" == "2.6"
513         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
514                 glib gtk2.6/glib-2.6.6.zip
515         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
516                 glib gtk2.6/glib-dev-2.6.6.zip
517 !ELSEIF "$(GTK2_INST_VERSION)" == "2.4"
518         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
519                 glib gtk2.4/glib-2.4.7.zip
520         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
521                 glib gtk2.4/glib-dev-2.4.7.zip
522 !ELSE
523         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
524                 glib glib-2.2.3-20040116.zip
525         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
526                 glib glib-dev-2.2.3-20040116.zip
527 !ENDIF
528 !IFDEF GTK1_DIR
529         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
530                 gtk+ gtk+-1.3.0-20030717.zip
531         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
532                 gtk+ gtk+-dev-1.3.0-20030115.zip
533 !ENDIF
534         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
535                 libiconv-1.9.1.bin.woe32 libiconv-1.9.1.bin.woe32.zip
536         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
537                 gettext-0.14.5 gettext-0.14.5.zip
538 !IFDEF NET_SNMP_DIR
539         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
540                 . net-snmp-5.3.1.zip
541 !ENDIF
542 !IFDEF KFW_DIR
543         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
544                 kfw-2.5 kfw-2.5.zip
545 !ENDIF
546 !IFDEF PCAP_DIR
547         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
548                 . WpdPack_3_1.zip
549 !ENDIF
550 !IFDEF ADNS_DIR
551         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
552                 . adns-1.0-win32-05.zip
553 !ENDIF
554 !IFDEF PCRE_DIR
555         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
556                 pcre-6.4 pcre-6.4-bin.zip
557         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
558                 pcre-6.4 pcre-6.4-lib.zip
559 !ENDIF
560 !IFDEF ZLIB_DIR
561         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
562                 zlib123-dll zlib123-dll.zip
563 !ENDIF
564 !IFDEF LUA_DIR
565         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
566                 . lua5_1_dll.zip
567 !ENDIF
568 !IFDEF GNUTLS_DIR
569         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
570                 . gnutls-1.5.1-1.zip
571 !ENDIF
572 !IFDEF PORTAUDIO_DIR
573         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
574                 . portaudio_v18_1.zip
575 !ENDIF
576
577 !IFDEF GTK2_DIR
578 !IF "$(GTK2_INST_VERSION)" == "2.8"
579         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
580                 gtk2 gtk2.8/gtk+-2.8.20.zip
581         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
582                 gtk2 gtk2.8/gtk+-dev-2.8.20.zip
583         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
584                 gtk2 gtk2.8/cairo-1.2.6.zip
585         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
586                 gtk2 gtk2.8/cairo-dev-1.2.6.zip
587         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
588                 gtk2 gtk2.8/atk-1.10.3.zip
589         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
590                 gtk2 gtk2.8/atk-dev-1.10.3.zip
591         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
592                 gtk2 gtk2.8/libpng-1.2.8-bin.zip
593 !ELSEIF "$(GTK2_INST_VERSION)" == "2.6"
594         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
595                 gtk2 gtk2.6/gtk+-2.6.9.zip
596         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
597                 gtk2 gtk2.6/gtk+-dev-2.6.9.zip
598         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
599                 gtk2 gtk2.6/atk-1.9.0.zip
600         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
601                 gtk2 gtk2.6/atk-dev-1.9.0.zip
602 !ELSEIF "$(GTK2_INST_VERSION)" == "2.4"
603         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
604                 gtk2 gtk2.4/gtk+-2.4.14.zip
605         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
606                 gtk2 gtk2.4/gtk+-dev-2.4.14.zip
607         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
608                 gtk2 gtk2.4/atk-1.6.0.zip
609         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
610                 gtk2 gtk2.4/atk-dev-1.6.0.zip
611 !ELSE
612         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
613                 gtk2 gtk2/gtk+-2.2.4-20040124.zip
614         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
615                 gtk2 gtk2/gtk+-dev-2.2.4-20040124.zip
616         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
617                 gtk2 gtk2/atk-1.4.0.zip
618         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
619                 gtk2 gtk2/atk-dev-1.4.0.zip
620 !ENDIF
621 !IF "$(PANGO_INST_VERSION)" == "1.14"
622         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
623                 gtk2 gtk2.8/pango-1.14.5.zip
624         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
625                 gtk2 gtk2.8/pango-dev-1.14.5.zip
626 !ELSEIF "$(PANGO_INST_VERSION)" == "1.10"
627         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
628                 gtk2 gtk2.8/pango-1.10.1.zip
629         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
630                 gtk2 gtk2.8/pango-dev-1.10.1.zip
631 !ELSEIF "$(PANGO_INST_VERSION)" == "1.8"
632         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
633                 gtk2 gtk2.6/pango-1.8.2.zip
634         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
635                 gtk2 gtk2.6/pango-dev-1.8.2.zip
636 !ELSEIF "$(PANGO_INST_VERSION)" == "1.4"
637         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
638                 gtk2 gtk2.4/pango-1.4.1.zip
639         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
640                 gtk2 gtk2.4/pango-dev-1.4.1.zip
641 !ELSE
642         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
643                 gtk2 gtk2/pango-1.2.5-20040124.zip
644         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
645                 gtk2 gtk2/pango-dev-1.2.5-20040124.zip
646 !ENDIF
647 !ENDIF
648 !IFDEF GTK_WIMP_DIR
649         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
650                 gtk-wimp gtk-wimp/gtk-wimp-0.7.0-bin.zip
651 !ENDIF
652         @echo.
653         @echo Wireshark is ready to build.
654
655 # Cleanup files installed by the setup target. It will not remove the 
656 # downloaded zip files.
657 clean_setup:
658     rm -r -f $(WIRESHARK_LIBS)/adns-1.0-win32-05
659     rm -r -f $(WIRESHARK_LIBS)/gettext-0.14.5
660     rm -r -f $(WIRESHARK_LIBS)/glib
661     rm -r -f $(WIRESHARK_LIBS)/gnutls-1.5.1-1
662     rm -r -f $(WIRESHARK_LIBS)/gtk2
663     rm -r -f $(WIRESHARK_LIBS)/gtk+
664     rm -r -f $(WIRESHARK_LIBS)/gtk-wimp
665     rm -r -f $(WIRESHARK_LIBS)/kfw-2.5
666     rm -r -f $(WIRESHARK_LIBS)/libiconv-1.9.1.bin.woe32
667     rm -r -f $(WIRESHARK_LIBS)/lua5.1
668     rm -r -f $(WIRESHARK_LIBS)/net-snmp-5.3.1
669     rm -r -f $(WIRESHARK_LIBS)/pcre-6.4
670     rm -r -f $(WIRESHARK_LIBS)/portaudio_v18_1
671     rm -r -f $(WIRESHARK_LIBS)/WpdPack
672     rm -r -f $(WIRESHARK_LIBS)/zlib123-dll
673
674 ################################################################################
675 # Prepare the debug trees for running Wireshark/Tshark from there.
676 ################################################################################
677
678
679 # generate and install Wireshark GTK1 in INSTALL1_DIR
680 debug-gtk1: wireshark.exe install-files1
681
682 # generate and install Wireshark GTK2 in INSTALL2_DIR
683 debug-gtk2: wireshark-gtk2.exe install-files2
684
685 # generate and install Wireshark GTK2 in INSTALL2_DIR
686 debug-tshark: tshark.exe
687         set copycmd=/y
688         set INSTALL_DIR=$(INSTALL2_DIR)
689         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake install-common-files
690
691
692 # "install-deps" will copy all files needed to run Wwireshark/Tshark
693 # to the INSTALL1_DIR/INSTALL2_DIR, so you can run/debug Wireshark/Tshark from there.
694
695 install-deps: install-deps1 install-deps2 install-files1 install-files2
696
697 # install Wireshark GTK2 and other generated files
698 install-files1:
699 !IFDEF GTK1_DIR
700         set copycmd=/y
701         set INSTALL_DIR=$(INSTALL1_DIR)
702         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake install-common-files
703         xcopy wireshark.exe $(INSTALL1_DIR) /d
704 !ENDIF
705
706 # install Wireshark GTK2 and other generated files
707 install-files2:
708 !IFDEF GTK2_DIR
709         set INSTALL_DIR=$(INSTALL2_DIR)
710         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake install-common-files
711         copy wireshark-gtk2.exe $(INSTALL2_DIR)\wireshark.exe
712         if exist ".\docbook\user-guide.chm" xcopy ".\docbook\user-guide.chm" $(INSTALL2_DIR) /d
713 !ENDIF
714
715 install-common-files:
716         set copycmd=/y
717         if not exist $(INSTALL_DIR) mkdir $(INSTALL_DIR)
718 !IFDEF ENABLE_LIBWIRESHARK
719         xcopy epan\libwireshark.dll $(INSTALL_DIR) /d
720 !ENDIF
721         xcopy ".\wiretap\wiretap-$(WTAP_VERSION).dll" $(INSTALL_DIR) /d
722         xcopy ".\epan\libwireshark.dll" $(INSTALL_DIR) /d
723         if exist tshark.exe xcopy tshark.exe $(INSTALL_DIR) /d
724         if exist dumpcap.exe xcopy dumpcap.exe $(INSTALL2_DIR) /d
725         if exist mergecap.exe xcopy mergecap.exe $(INSTALL2_DIR) /d
726         if exist text2pcap.exe xcopy text2pcap.exe $(INSTALL2_DIR) /d
727         if exist capinfos.exe xcopy capinfos.exe $(INSTALL_DIR) /d
728         if exist editcap.exe xcopy editcap.exe $(INSTALL_DIR) /d
729         xcopy ".\AUTHORS-SHORT" $(INSTALL_DIR) /d
730         xcopy ".\manuf" $(INSTALL_DIR) /d
731         xcopy ".\FAQ" $(INSTALL_DIR) /d
732         xcopy ".\README" $(INSTALL_DIR) /d
733         xcopy ".\README.win32" $(INSTALL_DIR) /d
734         xcopy ".\AUTHORS-SHORT" $(INSTALL_DIR) /d
735         xcopy ".\COPYING" $(INSTALL_DIR) /d
736         copy ".\NEWS" $(INSTALL_DIR)\NEWS.txt
737         xcopy ".\cfilters" $(INSTALL_DIR) /d
738         xcopy ".\colorfilters" $(INSTALL_DIR) /d
739         xcopy ".\dfilters" $(INSTALL_DIR) /d
740     xcopy doc\*.html $(INSTALL_DIR) /d
741 !IFDEF ETHEREAL_EUG_DIR
742     xcopy $(ETHEREAL_EUG_DIR) $(INSTALL_DIR) /d
743 !ENDIF
744         if not exist $(INSTALL_DIR)\help mkdir $(INSTALL_DIR)\help
745         xcopy ".\help\*.*" $(INSTALL_DIR)\help /d
746         if not exist $(INSTALL_DIR)\dtds mkdir $(INSTALL_DIR)\dtds
747         xcopy ".\dtds\*.*" $(INSTALL_DIR)\dtds /d
748         if not exist $(INSTALL_DIR)\asn1 mkdir $(INSTALL_DIR)\asn1
749         echo create empty asn1 default.tt file to prevent problems 2> $(INSTALL_DIR)\asn1\default.tt
750         if not exist $(INSTALL_DIR)\radius mkdir $(INSTALL_DIR)\radius
751         xcopy ".\radius\*.*" $(INSTALL_DIR)\radius /d
752         if not exist $(INSTALL_DIR)\diameter mkdir $(INSTALL_DIR)\diameter
753         xcopy ".\diameter\*.dtd" $(INSTALL_DIR)\diameter /d
754         xcopy ".\diameter\*.xml" $(INSTALL_DIR)\diameter /d
755         if not exist $(INSTALL_DIR)\plugins\$(VERSION) mkdir $(INSTALL_DIR)\plugins\$(VERSION)
756         xcopy ".\plugins\agentx\agentx.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
757         xcopy ".\plugins\artnet\artnet.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
758         xcopy ".\plugins\asn1\asn1.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
759         xcopy ".\plugins\ciscosm\ciscosm.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
760         xcopy ".\plugins\docsis\docsis.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
761         xcopy ".\plugins\enttec\enttec.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
762         xcopy ".\plugins\giop\coseventcomm.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
763         xcopy ".\plugins\giop\cosnaming.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
764         xcopy ".\plugins\giop\parlay.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
765         xcopy ".\plugins\giop\tango.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
766         xcopy ".\plugins\gryphon\gryphon.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
767         xcopy ".\plugins\h223\h223.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
768         xcopy ".\plugins\irda\irda.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
769         xcopy ".\plugins\lwres\lwres.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
770         xcopy ".\plugins\mate\mate.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
771         xcopy ".\plugins\megaco\megaco.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
772         xcopy ".\plugins\mgcp\mgcp.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
773         xcopy ".\plugins\opsi\opsi.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
774         xcopy ".\plugins\pcli\pcli.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
775         xcopy ".\plugins\profinet\profinet.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
776         xcopy ".\plugins\rlm\rlm.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
777         xcopy ".\plugins\rtnet\rtnet.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
778         xcopy ".\plugins\rudp\rudp.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
779         xcopy ".\plugins\sbus\sbus.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
780         xcopy ".\plugins\stats_tree\stats_tree.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
781         xcopy ".\plugins\v5ua\v5ua.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
782         if exist custom-install.bat custom-install $(INSTALL_DIR) $(VERSION)
783
784 install-deps1: install-common-deps1
785 !IFDEF GTK1_DIR
786         set copycmd=/y
787         xcopy $(GTK1_DIR)\lib\libgtk-0.dll $(INSTALL1_DIR) /d
788         xcopy $(GTK1_DIR)\lib\libgdk-0.dll $(INSTALL1_DIR) /d
789 !ENDIF
790
791 install-deps2: install-common-deps2
792 !IFDEF GTK2_DIR
793         set copycmd=/y
794         xcopy $(GTK2_DIR)\bin\libgdk-win32-2.0-0.dll $(INSTALL2_DIR) /d
795         xcopy $(GTK2_DIR)\bin\libgdk_pixbuf-2.0-0.dll $(INSTALL2_DIR) /d
796         xcopy $(GTK2_DIR)\bin\libgtk-win32-2.0-0.dll $(INSTALL2_DIR) /d
797         xcopy $(GTK2_DIR)\bin\libatk-1.0-0.dll $(INSTALL2_DIR) /d
798         xcopy $(GTK2_DIR)\bin\libpango-1.0-0.dll $(INSTALL2_DIR) /d
799         xcopy $(GTK2_DIR)\bin\libpangowin32-1.0-0.dll $(INSTALL2_DIR) /d
800         if not exist $(INSTALL2_DIR)\etc mkdir $(INSTALL2_DIR)\etc
801         if not exist $(INSTALL2_DIR)\etc\gtk-2.0 mkdir $(INSTALL2_DIR)\etc\gtk-2.0
802         if not exist $(INSTALL2_DIR)\etc\pango mkdir $(INSTALL2_DIR)\etc\pango
803         if not exist $(INSTALL2_DIR)\lib mkdir $(INSTALL2_DIR)\lib
804         if not exist $(INSTALL2_DIR)\lib\gtk-2.0 mkdir $(INSTALL2_DIR)\lib\gtk-2.0
805         if not exist $(INSTALL2_DIR)\lib\gtk-2.0\$(GTK2_LIB_DIR) mkdir $(INSTALL2_DIR)\lib\gtk-2.0\$(GTK2_LIB_DIR)
806         if not exist $(INSTALL2_DIR)\lib\gtk-2.0\$(GTK2_LIB_DIR)\loaders mkdir $(INSTALL2_DIR)\lib\gtk-2.0\$(GTK2_LIB_DIR)\loaders
807         if not exist $(INSTALL2_DIR)\lib\gtk-2.0\$(GTK2_LIB_DIR)\immodules mkdir $(INSTALL2_DIR)\lib\gtk-2.0\$(GTK2_LIB_DIR)\immodules
808 #       if not exist $(INSTALL2_DIR)\lib\pango mkdir $(INSTALL2_DIR)\lib\pango
809 #       if not exist $(INSTALL2_DIR)\lib\pango\$(PANGO_LIB_DIR) mkdir $(INSTALL2_DIR)\lib\pango\$(PANGO_LIB_DIR)
810 #       if not exist $(INSTALL2_DIR)\lib\pango\$(PANGO_LIB_DIR)\modules mkdir $(INSTALL2_DIR)\lib\pango\$(PANGO_LIB_DIR)\modules
811         xcopy $(GTK2_DIR)\etc\gtk-2.0\*.* $(INSTALL2_DIR)\etc\gtk-2.0 /d
812         xcopy $(GTK2_DIR)\etc\pango\pango.* $(INSTALL2_DIR)\etc\pango /d
813         xcopy $(GTK2_DIR)\lib\gtk-2.0\$(GTK2_LIB_DIR)\loaders\libpixbufloader-*.dll $(INSTALL2_DIR)\lib\gtk-2.0\$(GTK2_LIB_DIR)\loaders /d
814         xcopy $(GTK2_DIR)\lib\gtk-2.0\$(GTK2_LIB_DIR)\immodules\im-*.dll $(INSTALL2_DIR)\lib\gtk-2.0\$(GTK2_LIB_DIR)\immodules /d
815 #       xcopy $(GTK2_DIR)\lib\pango\$(PANGO_LIB_DIR)\modules\pango-*.dll $(INSTALL2_DIR)\lib\pango\$(PANGO_LIB_DIR)\modules /d
816 !IFDEF NEED_LIBPNG_DLL
817         xcopy $(GTK2_DIR)\bin\libpng13.dll $(INSTALL2_DIR) /d
818 !ENDIF
819 !IFDEF NEED_CAIRO_DLL
820         xcopy $(GTK2_DIR)\bin\libcairo-2.dll $(INSTALL2_DIR)  /d
821         xcopy $(GTK2_DIR)\bin\libpangocairo-1.0-0.dll $(INSTALL2_DIR) /d
822 !ENDIF
823 !IFDEF GTK_WIMP_DIR
824         if not exist $(INSTALL2_DIR)\$(GTK_WIMP_DLLDST_DIR) mkdir $(INSTALL2_DIR)\$(GTK_WIMP_DLLDST_DIR)
825         xcopy "$(GTK_WIMP_DLLSRC_DIR)\libwimp.dll" $(INSTALL2_DIR)\$(GTK_WIMP_DLLDST_DIR) /d
826         if not exist $(INSTALL2_DIR)\$(GTK_WIMP_RCDST_DIR) mkdir $(INSTALL2_DIR)\$(GTK_WIMP_RCDST_DIR)
827         xcopy "$(GTK_WIMP_RCSRC_DIR)\gtkrc" $(INSTALL2_DIR)\$(GTK_WIMP_RCDST_DIR) /d
828 !ENDIF
829 !ENDIF
830
831 install-common-deps1:
832 !IFDEF GTK1_DIR
833         set INSTALL_DIR=$(INSTALL1_DIR)
834         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake install-common-deps
835 !ENDIF
836
837 install-common-deps2:
838 !IFDEF GTK2_DIR
839         set INSTALL_DIR=$(INSTALL2_DIR)
840         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake install-common-deps
841 !ENDIF
842
843 install-common-deps:
844         set copycmd=/y
845         if not exist $(INSTALL_DIR) mkdir $(INSTALL_DIR)
846         xcopy $(GLIB_DIR)\bin\libglib-2.0-0.dll $(INSTALL_DIR) /d
847         xcopy $(GLIB_DIR)\bin\libgmodule-2.0-0.dll $(INSTALL_DIR) /d
848         xcopy $(GLIB_DIR)\bin\libgobject-2.0-0.dll $(INSTALL_DIR) /d
849         xcopy $(ICONV_DIR)\bin\iconv.dll $(INSTALL_DIR) /d
850         xcopy $(GETTEXT_DIR)\bin\intl.dll $(INSTALL_DIR) /d
851 !IFDEF ZLIB_DIR
852         xcopy $(ZLIB_DIR)\zlib1.dll $(INSTALL_DIR) /d
853 !ENDIF
854 !IFDEF ADNS_DIR
855         xcopy $(ADNS_DIR)\adns_win32\LIB\adns_dll.dll $(INSTALL_DIR) /d
856 !ENDIF
857 !IFDEF PCRE_DIR
858         xcopy $(PCRE_DIR)\bin\pcre.dll $(INSTALL_DIR) /d
859         xcopy $(PCRE_DIR)\man\cat3\pcrepattern.3.txt $(INSTALL_DIR) /d
860 !ENDIF
861 !IFDEF KFW_DIR
862         xcopy $(KFW_DIR)\bin\comerr32.dll $(INSTALL_DIR) /d
863         xcopy $(KFW_DIR)\bin\krb5_32.dll $(INSTALL_DIR) /d
864 !ENDIF
865 !IFDEF GNUTLS_DIR
866         xcopy $(GNUTLS_DIR)\bin\libgcrypt-11.dll $(INSTALL_DIR) /d
867         xcopy $(GNUTLS_DIR)\bin\libgnutls-14.dll $(INSTALL_DIR) /d
868         xcopy $(GNUTLS_DIR)\bin\libgnutls-extra-14.dll $(INSTALL_DIR) /d
869         xcopy $(GNUTLS_DIR)\bin\libgnutls-openssl-14.dll $(INSTALL_DIR) /d
870         xcopy $(GNUTLS_DIR)\bin\libgpg-error-0.dll $(INSTALL_DIR) /d
871         xcopy $(GNUTLS_DIR)\bin\libtasn1-3.dll $(INSTALL_DIR) /d
872 !ENDIF
873 !IFDEF NET_SNMP_DIR
874         if not exist $(INSTALL_DIR)\snmp mkdir $(INSTALL_DIR)\snmp
875         if not exist $(INSTALL_DIR)\snmp\mibs mkdir $(INSTALL_DIR)\snmp\mibs
876         xcopy "$(NET_SNMP_DIR)\mibs\*.txt" $(INSTALL_DIR)\snmp\mibs /d
877 !ENDIF
878 !IFDEF LUA_DIR
879         xcopy "$(LUA_DIR)\lib\dll\lua5.1.dll" $(INSTALL_DIR) /d
880 !ENDIF
881
882 clean-deps1:
883         rm -rf $(INSTALL1_DIR)
884         cd plugins
885         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean-deps
886         cd ..
887
888 clean-deps2:
889         rm -rf $(INSTALL2_DIR)
890         cd plugins
891         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean-deps
892         cd ..
893
894 clean-deps: clean-deps1 clean-deps2
895