aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.nmake
blob: 4eb2741f504d9bc4839969a50c5ec5faed0ffe93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
## Makefile for building ethereal.exe with Microsoft C and nmake
## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
#
# $Id: Makefile.nmake,v 1.301 2003/06/02 18:40:00 gerald Exp $

include config.nmake
include <win32.mak>

############### no need to modify below this line #########

CC = cl
LINK= link

LDFLAGS = /NOLOGO /INCREMENTAL:no /MACHINE:I386 $(LOCAL_LDFLAGS)

CFLAGS=-DHAVE_CONFIG_H $(LOCAL_CFLAGS) /I$(GLIB_DIR) /I$(GLIB_DIR)\gmodule \
	/I$(GTK_DIR) /I. /Iwiretap /I$(GTK_DIR)\gdk /I$(GTK_DIR)\gdk\win32 \
	/I$(ZLIB_DIR) /I$(PCAP_DIR)\include \
	/I$(NET_SNMP_DIR)\include /I$(NET_SNMP_DIR)\win32 \
	/I$(ADNS_DIR)\src /I$(ADNS_DIR)\adns_win32 \
	-D_U_=""

CVARSDLL=-DWIN32 -DNULL=0 -D_MT -D_DLL

.c.obj::
   $(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<

DISSECTOR_SRC = \
	packet-aarp.c  \
	packet-acap.c  \
	packet-afp.c   \
	packet-afs.c   \
	packet-aim.c   \
	packet-ajp13.c		\
	packet-ans.c   \
	packet-aodv.c  \
	packet-arcnet.c \
	packet-arp.c   \
	packet-asap.c  \
	packet-ascend.c\
	packet-asf.c   \
	packet-atalk.c \
	packet-atm.c   \
	packet-auto_rp.c   \
	packet-bacapp.c   \
	packet-bacnet.c   \
	packet-beep.c \
	packet-bgp.c   \
	packet-bofl.c  \
	packet-bootp.c \
	packet-bootparams.c \
	packet-bpdu.c  \
	packet-brdwlk.c \
	packet-bvlc.c \
	packet-cdp.c   \
	packet-cgmp.c  \
	packet-chdlc.c  \
	packet-clearcase.c  \
	packet-clip.c  \
	packet-clnp.c  \
	packet-cops.c  \
	packet-cosine.c  \
	packet-cpha.c  \
	packet-cups.c  \
	packet-data.c  \
	packet-dccp.c \
	packet-dcerpc.c  \
	packet-dcerpc-afs4int.c  \
	packet-dcerpc-atsvc.c \
	packet-dcerpc-bossvr.c  \
	packet-dcerpc-browser.c  \
	packet-dcerpc-cds_clerkserver.c  \
	packet-dcerpc-cds_solicit.c  \
	packet-dcerpc-conv.c  \
	packet-dcerpc-cprpc_server.c  \
	packet-dcerpc-dce122.c \
	packet-dcerpc-dfs.c \
	packet-dcerpc-dnsserver.c \
	packet-dcerpc-dtsprovider.c \
	packet-dcerpc-dtsstime_req.c \
	packet-dcerpc-epm.c  \
	packet-dcerpc-fldb.c  \
	packet-dcerpc-ftserver.c \
	packet-dcerpc-krb5rpc.c \
	packet-dcerpc-lsa.c \
	packet-dcerpc-lsa-ds.c \
	packet-dcerpc-mapi.c  \
	packet-dcerpc-mgmt.c  \
	packet-dcerpc-ndr.c  \
	packet-dcerpc-netlogon.c \
	packet-dcerpc-nspi.c \
	packet-dcerpc-oxid.c  \
	packet-dcerpc-reg.c \
	packet-dcerpc-remact.c  \
	packet-dcerpc-rep_proc.c  \
	packet-dcerpc-roverride.c  \
	packet-dcerpc-rpriv.c  \
	packet-dcerpc-rs_acct.c  \
	packet-dcerpc-rs_attr.c  \
	packet-dcerpc-rs_misc.c  \
	packet-dcerpc-rs_pgo.c  \
	packet-dcerpc-rs_repadm.c  \
	packet-dcerpc-rs_replist.c  \
	packet-dcerpc-rs_unix.c  \
	packet-dcerpc-rsec_login.c  \
	packet-dcerpc-samr.c \
	packet-dcerpc-secidmap.c \
	packet-dcerpc-spoolss.c \
	packet-dcerpc-srvsvc.c \
	packet-dcerpc-svcctl.c \
	packet-dcerpc-tapi.c \
	packet-dcerpc-tkn4int.c \
	packet-dcerpc-ubikdisk.c \
	packet-dcerpc-ubikvote.c \
	packet-dcerpc-update.c \
	packet-dcerpc-wkssvc.c \
	packet-ddtp.c  \
	packet-dec-bpdu.c \
	packet-dhcpv6.c \
	packet-diameter.c \
	packet-distcc.c \
	packet-dlsw.c  \
	packet-dns.c   \
	packet-dsi.c   \
	packet-dvmrp.c \
	packet-eap.c \
	packet-eapol.c \
	packet-eigrp.c \
	packet-enc.c	\
	packet-esis.c  \
	packet-eth.c   \
	packet-etherip.c	\
	packet-ethertype.c   \
	packet-fc.c \
	packet-fcct.c \
	packet-fcdns.c \
	packet-fcels.c \
	packet-fcfcs.c \
	packet-fcfzs.c \
	packet-fcip.c \
	packet-fclctl.c \
	packet-fcp.c \
	packet-fcswils.c \
	packet-fddi.c  \
	packet-fix.c   \
	packet-fr.c    \
	packet-frame.c  \
	packet-ftp.c   \
	packet-fw1.c   \
	packet-giop.c  \
	packet-gmrp.c \
	packet-gnutella.c \
	packet-gre.c   \
	packet-gssapi.c \
	packet-gtp.c   \
	packet-gvrp.c  \
	packet-h1.c    \
	packet-h261.c  \
	packet-hclnfsd.c  \
	packet-hpext.c \
	packet-hsrp.c  \
	packet-http.c  \
	packet-hyperscsi.c \
	packet-iapp.c  \
	packet-ib.c  \
	packet-icap.c  \
	packet-icmpv6.c\
	packet-icp.c   \
	packet-icq.c   \
	packet-ieee80211.c \
	packet-ieee8023.c \
	packet-igmp.c  \
	packet-igrp.c  \
	packet-imap.c   \
	packet-ip.c    \
	packet-ipfc.c    \
	packet-ipmi.c  \
	packet-ipp.c   \
	packet-ipsec.c \
	packet-ipv6.c  \
	packet-ipx.c   \
	packet-ipxwan.c \
	packet-irc.c   \
	packet-isakmp.c\
	packet-iscsi.c \
	packet-isdn.c \
	packet-isis.c  \
	packet-isis-clv.c \
	packet-isis-hello.c \
	packet-isis-lsp.c \
	packet-isis-snp.c \
	packet-isl.c   \
	packet-isns.c \
	packet-isup.c  \
	packet-iua.c   \
	packet-kadm5.c \
	packet-kerberos.c \
	packet-klm.c   \
	packet-l2tp.c  \
	packet-lapb.c  \
	packet-lapbether.c \
	packet-lapd.c  \
	packet-ldap.c  \
	packet-ldp.c  \
	packet-llc.c   \
	packet-lmi.c   \
	packet-lmp.c   \
	packet-lpd.c   \
	packet-m2pa.c  \
	packet-m2tp.c  \
	packet-m2ua.c  \
	packet-m3ua.c  \
	packet-mbtcp.c \
	packet-mdshdr.c \
	packet-mip.c  \
	packet-mip6.c  \
	packet-mmse.c  \
	packet-mount.c \
	packet-mpeg1.c  \
	packet-mpls.c \
	packet-mrdisc.c \
	packet-msdp.c  \
	packet-msn-messenger.c \
	packet-msnip.c \
	packet-msproxy.c \
	packet-mtp2.c \
	packet-mtp3.c \
	packet-mtp3mg.c \
	packet-mysql.c \
	packet-nbipx.c \
	packet-nbns.c  \
	packet-ncp.c   \
	packet-ncp2222.c   \
	packet-ndmp.c \
        packet-ndps.c \
	packet-netbios.c \
	packet-netflow.c \
	packet-nfs.c   \
	packet-nfsacl.c \
	packet-nfsauth.c \
	packet-nisplus.c \
	packet-nlm.c   \
	packet-nlsp.c  \
	packet-nntp.c  \
	packet-ntlmssp.c  \
	packet-ntp.c  \
	packet-null.c  \
	packet-osi.c   \
	packet-osi-options.c \
	packet-ospf.c  \
	packet-pcnfsd.c \
	packet-pflog.c \
	packet-pgm.c   \
	packet-pim.c   \
	packet-pop.c   \
	packet-portmap.c   \
	packet-ppp.c   \
	packet-pppoe.c \
	packet-pptp.c  \
	packet-prism.c \
	packet-q2931.c \
	packet-q931.c  \
	packet-qllc.c  \
	packet-quake.c \
	packet-quake2.c \
	packet-quake3.c \
	packet-quakeworld.c \
	packet-radius.c\
	packet-ranap.c \
	packet-raw.c   \
	packet-rip.c   \
	packet-ripng.c \
	packet-rlogin.c \
	packet-rmcp.c  \
	packet-rmi.c \
	packet-rmp.c   \
	packet-rpc.c   \
	packet-rpl.c   \
	packet-rquota.c \
	packet-rsh.c   \
	packet-rstat.c \
	packet-rsvp.c  \
	packet-rsync.c \
	packet-rtcp.c  \
	packet-rtp.c   \
	packet-rtsp.c  \
	packet-rwall.c \
	packet-rx.c  \
	packet-sadmind.c \
	packet-sap.c   \
	packet-sccp.c  \
	packet-sccpmg.c  \
	packet-scsi.c  \
	packet-sctp.c  \
	packet-sdlc.c  \
	packet-sdp.c   \
	packet-sip.c   \
	packet-skinny.c   \
	packet-slimp3.c   \
	packet-sll.c   \
	packet-slowprotocols.c \
	packet-smb.c   \
	packet-smb-browse.c \
	packet-smb-common.c \
	packet-smb-logon.c \
	packet-smb-mailslot.c \
	packet-smb-pipe.c \
	packet-smb-sidsnooping.c \
	packet-smpp.c \
	packet-smtp.c \
	packet-sna.c   \
	packet-snaeth.c \
	packet-snmp.c	\
	packet-socks.c \
	packet-spnego.c \
	packet-spray.c \
	packet-srvloc.c \
	packet-sscop.c \
	packet-ssh.c   \
	packet-ssl.c   \
	packet-stat.c   \
	packet-stat-notify.c \
	packet-sua.c   \
	packet-syslog.c \
	packet-tacacs.c \
	packet-tcp.c   \
	packet-tds.c   \
	packet-telnet.c\
	packet-tftp.c  \
	packet-time.c  \
	packet-tns.c \
	packet-tpkt.c  \
	packet-tr.c    \
	packet-trmac.c \
	packet-tsp.c \
	packet-tzsp.c  \
	packet-ucp.c   \
	packet-udp.c   \
	packet-v120.c \
	packet-vines.c \
	packet-vj.c   \
	packet-vlan.c \
	packet-vrrp.c \
	packet-vtp.c  \
	packet-wap.c \
	packet-wbxml.c \
	packet-wccp.c \
	packet-wcp.c \
	packet-wfleet-hdlc.c \
	packet-who.c  \
	packet-wlancap.c \
	packet-wsp.c \
	packet-wtls.c \
	packet-wtp.c \
	packet-x11.c	\
	packet-x25.c   \
	packet-x29.c   \
	packet-xdmcp.c \
	packet-xot.c   \
	packet-xyplex.c   \
	packet-yhoo.c  \
	packet-ymsg.c  \
	packet-ypbind.c \
	packet-yppasswd.c \
	packet-ypserv.c \
	packet-ypxfr.c \
	packet-zebra.c

DISSECTOR_OBJECTS = $(DISSECTOR_SRC:.c=.obj)

TETHEREAL_TAP_SRC = \
	tap-dcerpcstat.c	\
	tap-iostat.c		\
	tap-iousers.c		\
	tap-mgcpstat.c		\
	tap-protocolinfo.c	\
	tap-protohierstat.c	\
	tap-rpcstat.c		\
	tap-rpcprogs.c		\
	tap-smbstat.c

TETHEREAL_TAP_OBJECTS = $(TETHEREAL_TAP_SRC:.c=.obj)

ETHEREAL_COMMON_OBJECTS = \
	afn.obj          \
	asn1.obj         \
	capture_stop_conditions.obj \
	capture-wpcap.obj \
	cfile.obj       \
	column.obj       \
	conditions.obj   \
	crypt-des.obj    \
	crypt-md4.obj    \
	crypt-md5.obj    \
	crypt-rc4.obj    \
	follow.obj       \
	g711.obj	\
	getopt.obj	 \
	in_cksum.obj	 \
	ipproto.obj      \
	packet-dcerpc-nt.obj \
	pcap-util.obj    \
	prefs.obj        \
	print.obj        \
	ps.obj           \
	ptvcursor.obj    \
	reassemble.obj   \
	register.obj     \
	ringbuffer.obj   \
	tap.obj		\
	timestats.obj   \
	util.obj         \
	xdlc.obj         \
	xmlstub.obj	 \

ethereal_OBJECTS = \
	$(DISSECTOR_OBJECTS) \
	$(ETHEREAL_COMMON_OBJECTS) \
	capture.obj		\
	file.obj         	\
	filters.obj      	\
	proto_hier_stats.obj	\
	summary.obj

tethereal_OBJECTS = \
	$(DISSECTOR_OBJECTS) \
	$(ETHEREAL_COMMON_OBJECTS) \
	$(TETHEREAL_TAP_OBJECTS) \
	tethereal-tap-register.obj \
	tethereal.obj

dftest_OBJECTS = \
	$(DISSECTOR_OBJECTS) \
	$(ETHEREAL_COMMON_OBJECTS) \
	dftest.obj

randpkt_OBJECTS = \
	randpkt.obj

EXTRA_OBJECTS = \
#	snprintf.obj	\
#	strerror.obj	\
	mkstemp.obj	\
	strptime.obj

ethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
	gtk\libui.lib epan\ethereal.lib \
	epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
	wsock32.lib user32.lib \
	$(GTK_DIR)\gtk\gtk-$(GTK_VERSION).lib \
	$(GTK_DIR)\gdk\gdk-$(GTK_VERSION).lib \
	$(GLIB_DIR)\glib-$(GLIB_VERSION).lib \
	$(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib \
	$(NET_SNMP_DIR)\win32\lib\libsnmp.lib \
	$(ADNS_DIR)\adns_win32\lib\adns_dll.lib
#	$(PCAP_DIR)\lib\wpcap.lib

tethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
	epan\ethereal.lib \
	epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
	wsock32.lib user32.lib \
	$(GLIB_DIR)\glib-$(GLIB_VERSION).lib \
	$(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib \
	$(NET_SNMP_DIR)\win32\lib\libsnmp.lib \
	$(ADNS_DIR)\adns_win32\lib\adns_dll.lib

editcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
	wsock32.lib user32.lib \
	$(GLIB_DIR)\glib-$(GLIB_VERSION).lib \
	$(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib

mergecap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
	wsock32.lib user32.lib \
	$(GLIB_DIR)\glib-$(GLIB_VERSION).lib \
	$(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib

dftest_LIBS=  wiretap\wiretap-$(WTAP_VERSION).lib epan\ethereal.lib \
	epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
	wsock32.lib user32.lib \
	wiretap\wiretap-$(WTAP_VERSION).lib \
	$(GLIB_DIR)\glib-$(GLIB_VERSION).lib \
	$(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib

randpkt_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
	user32.lib \
	$(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib \
	$(NET_SNMP_DIR)\win32\lib\libsnmp.lib

EXECUTABLES=ethereal.exe tethereal.exe editcap.exe mergecap.exe text2pcap.exe

RESOURCES=image\ethereal.res image\tethereal.res image\editcap.res image\mergecap.res image\text2pcap.res

all: tools wiretap gtk epan image $(EXECUTABLES) $(RESOURCES)

$(RESOURCES): image

wiretap\wiretap-$(WTAP_VERSION).lib: wiretap

ethereal.exe	: config.h $(ethereal_OBJECTS) $(EXTRA_OBJECTS) epan gtk image\ethereal.res wiretap\wiretap-$(WTAP_VERSION).lib gtk\libui.lib plugins
	@echo Linking $@
	$(LINK) @<<
		/OUT:ethereal.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(ethereal_LIBS) $(ethereal_OBJECTS) $(EXTRA_OBJECTS) image\ethereal.res
<<

tethereal.exe	: config.h $(tethereal_OBJECTS) $(EXTRA_OBJECTS) epan image\tethereal.res wiretap\wiretap-$(WTAP_VERSION).lib plugins
	@echo Linking $@
	$(LINK) @<<
		/OUT:tethereal.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(tethereal_LIBS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) image\tethereal.res
<<

editcap.exe	: config.h editcap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\editcap.res
	@echo Linking $@
	$(LINK) @<<
		/OUT:editcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console editcap.obj getopt.obj $(editcap_LIBS) image\editcap.res
<<

mergecap.exe	: config.h mergecap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\mergecap.res
	@echo Linking $@
	$(LINK) @<<
		/OUT:mergecap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console mergecap.obj getopt.obj $(mergecap_LIBS) image\mergecap.res
<<

text2pcap.exe	: config.h text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
	@echo Linking $@
	$(LINK) @<<
		/OUT:text2pcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
<<

dftest.exe	: $(dftest_OBJECTS) $(EXTRA_OBJECTS)
	$(LINK) @<<
		/OUT:dftest.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dftest_LIBS) $(dftest_OBJECTS) $(EXTRA_OBJECTS)
<<

randpkt.exe	: $(randpkt_OBJECTS) $(EXTRA_OBJECTS)
	$(LINK) @<<
		/OUT:randpkt.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(randpkt_LIBS) $(randpkt_OBJECTS)
<<

config.h	: config.h.win32
	sed -e s/@VERSION@/$(VERSION)/ < config.h.win32 > $@

ps.c	: rdps.exe print.ps
	rdps print.ps ps.c

#
# The header files listed here are built from x11-fields using Perl;
# we declare a dependency here so that they get built.
#
packet-x11.obj	: packet-x11.c x11-declarations.h x11-register-info.h

#
# Build various header files for the X11 dissector.
#
x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
	$(PERL) process-x11-fields.pl <x11-fields

packet-ncp2222.c : ncp2222.py
!IFDEF PYTHON
	@echo Making packet-ncp2222.c
	$(PYTHON) ncp2222.py -o packet-ncp2222.c
!ELSE
	@echo Faking packet-ncp2222.c...
	@echo Python is required to build the NCP disector
	@echo Hiding packet-ncp.c...
	mv packet-ncp.c packet-ncp.c.save
	touch packet-ncp.c $@
!ENDIF

#
# Build "register.c", which contains a function "register_all_protocols()"
# that calls the register routines for all protocols.
#
# We do this by grepping through sources.  If that turns out to be too slow,
# maybe we could just require every .o file to have an register routine
# of a given name (packet-aarp.o -> proto_register_aarp, etc.).
#
# Formatting conventions:  The name of the proto_register_* routines must
# start in column zero, or must be preceded only by "void " starting in
# column zero, and must not be inside #if.
#
# We assume that all dissector routines are in "packet-XXX.c" files.
#
# For some unknown reason, having a big "for" loop in the Makefile
# to scan all the "packet-XXX.c" files doesn't work with some "make"s;
# they seem to pass only the first few names in the list to the shell,
# for some reason.
#
# Therefore, we have a script to generate the "register.c" file.
#
# The first argument is the name of the file to write.
# The second argument is the directory in which the source files live.
# All subsequent arguments are the files to scan.
#
# On Windows, however, that script runs slowly, as multiple greps
# and seds are run for each input file, so, if Python is present
# (as indicated by PYTHON being defined), we run a faster Python
# script to do that work instead.  That script doesn't take the name
# of the file to write as an argument; it always writes to
# "register.c".
#
register.c: $(DISSECTOR_SRC)
!IFDEF PYTHON
	@echo Making register.c (using python)
	@$(PYTHON) make-reg-dotc.py . $(DISSECTOR_SRC)
!ELSE
	@echo Making register.c (using sh)
	@$(SH) make-reg-dotc register.c . $(DISSECTOR_SRC)
!ENDIF

#
# Build "tethereal-tap-register.c", which contains a function 
# "register_all_tap_listeners()"
# that calls the register routines for all tehtereal tap listeners.
#
# We do this by grepping through sources.
#
# Formatting conventions:  The name of the tap_listener_register_* 
# routines must start in column zero, or must be preceded only by 
# "void " starting in column zero, and must not be inside #if.
#
# The first argument is the name of the file to write.
# The second argument is the directory in which the source files live.
# All subsequent arguments are the files to scan.
#
tethereal-tap-register.c: $(TETHEREAL_TAP_SRC) make-tapreg-dotc
	@echo Making tethereal-tap-register.c
	@$(SH) make-tapreg-dotc tethereal-tap-register.c . $(TETHEREAL_TAP_SRC)

text2pcap-scanner.c : text2pcap-scanner.l
	$(LEX) -otext2pcap-scanner.c text2pcap-scanner.l

clean:
	rm -f $(ethereal_OBJECTS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) \
		$(EXECUTABLES) $(PDB_FILE) \
		editcap.obj mergecap.obj text2pcap.obj \
		text2pcap-scanner.obj text2pcap-scanner.c register.c \
		rdps.obj rdps.pdb config.h ps.c \
		rdps.exe rdps.ilk dftest.obj dftest.exe randpkt.obj randpkt.ext \
		$(RESOURCES)
	cd wiretap
	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
	cd ../gtk
	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
	cd ../epan
	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
	cd ../plugins
	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
	cd ../tools
	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
	cd ../image
	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
	cd ../doc
	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
	cd ../packaging/nsis
	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
	cd ../..

# Call distclean only, if you would like to remove ALL generated files.
# Be sure to have python and perl installed to regenerate them.
distclean: clean
	rm -f x11-declarations.h x11-register-info.h packet-ncp2222.c

tools::
	cd tools
	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
	cd ..

image::
	cd image
	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
	cd ..

wiretap::
	cd wiretap
	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
	cd ..

gtk:: config.h
	cd gtk
	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
	cd ..

epan::
	cd epan
	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
	cd ..

plugins::
	cd plugins
	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
	cd ..