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