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