Add a separate hash table to the reassembly code for reassembled
[obnox/wireshark/wip.git] / Makefile.am
1 # Makefile.am
2 # Automake file for Ethereal
3 #
4 # $Id: Makefile.am,v 1.421 2002/04/15 21:47:59 guy Exp $
5 #
6 # Ethereal - Network traffic analyzer
7 # By Gerald Combs <gerald@ethereal.com>
8 # Copyright 1998 Gerald Combs
9
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU General Public License
12 # as published by the Free Software Foundation; either version 2
13 # of the License, or (at your option) any later version.
14
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 # GNU General Public License for more details.
19
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write to the Free Software
22 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
23
24 ACLOCAL_AMFLAGS = `./aclocal-flags`
25
26 #
27 # This is a hideous hack.
28 #
29 # Automake needs to know into which sections to install various man
30 # pages; if the names in "man_MANS" have suffixes, it can infer the
31 # sections from the name (e.g., "hello.1" goes in section 1), but if
32 # they don't have suffixes, it can't tell what sections to put them, and
33 # it just gives up and doesn't create any rules to install them (and it
34 # gives up silently, so you have no clue what's wrong).
35 #
36 # Therefore, we can't just set "man_MANS" to a list of variables to be
37 # filled in by the configure script, as those variables don't have man
38 # page section numbers.
39 #
40 # It turns out (although this is not documented anywhere I could find
41 # in the automake Info file) that if you define, instead, variables with
42 # names like "man{section}_MANS", automake will infer that the names in
43 # those variables are the names of man pages to be installed in section
44 # "{section}".
45 #
46 # So, as all our man pages go in section 1, we define "man1_MANS" to
47 # contain all the man page.
48 #
49 # *However*, if "man_MANS" isn't defined at all, automake concludes that
50 # there are no man pages, the fact that, say, "man1_MANS" is defined
51 # nonwithstanding!  (I suspect this is the result of a mistaken attempt
52 # to get people to fix their automake files not to use "MANS"; if "MANS"
53 # is defined, it prints a warning and sets the exit status, but doesn't
54 # exit, and then it just gives up if "man_MANS" isn't defined,
55 # presumably on the theory that the only reason it wouldn't be defined
56 # is because the automake file uses the obsolete "MANS" variable instead
57 # of the shiny new "man_MANS" variable.)
58 #
59 # So we also define "man_MANS", but don't define it as anything;
60 # automake will arrange that the Makefile define it as the union of all
61 # the "man{section}_MANS" variables.
62 #
63 bin_PROGRAMS = @ethereal_bin@ @editcap_bin@ @mergecap_bin@ @tethereal_bin@ @dftest_bin@ @randpkt_bin@ @text2pcap_bin@
64 bin_SCRIPTS = @idl2eth_bin@
65 man1_MANS = @ethereal_man@ @editcap_man@ @mergecap_man@ @tethereal_man@ @text2pcap_man@ @idl2eth_man@
66 man_MANS = 
67
68 EXTRA_PROGRAMS = ethereal ethereal_static tethereal tethereal_static editcap mergecap dftest text2pcap
69 EXTRA_SCRIPTS = idl2eth
70
71 sysconf_DATA = manuf dictionary.dtd dictionary.xml mobileipv4.xml \
72         nasreq.xml sunping.xml
73
74 DISSECTOR_SRC = \
75         packet-aarp.c  \
76         packet-afs.c   \
77         packet-aim.c   \
78         packet-arp.c   \
79         packet-asap.c  \
80         packet-ascend.c\
81         packet-atalk.c \
82         packet-atm.c   \
83         packet-auto_rp.c   \
84         packet-bacapp.c   \
85         packet-bacnet.c   \
86         packet-beep.c \
87         packet-bgp.c   \
88         packet-bootp.c \
89         packet-bootparams.c \
90         packet-bpdu.c  \
91         packet-bvlc.c \
92         packet-cdp.c   \
93         packet-cgmp.c  \
94         packet-chdlc.c  \
95         packet-clip.c  \
96         packet-clnp.c  \
97         packet-cops.c  \
98         packet-cups.c  \
99         packet-data.c  \
100         packet-dcerpc.c  \
101         packet-dcerpc-conv.c  \
102         packet-dcerpc-dfs.c \
103         packet-dcerpc-epm.c  \
104         packet-dcerpc-lsa.c \
105         packet-dcerpc-mgmt.c  \
106         packet-dcerpc-ndr.c  \
107         packet-dcerpc-netlogon.c \
108         packet-dcerpc-oxid.c  \
109         packet-dcerpc-reg.c \
110         packet-dcerpc-remact.c  \
111         packet-dcerpc-samr.c \
112         packet-dcerpc-spoolss.c \
113         packet-dcerpc-srvsvc.c \
114         packet-dcerpc-wkssvc.c \
115         packet-ddtp.c  \
116         packet-dec-bpdu.c \
117         packet-dhcpv6.c \
118         packet-diameter.c \
119         packet-dlsw.c  \
120         packet-dns.c   \
121         packet-dsi.c   \
122         packet-dvmrp.c \
123         packet-eap.c \
124         packet-eapol.c \
125         packet-eigrp.c \
126         packet-esis.c  \
127         packet-eth.c   \
128         packet-ethertype.c   \
129         packet-fddi.c  \
130         packet-fr.c    \
131         packet-frame.c  \
132         packet-ftp.c   \
133         packet-giop.c  \
134         packet-gmrp.c \
135         packet-gnutella.c \
136         packet-gre.c   \
137         packet-gtp.c   \
138         packet-gvrp.c  \
139         packet-h1.c    \
140         packet-h261.c  \
141         packet-hclnfsd.c  \
142         packet-hsrp.c  \
143         packet-http.c  \
144         packet-iapp.c  \
145         packet-icap.c  \
146         packet-icmpv6.c\
147         packet-icp.c   \
148         packet-icq.c   \
149         packet-ieee80211.c \
150         packet-ieee8023.c \
151         packet-igmp.c  \
152         packet-igrp.c  \
153         packet-imap.c   \
154         packet-ip.c    \
155         packet-ipp.c   \
156         packet-ipsec.c \
157         packet-ipv6.c  \
158         packet-ipx.c   \
159         packet-irc.c   \
160         packet-isakmp.c\
161         packet-iscsi.c \
162         packet-isis.c  \
163         packet-isis-clv.c \
164         packet-isis-hello.c \
165         packet-isis-lsp.c \
166         packet-isis-snp.c \
167         packet-isl.c   \
168         packet-isup.c  \
169         packet-iua.c   \
170         packet-kerberos.c \
171         packet-klm.c   \
172         packet-l2tp.c  \
173         packet-lapb.c  \
174         packet-lapbether.c \
175         packet-lapd.c  \
176         packet-ldap.c  \
177         packet-ldp.c   \
178         packet-llc.c   \
179         packet-lmi.c   \
180         packet-lmp.c   \
181         packet-lpd.c   \
182         packet-m2pa.c  \
183         packet-m2tp.c  \
184         packet-m2ua.c  \
185         packet-m3ua.c  \
186         packet-mapi.c  \
187         packet-mbtcp.c \
188         packet-mip.c  \
189         packet-mmse.c  \
190         packet-mount.c \
191         packet-mpeg1.c  \
192         packet-mpls.c \
193         packet-mrdisc.c \
194         packet-msdp.c  \
195         packet-msnip.c \
196         packet-msproxy.c \
197         packet-mtp2.c \
198         packet-mtp3.c \
199         packet-nbipx.c \
200         packet-nbns.c  \
201         packet-ncp.c   \
202         packet-ncp2222.c   \
203         packet-ndmp.c  \
204         packet-netbios.c \
205         packet-nfs.c   \
206         packet-nisplus.c \
207         packet-nlm.c   \
208         packet-nntp.c  \
209         packet-ntp.c  \
210         packet-null.c  \
211         packet-osi.c   \
212         packet-osi-options.c \
213         packet-ospf.c  \
214         packet-pcnfsd.c \
215         packet-pflog.c \
216         packet-pgm.c   \
217         packet-pim.c   \
218         packet-pop.c   \
219         packet-portmap.c   \
220         packet-ppp.c   \
221         packet-pppoe.c \
222         packet-pptp.c  \
223         packet-prism.c \
224         packet-q2931.c \
225         packet-q931.c  \
226         packet-qllc.c  \
227         packet-quake.c \
228         packet-quakeworld.c \
229         packet-quake2.c \
230         packet-quake3.c \
231         packet-radius.c\
232         packet-ranap.c \
233         packet-raw.c   \
234         packet-rip.c   \
235         packet-ripng.c \
236         packet-rlogin.c \
237         packet-rpc.c   \
238         packet-rquota.c \
239         packet-rsh.c   \
240         packet-rsvp.c  \
241         packet-rtcp.c  \
242         packet-rtp.c   \
243         packet-rtsp.c  \
244         packet-rwall.c \
245         packet-rx.c  \
246         packet-sap.c   \
247         packet-sccp.c  \
248         packet-scsi.c  \
249         packet-sctp.c  \
250         packet-sdp.c   \
251         packet-sip.c   \
252         packet-skinny.c   \
253         packet-slimp3.c   \
254         packet-sll.c   \
255         packet-smb.c   \
256         packet-smb-browse.c \
257         packet-smb-common.c \
258         packet-smb-logon.c \
259         packet-smb-mailslot.c \
260         packet-smb-pipe.c \
261         packet-smpp.c \
262         packet-smtp.c \
263         packet-sna.c   \
264         packet-snaeth.c \
265         packet-snmp.c   \
266         packet-socks.c \
267         packet-spray.c \
268         packet-srvloc.c \
269         packet-sscop.c \
270         packet-ssl.c   \
271         packet-stat.c   \
272         packet-stat-notify.c \
273         packet-sua.c   \
274         packet-syslog.c \
275         packet-tacacs.c \
276         packet-tcp.c   \
277         packet-telnet.c\
278         packet-tftp.c  \
279         packet-time.c  \
280         packet-tns.c \
281         packet-tpkt.c  \
282         packet-tr.c    \
283         packet-trmac.c \
284         packet-tsp.c \
285         packet-ucp.c   \
286         packet-udp.c   \
287         packet-v120.c \
288         packet-vines.c \
289         packet-vj.c   \
290         packet-vlan.c \
291         packet-vrrp.c \
292         packet-vtp.c  \
293         packet-wccp.c \
294         packet-wcp.c \
295         packet-who.c  \
296         packet-wap.c \
297         packet-wtls.c \
298         packet-wsp.c \
299         packet-wtp.c \
300         packet-x11.c   \
301         packet-x25.c   \
302         packet-xdmcp.c \
303         packet-xot.c   \
304         packet-yhoo.c  \
305         packet-ypbind.c \
306         packet-yppasswd.c \
307         packet-ypserv.c \
308         packet-ypxfr.c \
309         packet-zebra.c
310
311 if HAVE_PLUGINS
312 plugin_src = \
313         plugins/gryphon/packet-gryphon.c \
314         plugins/mgcp/packet-mgcp.c \
315         plugins/giop/packet-cosnaming.c \
316         plugins/giop/packet-coseventcomm.c
317
318 plugin_static_ldadd = \
319         plugins/gryphon/packet-gryphon-static.o         \
320         plugins/mgcp/packet-mgcp-static.o               \
321         plugins/giop/packet-cosnaming-static.o          \
322         plugins/giop/packet-coseventcomm-static.o
323
324 plugin_libs = \
325         plugins/gryphon/gryphon.la \
326         plugins/mgcp/mgcp.la \
327         plugins/giop/cosnaming.la \
328         plugins/giop/coseventcomm.la
329
330 plugin_ldadd = \
331         "-dlopen" self  \
332         "-dlopen" plugins/gryphon/gryphon.la \
333         "-dlopen" plugins/mgcp/mgcp.la \
334         "-dlopen" plugins/giop/cosnaming.la \
335         "-dlopen" plugins/giop/coseventcomm.la
336 else
337 plugin_src =
338
339 plugin_static_ldadd =
340
341 plugin_libs =
342
343 plugin_ldadd =
344 endif
345
346 noinst_HEADERS = \
347         packet-afs.h   \
348         packet-afs-macros.h \
349         packet-afs-register-info.h \
350         packet-afs-defs.h \
351         packet-arp.h   \
352         packet-atalk.h \
353         packet-bgp.h   \
354         packet-bootparams.h \
355         packet-chdlc.h \
356         packet-clip.h  \
357         packet-dcerpc.h \
358         packet-dcerpc-dfs.h \
359         packet-dcerpc-lsa.h \
360         packet-dcerpc-netlogon.h \
361         packet-dcerpc-reg.h \
362         packet-dcerpc-samr.h \
363         packet-dcerpc-spoolss.h \
364         packet-dcerpc-srvsvc.h \
365         packet-dcerpc-wkssvc.h \
366         packet-ddtp.h  \
367         packet-diameter-defs.h \
368         packet-dns.h   \
369         packet-dvmrp.h \
370         packet-esis.h  \
371         packet-eth.h   \
372         packet-fddi.h  \
373         packet-frame.h  \
374         packet-giop.h  \
375         packet-gnutella.h \
376         packet-hclnfsd.h  \
377         packet-http.h  \
378         packet-ieee80211.h \
379         packet-ieee8023.h \
380         packet-igmp.h  \
381         packet-ip.h    \
382         packet-ipsec.h \
383         packet-ipv6.h  \
384         packet-ipx.h   \
385         packet-isis.h  \
386         packet-isis-clv.h \
387         packet-isis-hello.h \
388         packet-isis-lsp.h \
389         packet-isis-snp.h \
390         packet-isl.h   \
391         packet-klm.h   \
392         packet-ldap.h  \
393         packet-llc.h   \
394         packet-mount.h \
395         packet-mrdisc.h \
396         packet-msnip.h \
397         packet-mtp3.h  \
398         packet-ncp-int.h \
399         packet-netbios.h \
400         packet-nfs.h   \
401         packet-nisplus.h \
402         packet-nlm.h   \
403         packet-ntp.h  \
404         packet-null.h  \
405         packet-osi.h   \
406         packet-osi-options.h \
407         packet-pcnfsd.h \
408         packet-pflog.h \
409         packet-pim.h   \
410         packet-portmap.h   \
411         packet-ppp.h   \
412         packet-prism.h \
413         packet-q931.h  \
414         packet-raw.h   \
415         packet-ripng.h \
416         packet-rpc.h   \
417         packet-rquota.h \
418         packet-rsvp.h  \
419         packet-rtcp.h  \
420         packet-rtp.h   \
421         packet-rwall.h  \
422         packet-rx.h  \
423         packet-scsi.h  \
424         packet-sll.h   \
425         packet-smb-browse.h \
426         packet-smb-common.h \
427         packet-smb-logon.h \
428         packet-smb-mailslot.h \
429         packet-smb-pipe.h \
430         packet-sna.h   \
431         packet-snmp.h   \
432         packet-spray.h \
433         packet-stat.h   \
434         packet-stat-notify.h \
435         packet-tcp.h   \
436         packet-tns.h \
437         packet-tpkt.h  \
438         packet-tr.h    \
439         packet-udp.h   \
440         packet-vines.h \
441         packet-vlan.h \
442         packet-wccp.h \
443         packet-wap.h \
444         packet-wtls.h \
445         packet-wtp.h \
446         packet-wsp.h \
447         packet-x11-keysym.h     \
448         packet-yhoo.h  \
449         packet-ypbind.h \
450         packet-yppasswd.h \
451         packet-ypserv.h \
452         packet-ypxfr.h 
453
454 ETHEREAL_COMMON_SRC = \
455         aftypes.h      \
456         alignment.h    \
457         afn.c          \
458         afn.h          \
459         asn1.c         \
460         asn1.h         \
461         bridged_pids.h \
462         column.c       \
463         column.h       \
464         color.h        \
465         conditions.c   \
466         conditions.h   \
467         capture_stop_conditions.h   \
468         capture_stop_conditions.c   \
469         etypes.h       \
470         follow.c       \
471         follow.h       \
472         format-oid.h   \
473         greproto.h     \
474         in_cksum.c     \
475         in_cksum.h     \
476         ipproto.c      \
477         ipproto.h      \
478         llcsaps.h      \
479         nlpid.h        \
480         oui.h          \
481         packet-dcerpc-nt.h \
482         packet-dcerpc-nt.c \
483         pcap-util.c    \
484         pcap-util.h    \
485         ppptypes.h     \
486         prefs.c        \
487         prefs.h        \
488         prefs-int.h    \
489         print.c        \
490         print.h        \
491         ps.c           \
492         ps.h           \
493         ptvcursor.c     \
494         ptvcursor.h     \
495         reassemble.c   \
496         reassemble.h   \
497         register.h     \
498         ringbuffer.c   \
499         ringbuffer.h   \
500         rpc_defrag.h   \
501         smb.h          \
502         util.c         \
503         util.h         \
504         x11-declarations.h \
505         x11-register-info.h \
506         x264_prt_id.h  \
507         xdlc.c         \
508         xdlc.h         \
509         xmlstub.c      \
510         xmlstub.h
511
512 BUILT_SOURCES = \
513         x11-declarations.h \
514         x11-register-info.h
515
516 ethereal_SOURCES = \
517         $(DISSECTOR_SRC) \
518         $(ETHEREAL_COMMON_SRC) \
519         register.c     \
520         capture.c      \
521         capture.h      \
522         file.c         \
523         file.h         \
524         filters.c      \
525         filters.h      \
526         globals.h      \
527         menu.h         \
528         progress_dlg.h \
529         proto_hier_stats.h      \
530         proto_hier_stats.c      \
531         simple_dialog.h \
532         statusbar.h    \
533         summary.c      \
534         summary.h      \
535         ui_util.h
536
537 ethereal_static_SOURCES = \
538         $(DISSECTOR_SRC) \
539         $(ETHEREAL_COMMON_SRC) \
540         register-static.c     \
541         capture.c      \
542         capture.h      \
543         file.c         \
544         file.h         \
545         filters.c      \
546         filters.h      \
547         globals.h      \
548         menu.h         \
549         progress_dlg.h \
550         proto_hier_stats.h      \
551         proto_hier_stats.c      \
552         simple_dialog.h \
553         statusbar.h    \
554         summary.c      \
555         summary.h      \
556         ui_util.h       
557
558 EXTRA_ethereal_SOURCES = \
559         snprintf.c      \
560         snprintf.h      \
561         snprintf-imp.h  \
562         strerror.c      \
563         strerror.h      \
564         strcasecmp.c    \
565         strncasecmp.c   \
566         mkstemp.c       \
567         mkstemp.h       \
568         strptime.c      \
569         strptime.h
570
571 # Optional objects that I know how to build. These will be
572 # linked into the ethereal executable.
573 # They will also be linked into the tethereal executable; if this
574 # list ever grows to include something that can't be linked with
575 # tethereal, or if tethereal needs something that ethereal doesn't,
576 # we should probably split this into stuff needed both
577 # by ethereal and tethereal and stuff needed only by one or the
578 # other.
579 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ \
580         @STRCASECMP_O@ @STRNCASECMP_O@ @MKSTEMP_O@ @STRPTIME_O@
581
582 # Additional libs that I know how to build. These will be
583 # linked into the ethereal executable.
584 ethereal_additional_libs = \
585         wiretap/libwiretap.a    \
586         gtk/libui.a             \
587         epan/libethereal.a      \
588         epan/ftypes/libftypes.a \
589         epan/dfilter/libdfilter.a
590
591 # This is the automake dependency variable for the executable
592 ethereal_DEPENDENCIES = \
593         $(ethereal_optional_objects)    \
594         $(ethereal_additional_libs)     \
595         $(plugin_libs)
596
597 ethereal_static_DEPENDENCIES = \
598         $(ethereal_optional_objects)    \
599         $(ethereal_additional_libs)
600
601 # This automake variable adds to the link-line for the executable.
602 #
603 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
604 # they are included in @GTK_LIBS@, and doesn't have to be linked with
605 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
606 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
607 # applications are X applications).
608 ethereal_LDADD = \
609         $(ethereal_optional_objects)    \
610         $(ethereal_additional_libs)     \
611         @SNMP_LIBS@ @SSL_LIBS@          \
612         $(plugin_ldadd)                 \
613         @PCAP_LIBS@ @GTK_LIBS@
614
615 ethereal_static_LDADD = \
616         "-all-static"                   \
617         $(plugin_static_ldadd)          \
618         $(ethereal_optional_objects)    \
619         $(ethereal_additional_libs)     \
620         @SNMP_LIBS@ @SSL_LIBS@          \
621         @PCAP_LIBS@ @GTK_LIBS@          
622
623 ethereal_LDFLAGS = -export-dynamic
624 ethereal_static_LDFLAGS = -Wl,-static
625
626 tethereal_SOURCES = \
627         $(DISSECTOR_SRC) \
628         $(ETHEREAL_COMMON_SRC) \
629         register.c     \
630         tethereal.c
631
632 tethereal_static_SOURCES = \
633         $(DISSECTOR_SRC) \
634         $(ETHEREAL_COMMON_SRC) \
635         register-static.c     \
636         tethereal.c
637
638 # Additional libs that I know how to build. These will be
639 # linked into the tethereal executable.
640 tethereal_additional_libs =             \
641         wiretap/libwiretap.a            \
642         epan/libethereal.a              \
643         epan/ftypes/libftypes.a         \
644         epan/dfilter/libdfilter.a
645
646 # This is the automake dependency variable for the executable
647 tethereal_DEPENDENCIES = \
648         $(ethereal_optional_objects)    \
649         $(tethereal_additional_libs)    \
650         $(plugin_libs)
651
652 tethereal_static_DEPENDENCIES = \
653         $(ethereal_optional_objects)    \
654         $(tethereal_additional_libs)    
655
656 # This automake variable adds to the link-line for the executable
657 tethereal_LDADD = wiretap/libwiretap.a  \
658         $(ethereal_optional_objects)    \
659         $(tethereal_additional_libs)    \
660         @SNMP_LIBS@ @SSL_LIBS@          \
661         $(plugin_ldadd)                 \
662         @GLIB_LIBS@ -lm \
663         @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
664
665 tethereal_static_LDADD = \
666         "-all-static"           \
667         $(plugin_static_ldadd)  \
668         wiretap/libwiretap.a    \
669         $(ethereal_optional_objects)    \
670         $(tethereal_additional_libs)    \
671         @SNMP_LIBS@ @SSL_LIBS@          \
672         @GLIB_LIBS@ -lm \
673         @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
674
675 tethereal_LDFLAGS = -export-dynamic
676 tethereal_static_LDFLAGS = -Wl,-static
677
678 # Optional objects that I know how to build, and that are needed by
679 # text2pcap.
680 text2pcap_optional_objects = @STRERROR_O@ @STRPTIME_O@
681
682 text2pcap_SOURCES = text2pcap.c text2pcap-scanner.l
683 text2pcap_DEPENDENCIES = text2pcap.h
684
685 # This automake variable adds to the link-line for the executable
686 text2pcap_LDADD = $(text2pcap_optional_objects)
687
688 mergecap_SOURCES = mergecap.c
689 mergecap_DEPENDENCIES = wiretap/libwiretap.a
690
691 editcap_SOURCES = editcap.c
692
693 # This is the automake dependency variable for the executable
694 editcap_DEPENDENCIES = wiretap/libwiretap.a
695
696 # This automake variable adds to the link-line for the executable
697 editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
698 mergecap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
699
700 #
701 # Build various header files for the X11 dissector.
702 #
703 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
704         $(PERL) $(srcdir)/process-x11-fields.pl <$(srcdir)/x11-fields
705
706 #
707 # Build shell scripts by doing variable substitution.
708 # Taken from autoconf 2.13.
709 #
710 editsh = sed -e 's,@''SHELL''@,$(SHELL),g'
711
712 SUFFIXES = .sh
713 .sh:
714         rm -f $@ $@.tmp
715         $(editsh) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
716
717 #
718 # Build "register.c", which contains a function "register_all_protocols()"
719 # that calls the register routines for all protocols.
720 #
721 # We do this by grepping through sources.  If that turns out to be too slow,
722 # maybe we could just require every .o file to have an register routine
723 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
724 #
725 # Formatting conventions:  The name of the proto_register_* routines must
726 # start in column zero, or must be preceded only by "void " starting in
727 # column zero, and must not be inside #if.
728 #
729 # We assume that all dissector routines are in "packet-XXX.c" files.
730 #
731 # For some unknown reason, having a big "for" loop in the Makefile
732 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
733 # they seem to pass only the first few names in the list to the shell,
734 # for some reason.
735 #
736 # Therefore, we have a script to generate the "register.c" file.
737 #
738 # The first argument is the directory in which the source files live.
739 # All subsequent arguments are the files to scan.
740 #
741 register.c: $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
742         @echo Making register.c
743         @$(srcdir)/make-reg-dotc register.c $(srcdir) $(DISSECTOR_SRC)
744
745 register-static.c: $(plugin_src) $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
746         @echo Making register-static.c
747         @$(srcdir)/make-reg-dotc register-static.c $(srcdir) $(plugin_src) $(DISSECTOR_SRC)
748
749 ps.c: print.ps rdps
750         ./rdps $(srcdir)/print.ps ps.c
751
752 rdps: rdps.c
753         $(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
754
755 randpkt.o: randpkt.c
756         $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
757
758 randpkt: randpkt.o wiretap/libwiretap.a
759         $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
760
761
762 dftest_SOURCES = \
763         $(DISSECTOR_SRC) \
764         $(ETHEREAL_COMMON_SRC) \
765         register.c     \
766         dftest.c
767
768 dftest_additional_libs =                \
769         wiretap/libwiretap.a            \
770         epan/libethereal.a              \
771         epan/ftypes/libftypes.a         \
772         epan/dfilter/libdfilter.a
773
774 dftest_DEPENDENCIES = \
775         $(ethereal_optional_objects)    \
776         $(dftest_additional_libs)       \
777         $(plugin_libs)
778
779 # This automake variable adds to the link-line for the executable
780 dftest_LDADD = \
781         $(ethereal_optional_objects)    \
782         $(dftest_additional_libs)       \
783         @SNMP_LIBS@ @SSL_LIBS@          \
784         $(plugin_ldadd)                 \
785         @GLIB_LIBS@ -lm \
786         @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
787
788 dftest_LDFLAGS = -export-dynamic
789
790 CLEANFILES =    \
791         idl2eth
792
793 DISTCLEANFILES =        \
794         register.c      \
795         register-static.c \
796         rdps            \
797         ps.c            \
798         *~
799
800 EXTRA_DIST = \
801         Ethereal.desktop        \
802         aclocal-flags           \
803         capture-wpcap.c         \
804         capture-wpcap.h         \
805         cleanbld.bat            \
806         config.h.win32          \
807         config.nmake            \
808         debian/README.debian    \
809         debian/changelog        \
810         debian/control          \
811         debian/copyright        \
812         debian/dirs             \
813         debian/docs             \
814         debian/menu             \
815         debian/postinst         \
816         debian/prerm            \
817         debian/rules            \
818         doc/Makefile.am         \
819         doc/Makefile.nmake      \
820         doc/README.design       \
821         doc/README.developer    \
822         doc/README.idl2eth      \
823         doc/README.plugins      \
824         doc/README.regression   \
825         doc/README.tvbuff       \
826         doc/dfilter2pod.pl      \
827         doc/editcap.pod         \
828         doc/ethereal.pod.template \
829         doc/idl2eth.pod         \
830         doc/mergecap.pod        \
831         doc/randpkt.txt         \
832         doc/tethereal.pod.template \
833         doc/text2pcap.pod       \
834         editcap.c               \
835         ethereal_be.py          \
836         ethereal_gen.py         \
837         mergecap.c              \
838         text2pcap.c             \
839         text2pcap.h             \
840         text2pcap-scanner.l     \
841         getopt.c                \
842         getopt.h                \
843         idl2eth.sh              \
844         ieee-float.h            \
845         image/Makefile.nmake    \
846         image/README.image      \
847         image/clist_ascend.xpm  \
848         image/clist_descend.xpm \
849         image/dn_arrow.xpm      \
850         image/editcap.rc.in     \
851         image/eexcl3d64.xpm     \
852         image/eicon3d16.xpm     \
853         image/eicon3d32.xpm     \
854         image/eicon3d48.xpm     \
855         image/eicon3d64.xpm     \
856         image/elogo3d48x48.png  \
857         image/ethereal.ico      \
858         image/ethereal.rc.in    \
859         image/ethereal48x48-trans.png  \
860         image/ethereal48x48.png \
861         image/hi16-app-ethereal.png     \
862         image/hi32-app-ethereal.png     \
863         image/hi48-app-ethereal.png     \
864         image/icon-ethereal.xpm \
865         image/icon-excl.xpm     \
866         image/lo16-app-ethereal.png     \
867         image/lo32-app-ethereal.png     \
868         image/lo48-app-ethereal.png     \
869         image/mergecap.rc.in    \
870         image/tethereal.rc.in   \
871         image/text2pcap.rc.in   \
872         image/up_arrow.xpm      \
873         INSTALL.configure       \
874         Makefile.nmake          \
875         make-manuf              \
876         make-reg-dotc           \
877         make-reg-dotc.py        \
878         manuf                   \
879         manuf.tmpl              \
880         ncp2222.py              \
881         packet-ncp2222.inc      \
882         print.ps                \
883         process-x11-fields.pl   \
884         README.aix              \
885         README.bsd              \
886         README.hpux             \
887         README.irix             \
888         README.linux            \
889         README.tru64            \
890         README.vmware           \
891         README.win32            \
892         randpkt.c               \
893         rdps.c                  \
894         TODO                    \
895         dictionary.dtd          \
896         dictionary.xml          \
897         mobileipv4.xml          \
898         nasreq.xml              \
899         sunping.xml             \
900         x11-fields
901
902 if SETUID_INSTALL
903 install-exec-hook:
904         -chmod +s $(DESTDIR)$(bindir)/ethereal
905         -chmod +s $(DESTDIR)$(bindir)/tethereal
906         -chmod +s $(DESTDIR)$(bindir)/ethereal_static
907 else
908 install-exec-hook:
909 endif
910
911 #
912 # Currently register.c can be included in the distribution because
913 # we always build all protocol dissectors. We used to have to check
914 # whether or not to build the snmp dissector. If we again need to
915 # variably build something, making register.c non-portable, uncomment
916 # the dist-hook line below.
917 #
918 # Oh, yuk.  We don't want to include "register.c" in the distribution, as
919 # its contents depend on the configuration, and therefore we want it
920 # to be built when the first "make" is done; however, Automake insists
921 # on putting *all* source into the distribution.
922 #
923 # We work around this by having a "dist-hook" rule that deletes
924 # "register.c", so that "dist" won't pick it up.
925 #
926 #dist-hook:
927 #       @rm -f $(distdir)/register.c
928
929 if HAVE_PLUGINS
930 SUBDIRS = tools wiretap doc epan plugins packaging @ethereal_SUBDIRS@
931 else
932 SUBDIRS = tools wiretap doc epan packaging @ethereal_SUBDIRS@
933 endif
934
935 ethereal.1: ethereal doc/ethereal.pod.template
936         (cd doc ; \
937         $(MAKE) ../ethereal.1 )
938
939 tethereal.1: tethereal doc/tethereal.pod.template
940         (cd doc ; \
941         $(MAKE) ../tethereal.1 )
942
943 editcap.1: doc/editcap.pod
944         (cd doc ; \
945         $(MAKE) ../editcap.1 )
946
947 idl2eth.1: doc/idl2eth.pod
948         (cd doc ; \
949         $(MAKE) ../idl2eth.1 )
950
951 mergecap.1: doc/mergecap.pod
952         (cd doc ; \
953         $(MAKE) ../mergecap.1 )
954
955 text2pcap.1: doc/text2pcap.pod
956         (cd doc ; \
957         $(MAKE) ../text2pcap.1 )
958
959 packet-ncp2222.c : ncp2222.py
960         $(PYTHON) $(srcdir)/ncp2222.py > $@
961
962 libtool: $(LIBTOOL_DEPS)
963         $(SHELL) ./config.status --recheck
964
965 # We load top_stagedir with an explicit path so that libtool doesn't freak.
966 top_stagedir=`cd $(top_srcdir) && pwd`/packaging/svr4.stage
967 stagedir=$(top_stagedir)/$(PACKAGE).stage
968 host_cpu=@host_cpu@
969 host_os=@host_os@
970
971 svr4-package: $(bin_SCRIPTS) $(lib_LTLIBRARIES)
972         if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
973                 rm -rf $(stagedir) ; \
974                 $(MAKE) DESTDIR=$(stagedir) install-strip; \
975                 $(srcdir)/packaging/svr4/mkpkg \
976                         $(PACKAGE) \
977                         $(PACKAGE)-$(VERSION)-$(host_os)-$(host_cpu)-local \
978                         $(prefix) \
979                         $(top_stagedir) ; \
980         else \
981                 echo "Error: SVR4 packaging tools not found." ; \
982                 echo "Package build abandoned." ; \
983         fi
984
985 solaris-package: svr4-package
986
987 rpm_topdir=`cd $(top_srcdir) && pwd`/packaging/rpm
988 rpm-package: dist
989         if test x$(HAVE_RPM) = xyes ; then \
990                 cd $(rpm_topdir) ; \
991                 mkdir BUILD RPMS SOURCES ; \
992                 cd SOURCES ; \
993                 ln -s ../../../$(distdir).tar.gz ; \
994                 cd .. ; \
995                 rpm --define "_topdir `cd . && pwd`" -bb SPECS/ethereal.spec && \
996                         echo "Package successfully built in `pwd`/RPMS." ; \
997         else \
998                 echo "Error: RPM executable and/or source directory not found." ; \
999         fi
1000 srpm-package: dist
1001         if test x$(HAVE_RPM) = xyes ; then \
1002                 cd $(rpm_topdir) ; \
1003                 mkdir BUILD SRPMS SOURCES ; \
1004                 cd SOURCES ; \
1005                 ln -s ../../../$(distdir).tar.gz ; \
1006                 cd .. ; \
1007                 rpm --define "_topdir `cd . && pwd`" -bs SPECS/ethereal.spec && \
1008                         echo "Package successfully built in `pwd`/SRPMS." ; \
1009         else \
1010                 echo "Error: RPM executable and/or source directory not found." ; \
1011         fi
1012
1013 debian-package: debian/rules
1014         dpkg-buildpackage -rfakeroot -us -uc
1015
1016 clean-local:
1017         rm -rf $(top_stagedir)