There's just a single H.225 dissector, for both Call Signaling and
[obnox/wireshark/wip.git] / Makefile.am
1 # Makefile.am
2 # Automake file for Ethereal
3 #
4 # $Id: Makefile.am,v 1.414 2002/03/04 22:39:21 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-airopeek.c \
79         packet-arp.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-lpd.c   \
181         packet-m2pa.c  \
182         packet-m2tp.c  \
183         packet-m3ua.c  \
184         packet-mapi.c  \
185         packet-mbtcp.c \
186         packet-mip.c  \
187         packet-mmse.c  \
188         packet-mount.c \
189         packet-mpeg1.c  \
190         packet-mpls.c \
191         packet-mrdisc.c \
192         packet-msdp.c  \
193         packet-msnip.c \
194         packet-msproxy.c \
195         packet-mtp2.c \
196         packet-mtp3.c \
197         packet-nbipx.c \
198         packet-nbns.c  \
199         packet-ncp.c   \
200         packet-ncp2222.c   \
201         packet-ndmp.c  \
202         packet-netbios.c \
203         packet-nfs.c   \
204         packet-nisplus.c \
205         packet-nlm.c   \
206         packet-nntp.c  \
207         packet-ntp.c  \
208         packet-null.c  \
209         packet-osi.c   \
210         packet-osi-options.c \
211         packet-ospf.c  \
212         packet-pcnfsd.c \
213         packet-pflog.c \
214         packet-pgm.c   \
215         packet-pim.c   \
216         packet-pop.c   \
217         packet-portmap.c   \
218         packet-ppp.c   \
219         packet-pppoe.c \
220         packet-pptp.c  \
221         packet-prism.c \
222         packet-q2931.c \
223         packet-q931.c  \
224         packet-qllc.c  \
225         packet-quake.c \
226         packet-quakeworld.c \
227         packet-quake2.c \
228         packet-quake3.c \
229         packet-radius.c\
230         packet-ranap.c \
231         packet-raw.c   \
232         packet-rip.c   \
233         packet-ripng.c \
234         packet-rlogin.c \
235         packet-rpc.c   \
236         packet-rquota.c \
237         packet-rsh.c   \
238         packet-rsvp.c  \
239         packet-rtcp.c  \
240         packet-rtp.c   \
241         packet-rtsp.c  \
242         packet-rwall.c \
243         packet-rx.c  \
244         packet-sap.c   \
245         packet-sccp.c  \
246         packet-scsi.c  \
247         packet-sctp.c  \
248         packet-sdp.c   \
249         packet-sip.c   \
250         packet-skinny.c   \
251         packet-slimp3.c   \
252         packet-sll.c   \
253         packet-smb.c   \
254         packet-smb-browse.c \
255         packet-smb-common.c \
256         packet-smb-logon.c \
257         packet-smb-mailslot.c \
258         packet-smb-pipe.c \
259         packet-smpp.c \
260         packet-smtp.c \
261         packet-sna.c   \
262         packet-snaeth.c \
263         packet-snmp.c   \
264         packet-socks.c \
265         packet-spray.c \
266         packet-srvloc.c \
267         packet-sscop.c \
268         packet-ssl.c   \
269         packet-stat.c   \
270         packet-stat-notify.c \
271         packet-sua.c   \
272         packet-syslog.c \
273         packet-tacacs.c \
274         packet-tcp.c   \
275         packet-telnet.c\
276         packet-tftp.c  \
277         packet-time.c  \
278         packet-tns.c \
279         packet-tpkt.c  \
280         packet-tr.c    \
281         packet-trmac.c \
282         packet-tsp.c \
283         packet-ucp.c   \
284         packet-udp.c   \
285         packet-v120.c \
286         packet-vines.c \
287         packet-vj.c   \
288         packet-vlan.c \
289         packet-vrrp.c \
290         packet-vtp.c  \
291         packet-wccp.c \
292         packet-wcp.c \
293         packet-who.c  \
294         packet-wap.c \
295         packet-wtls.c \
296         packet-wsp.c \
297         packet-wtp.c \
298         packet-x11.c   \
299         packet-x25.c   \
300         packet-xot.c   \
301         packet-yhoo.c  \
302         packet-ypbind.c \
303         packet-yppasswd.c \
304         packet-ypserv.c \
305         packet-ypxfr.c \
306         packet-zebra.c
307
308 if HAVE_PLUGINS
309 plugin_src = \
310         plugins/gryphon/packet-gryphon.c \
311         plugins/mgcp/packet-mgcp.c \
312         plugins/giop/packet-cosnaming.c \
313         plugins/giop/packet-coseventcomm.c
314
315 plugin_static_ldadd = \
316         plugins/gryphon/packet-gryphon-static.o         \
317         plugins/mgcp/packet-mgcp-static.o               \
318         plugins/giop/packet-cosnaming-static.o          \
319         plugins/giop/packet-coseventcomm-static.o
320
321 plugin_libs = \
322         plugins/gryphon/gryphon.la \
323         plugins/mgcp/mgcp.la \
324         plugins/giop/cosnaming.la \
325         plugins/giop/coseventcomm.la
326
327 plugin_ldadd = \
328         "-dlopen" self  \
329         "-dlopen" plugins/gryphon/gryphon.la \
330         "-dlopen" plugins/mgcp/mgcp.la \
331         "-dlopen" plugins/giop/cosnaming.la \
332         "-dlopen" plugins/giop/coseventcomm.la
333 else
334 plugin_src =
335
336 plugin_static_ldadd =
337
338 plugin_libs =
339
340 plugin_ldadd =
341 endif
342
343 noinst_HEADERS = \
344         packet-afs.h   \
345         packet-afs-macros.h \
346         packet-afs-register-info.h \
347         packet-afs-defs.h \
348         packet-arp.h   \
349         packet-atalk.h \
350         packet-bgp.h   \
351         packet-bootparams.h \
352         packet-chdlc.h \
353         packet-clip.h  \
354         packet-dcerpc.h \
355         packet-dcerpc-dfs.h \
356         packet-dcerpc-lsa.h \
357         packet-dcerpc-netlogon.h \
358         packet-dcerpc-reg.h \
359         packet-dcerpc-samr.h \
360         packet-dcerpc-spoolss.h \
361         packet-dcerpc-srvsvc.h \
362         packet-dcerpc-wkssvc.h \
363         packet-ddtp.h  \
364         packet-diameter-defs.h \
365         packet-dns.h   \
366         packet-dvmrp.h \
367         packet-esis.h  \
368         packet-eth.h   \
369         packet-fddi.h  \
370         packet-frame.h  \
371         packet-giop.h  \
372         packet-gnutella.h \
373         packet-hclnfsd.h  \
374         packet-http.h  \
375         packet-ieee80211.h \
376         packet-ieee8023.h \
377         packet-igmp.h  \
378         packet-ip.h    \
379         packet-ipsec.h \
380         packet-ipv6.h  \
381         packet-ipx.h   \
382         packet-isis.h  \
383         packet-isis-clv.h \
384         packet-isis-hello.h \
385         packet-isis-lsp.h \
386         packet-isis-snp.h \
387         packet-isl.h   \
388         packet-klm.h   \
389         packet-ldap.h  \
390         packet-llc.h   \
391         packet-mount.h \
392         packet-mrdisc.h \
393         packet-msnip.h \
394         packet-mtp3.h  \
395         packet-ncp-int.h \
396         packet-netbios.h \
397         packet-nfs.h   \
398         packet-nisplus.h \
399         packet-nlm.h   \
400         packet-ntp.h  \
401         packet-null.h  \
402         packet-osi.h   \
403         packet-osi-options.h \
404         packet-pcnfsd.h \
405         packet-pflog.h \
406         packet-pgm.h   \
407         packet-pim.h   \
408         packet-portmap.h   \
409         packet-ppp.h   \
410         packet-prism.h \
411         packet-q931.h  \
412         packet-raw.h   \
413         packet-ripng.h \
414         packet-rpc.h   \
415         packet-rquota.h \
416         packet-rtcp.h  \
417         packet-rtp.h   \
418         packet-rwall.h  \
419         packet-rx.h  \
420         packet-scsi.h  \
421         packet-sll.h   \
422         packet-smb-browse.h \
423         packet-smb-common.h \
424         packet-smb-logon.h \
425         packet-smb-mailslot.h \
426         packet-smb-pipe.h \
427         packet-sna.h   \
428         packet-snmp.h   \
429         packet-spray.h \
430         packet-stat.h   \
431         packet-stat-notify.h \
432         packet-tcp.h   \
433         packet-tns.h \
434         packet-tpkt.h  \
435         packet-tr.h    \
436         packet-udp.h   \
437         packet-vines.h \
438         packet-vlan.h \
439         packet-wccp.h \
440         packet-wap.h \
441         packet-wtls.h \
442         packet-wtp.h \
443         packet-wsp.h \
444         packet-x11-keysym.h     \
445         packet-yhoo.h  \
446         packet-ypbind.h \
447         packet-yppasswd.h \
448         packet-ypserv.h \
449         packet-ypxfr.h 
450
451 ETHEREAL_COMMON_SRC = \
452         aftypes.h      \
453         alignment.h    \
454         afn.c          \
455         afn.h          \
456         asn1.c         \
457         asn1.h         \
458         bridged_pids.h \
459         column.c       \
460         column.h       \
461         color.h        \
462         conditions.c   \
463         conditions.h   \
464         capture_stop_conditions.h   \
465         capture_stop_conditions.c   \
466         etypes.h       \
467         follow.c       \
468         follow.h       \
469         greproto.h     \
470         in_cksum.c     \
471         in_cksum.h     \
472         ipproto.c      \
473         ipproto.h      \
474         llcsaps.h      \
475         nlpid.h        \
476         oui.h          \
477         packet-dcerpc-nt.h \
478         packet-dcerpc-nt.c \
479         pcap-util.c    \
480         pcap-util.h    \
481         ppptypes.h     \
482         prefs.c        \
483         prefs.h        \
484         prefs-int.h    \
485         print.c        \
486         print.h        \
487         ps.c           \
488         ps.h           \
489         ptvcursor.c     \
490         ptvcursor.h     \
491         reassemble.c   \
492         reassemble.h   \
493         register.h     \
494         ringbuffer.c   \
495         ringbuffer.h   \
496         rpc_defrag.h   \
497         smb.h          \
498         util.c         \
499         util.h         \
500         x11-declarations.h \
501         x11-register-info.h \
502         x264_prt_id.h  \
503         xdlc.c         \
504         xdlc.h         \
505         xmlstub.c      \
506         xmlstub.h
507
508 BUILT_SOURCES = \
509         x11-declarations.h \
510         x11-register-info.h
511
512 ethereal_SOURCES = \
513         $(DISSECTOR_SRC) \
514         $(ETHEREAL_COMMON_SRC) \
515         register.c     \
516         capture.c      \
517         capture.h      \
518         file.c         \
519         file.h         \
520         filters.c      \
521         filters.h      \
522         globals.h      \
523         menu.h         \
524         progress_dlg.h \
525         proto_hier_stats.h      \
526         proto_hier_stats.c      \
527         simple_dialog.h \
528         statusbar.h    \
529         summary.c      \
530         summary.h      \
531         ui_util.h
532
533 ethereal_static_SOURCES = \
534         $(DISSECTOR_SRC) \
535         $(ETHEREAL_COMMON_SRC) \
536         register-static.c     \
537         capture.c      \
538         capture.h      \
539         file.c         \
540         file.h         \
541         filters.c      \
542         filters.h      \
543         globals.h      \
544         menu.h         \
545         progress_dlg.h \
546         proto_hier_stats.h      \
547         proto_hier_stats.c      \
548         simple_dialog.h \
549         statusbar.h    \
550         summary.c      \
551         summary.h      \
552         ui_util.h       
553
554 EXTRA_ethereal_SOURCES = \
555         snprintf.c      \
556         snprintf.h      \
557         snprintf-imp.h  \
558         strerror.c      \
559         strerror.h      \
560         strcasecmp.c    \
561         strncasecmp.c   \
562         mkstemp.c       \
563         mkstemp.h       \
564         strptime.c      \
565         strptime.h
566
567 # Optional objects that I know how to build. These will be
568 # linked into the ethereal executable.
569 # They will also be linked into the tethereal executable; if this
570 # list ever grows to include something that can't be linked with
571 # tethereal, or if tethereal needs something that ethereal doesn't,
572 # we should probably split this into stuff needed both
573 # by ethereal and tethereal and stuff needed only by one or the
574 # other.
575 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ \
576         @STRCASECMP_O@ @STRNCASECMP_O@ @MKSTEMP_O@ @STRPTIME_O@
577
578 # Additional libs that I know how to build. These will be
579 # linked into the ethereal executable.
580 ethereal_additional_libs = \
581         wiretap/libwiretap.a    \
582         gtk/libui.a             \
583         epan/libethereal.a      \
584         epan/ftypes/libftypes.a \
585         epan/dfilter/libdfilter.a
586
587 # This is the automake dependency variable for the executable
588 ethereal_DEPENDENCIES = \
589         $(ethereal_optional_objects)    \
590         $(ethereal_additional_libs)     \
591         $(plugin_libs)
592
593 ethereal_static_DEPENDENCIES = \
594         $(ethereal_optional_objects)    \
595         $(ethereal_additional_libs)
596
597 # This automake variable adds to the link-line for the executable.
598 #
599 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
600 # they are included in @GTK_LIBS@, and doesn't have to be linked with
601 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
602 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
603 # applications are X applications).
604 ethereal_LDADD = \
605         $(ethereal_optional_objects)    \
606         $(ethereal_additional_libs)     \
607         @SNMP_LIBS@ @SSL_LIBS@          \
608         $(plugin_ldadd)                 \
609         @PCAP_LIBS@ @GTK_LIBS@
610
611 ethereal_static_LDADD = \
612         "-all-static"                   \
613         $(plugin_static_ldadd)          \
614         $(ethereal_optional_objects)    \
615         $(ethereal_additional_libs)     \
616         @SNMP_LIBS@ @SSL_LIBS@          \
617         @PCAP_LIBS@ @GTK_LIBS@          
618
619 ethereal_LDFLAGS = -export-dynamic
620 ethereal_static_LDFLAGS = -Wl,-static
621
622 tethereal_SOURCES = \
623         $(DISSECTOR_SRC) \
624         $(ETHEREAL_COMMON_SRC) \
625         register.c     \
626         tethereal.c
627
628 tethereal_static_SOURCES = \
629         $(DISSECTOR_SRC) \
630         $(ETHEREAL_COMMON_SRC) \
631         register-static.c     \
632         tethereal.c
633
634 # Additional libs that I know how to build. These will be
635 # linked into the tethereal executable.
636 tethereal_additional_libs =             \
637         wiretap/libwiretap.a            \
638         epan/libethereal.a              \
639         epan/ftypes/libftypes.a         \
640         epan/dfilter/libdfilter.a
641
642 # This is the automake dependency variable for the executable
643 tethereal_DEPENDENCIES = \
644         $(ethereal_optional_objects)    \
645         $(tethereal_additional_libs)    \
646         $(plugin_libs)
647
648 tethereal_static_DEPENDENCIES = \
649         $(ethereal_optional_objects)    \
650         $(tethereal_additional_libs)    
651
652 # This automake variable adds to the link-line for the executable
653 tethereal_LDADD = wiretap/libwiretap.a  \
654         $(ethereal_optional_objects)    \
655         $(tethereal_additional_libs)    \
656         @SNMP_LIBS@ @SSL_LIBS@          \
657         $(plugin_ldadd)                 \
658         @GLIB_LIBS@ -lm \
659         @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
660
661 tethereal_static_LDADD = \
662         "-all-static"           \
663         $(plugin_static_ldadd)  \
664         wiretap/libwiretap.a    \
665         $(ethereal_optional_objects)    \
666         $(tethereal_additional_libs)    \
667         @SNMP_LIBS@ @SSL_LIBS@          \
668         @GLIB_LIBS@ -lm \
669         @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
670
671 tethereal_LDFLAGS = -export-dynamic
672 tethereal_static_LDFLAGS = -Wl,-static
673
674 # Optional objects that I know how to build, and that are needed by
675 # text2pcap.
676 text2pcap_optional_objects = @STRERROR_O@ @STRPTIME_O@
677
678 text2pcap_SOURCES = text2pcap.c text2pcap-scanner.l
679 text2pcap_DEPENDENCIES = text2pcap.h
680
681 # This automake variable adds to the link-line for the executable
682 text2pcap_LDADD = $(text2pcap_optional_objects)
683
684 mergecap_SOURCES = mergecap.c
685 mergecap_DEPENDENCIES = wiretap/libwiretap.a
686
687 editcap_SOURCES = editcap.c
688
689 # This is the automake dependency variable for the executable
690 editcap_DEPENDENCIES = wiretap/libwiretap.a
691
692 # This automake variable adds to the link-line for the executable
693 editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
694 mergecap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
695
696 #
697 # Build various header files for the X11 dissector.
698 #
699 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
700         $(PERL) $(srcdir)/process-x11-fields.pl <$(srcdir)/x11-fields
701
702 #
703 # Build shell scripts by doing variable substitution.
704 # Taken from autoconf 2.13.
705 #
706 editsh = sed -e 's,@''SHELL''@,$(SHELL),g'
707
708 SUFFIXES = .sh
709 .sh:
710         rm -f $@ $@.tmp
711         $(editsh) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
712
713 #
714 # Build "register.c", which contains a function "register_all_protocols()"
715 # that calls the register routines for all protocols.
716 #
717 # We do this by grepping through sources.  If that turns out to be too slow,
718 # maybe we could just require every .o file to have an register routine
719 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
720 #
721 # Formatting conventions:  The name of the proto_register_* routines must
722 # start in column zero, or must be preceded only by "void " starting in
723 # column zero, and must not be inside #if.
724 #
725 # We assume that all dissector routines are in "packet-XXX.c" files.
726 #
727 # For some unknown reason, having a big "for" loop in the Makefile
728 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
729 # they seem to pass only the first few names in the list to the shell,
730 # for some reason.
731 #
732 # Therefore, we have a script to generate the "register.c" file.
733 #
734 # The first argument is the directory in which the source files live.
735 # All subsequent arguments are the files to scan.
736 #
737 register.c: $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
738         @echo Making register.c
739         @$(srcdir)/make-reg-dotc register.c $(srcdir) $(DISSECTOR_SRC)
740
741 register-static.c: $(plugin_src) $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
742         @echo Making register-static.c
743         @$(srcdir)/make-reg-dotc register-static.c $(srcdir) $(plugin_src) $(DISSECTOR_SRC)
744
745 ps.c: print.ps rdps
746         ./rdps $(srcdir)/print.ps ps.c
747
748 rdps: rdps.c
749         $(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
750
751 randpkt.o: randpkt.c
752         $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
753
754 randpkt: randpkt.o wiretap/libwiretap.a
755         $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
756
757
758 dftest_SOURCES = \
759         $(DISSECTOR_SRC) \
760         $(ETHEREAL_COMMON_SRC) \
761         register.c     \
762         dftest.c
763
764 dftest_additional_libs =                \
765         wiretap/libwiretap.a            \
766         epan/libethereal.a              \
767         epan/ftypes/libftypes.a         \
768         epan/dfilter/libdfilter.a
769
770 dftest_DEPENDENCIES = \
771         $(ethereal_optional_objects)    \
772         $(dftest_additional_libs)       \
773         $(plugin_libs)
774
775 # This automake variable adds to the link-line for the executable
776 dftest_LDADD = \
777         $(ethereal_optional_objects)    \
778         $(dftest_additional_libs)       \
779         @SNMP_LIBS@ @SSL_LIBS@          \
780         $(plugin_ldadd)                 \
781         @GLIB_LIBS@ -lm \
782         @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
783
784 dftest_LDFLAGS = -export-dynamic
785
786 CLEANFILES =    \
787         idl2eth
788
789 DISTCLEANFILES =        \
790         register.c      \
791         register-static.c \
792         rdps            \
793         ps.c            \
794         *~
795
796 EXTRA_DIST = \
797         Ethereal.desktop        \
798         aclocal-flags           \
799         capture-wpcap.c         \
800         capture-wpcap.h         \
801         cleanbld.bat            \
802         config.h.win32          \
803         config.nmake            \
804         debian/README.debian    \
805         debian/changelog        \
806         debian/control          \
807         debian/copyright        \
808         debian/dirs             \
809         debian/docs             \
810         debian/menu             \
811         debian/postinst         \
812         debian/prerm            \
813         debian/rules            \
814         doc/Makefile.am         \
815         doc/Makefile.nmake      \
816         doc/README.design       \
817         doc/README.developer    \
818         doc/README.idl2eth      \
819         doc/README.plugins      \
820         doc/README.regression   \
821         doc/README.tvbuff       \
822         doc/dfilter2pod.pl      \
823         doc/editcap.pod         \
824         doc/ethereal.pod.template \
825         doc/idl2eth.pod         \
826         doc/mergecap.pod        \
827         doc/randpkt.txt         \
828         doc/tethereal.pod.template \
829         doc/text2pcap.pod       \
830         editcap.c               \
831         ethereal_be.py          \
832         ethereal_gen.py         \
833         mergecap.c              \
834         text2pcap.c             \
835         text2pcap.h             \
836         text2pcap-scanner.l     \
837         getopt.c                \
838         getopt.h                \
839         idl2eth.sh              \
840         ieee-float.h            \
841         image/Makefile.nmake    \
842         image/README.image      \
843         image/clist_ascend.xpm  \
844         image/clist_descend.xpm \
845         image/dn_arrow.xpm      \
846         image/editcap.rc.in     \
847         image/eexcl3d64.xpm     \
848         image/eicon3d16.xpm     \
849         image/eicon3d32.xpm     \
850         image/eicon3d48.xpm     \
851         image/eicon3d64.xpm     \
852         image/elogo3d48x48.png  \
853         image/ethereal.ico      \
854         image/ethereal.rc.in    \
855         image/ethereal48x48-trans.png  \
856         image/ethereal48x48.png \
857         image/hi16-app-ethereal.png     \
858         image/hi32-app-ethereal.png     \
859         image/hi48-app-ethereal.png     \
860         image/icon-ethereal.xpm \
861         image/icon-excl.xpm     \
862         image/lo16-app-ethereal.png     \
863         image/lo32-app-ethereal.png     \
864         image/lo48-app-ethereal.png     \
865         image/mergecap.rc.in    \
866         image/tethereal.rc.in   \
867         image/text2pcap.rc.in   \
868         image/up_arrow.xpm      \
869         INSTALL.configure       \
870         Makefile.nmake          \
871         make-manuf              \
872         make-reg-dotc           \
873         make-reg-dotc.py        \
874         manuf                   \
875         manuf.tmpl              \
876         ncp2222.py              \
877         packet-ncp2222.inc      \
878         print.ps                \
879         process-x11-fields.pl   \
880         README.aix              \
881         README.bsd              \
882         README.hpux             \
883         README.irix             \
884         README.linux            \
885         README.tru64            \
886         README.vmware           \
887         README.win32            \
888         randpkt.c               \
889         rdps.c                  \
890         TODO                    \
891         dictionary.dtd          \
892         dictionary.xml          \
893         mobileipv4.xml          \
894         nasreq.xml              \
895         sunping.xml             \
896         x11-fields
897
898 if SETUID_INSTALL
899 install-exec-hook:
900         -chmod +s $(DESTDIR)$(bindir)/ethereal
901         -chmod +s $(DESTDIR)$(bindir)/tethereal
902         -chmod +s $(DESTDIR)$(bindir)/ethereal_static
903 else
904 install-exec-hook:
905 endif
906
907 #
908 # Currently register.c can be included in the distribution because
909 # we always build all protocol dissectors. We used to have to check
910 # whether or not to build the snmp dissector. If we again need to
911 # variably build something, making register.c non-portable, uncomment
912 # the dist-hook line below.
913 #
914 # Oh, yuk.  We don't want to include "register.c" in the distribution, as
915 # its contents depend on the configuration, and therefore we want it
916 # to be built when the first "make" is done; however, Automake insists
917 # on putting *all* source into the distribution.
918 #
919 # We work around this by having a "dist-hook" rule that deletes
920 # "register.c", so that "dist" won't pick it up.
921 #
922 #dist-hook:
923 #       @rm -f $(distdir)/register.c
924
925 if HAVE_PLUGINS
926 SUBDIRS = tools wiretap doc epan plugins packaging @ethereal_SUBDIRS@
927 else
928 SUBDIRS = tools wiretap doc epan packaging @ethereal_SUBDIRS@
929 endif
930
931 ethereal.1: ethereal doc/ethereal.pod.template
932         (cd doc ; \
933         $(MAKE) ../ethereal.1 )
934
935 tethereal.1: tethereal doc/tethereal.pod.template
936         (cd doc ; \
937         $(MAKE) ../tethereal.1 )
938
939 editcap.1: doc/editcap.pod
940         (cd doc ; \
941         $(MAKE) ../editcap.1 )
942
943 idl2eth.1: doc/idl2eth.pod
944         (cd doc ; \
945         $(MAKE) ../idl2eth.1 )
946
947 mergecap.1: doc/mergecap.pod
948         (cd doc ; \
949         $(MAKE) ../mergecap.1 )
950
951 text2pcap.1: doc/text2pcap.pod
952         (cd doc ; \
953         $(MAKE) ../text2pcap.1 )
954
955 packet-ncp2222.c : ncp2222.py
956         $(PYTHON) $(srcdir)/ncp2222.py > $@
957
958 libtool: $(LIBTOOL_DEPS)
959         $(SHELL) ./config.status --recheck
960
961 # We load top_stagedir with an explicit path so that libtool doesn't freak.
962 top_stagedir=`cd $(top_srcdir) && pwd`/packaging/svr4.stage
963 stagedir=$(top_stagedir)/$(PACKAGE).stage
964 host_cpu=@host_cpu@
965 host_os=@host_os@
966
967 svr4-package: $(bin_SCRIPTS) $(lib_LTLIBRARIES)
968         if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
969                 rm -rf $(stagedir) ; \
970                 $(MAKE) DESTDIR=$(stagedir) install-strip; \
971                 $(srcdir)/packaging/svr4/mkpkg \
972                         $(PACKAGE) \
973                         $(PACKAGE)-$(VERSION)-$(host_os)-$(host_cpu)-local \
974                         $(prefix) \
975                         $(top_stagedir) ; \
976         else \
977                 echo "Error: SVR4 packaging tools not found." ; \
978                 echo "Package build abandoned." ; \
979         fi
980
981 solaris-package: svr4-package
982
983 rpm_topdir=`cd $(top_srcdir) && pwd`/packaging/rpm
984 rpm-package: dist
985         if test x$(HAVE_RPM) = xyes ; then \
986                 cd $(rpm_topdir) ; \
987                 mkdir BUILD RPMS SOURCES ; \
988                 cd SOURCES ; \
989                 ln -s ../../../$(distdir).tar.gz ; \
990                 cd .. ; \
991                 rpm --define "_topdir `cd . && pwd`" -bb SPECS/ethereal.spec && \
992                         echo "Package successfully built in `pwd`/RPMS." ; \
993         else \
994                 echo "Error: RPM executable and/or source directory not found." ; \
995         fi
996 srpm-package: dist
997         if test x$(HAVE_RPM) = xyes ; then \
998                 cd $(rpm_topdir) ; \
999                 mkdir BUILD SRPMS SOURCES ; \
1000                 cd SOURCES ; \
1001                 ln -s ../../../$(distdir).tar.gz ; \
1002                 cd .. ; \
1003                 rpm --define "_topdir `cd . && pwd`" -bs SPECS/ethereal.spec && \
1004                         echo "Package successfully built in `pwd`/SRPMS." ; \
1005         else \
1006                 echo "Error: RPM executable and/or source directory not found." ; \
1007         fi
1008
1009 debian-package: debian/rules
1010         dpkg-buildpackage -rfakeroot -us -uc
1011
1012 clean-local:
1013         rm -rf $(top_stagedir)