X.25 over TCP support, from Paul Ionescu.
[obnox/wireshark/wip.git] / Makefile.am
1 # Makefile.am
2 # Automake file for Ethereal
3 #
4 # $Id: Makefile.am,v 1.259 2000/12/17 07:38:14 guy Exp $
5 #
6 # Ethereal - Network traffic analyzer
7 # By Gerald Combs <gerald@zing.org>
8 # Copyright 1998 Gerald Combs
9 #
10
11 # This program is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU General Public License
13 # as published by the Free Software Foundation; either version 2
14 # of the License, or (at your option) any later version.
15
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 # GNU General Public License for more details.
20
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24
25 ACLOCAL_AMFLAGS = `./aclocal-flags`
26
27 bin_PROGRAMS = @ethereal_bin@ @editcap_bin@ @tethereal_bin@
28 man_MANS = @ethereal_man@ @editcap_man@ @tethereal_man@
29
30 EXTRA_PROGRAMS = ethereal ethereal_static tethereal editcap
31 EXTRA_MANS = ethereal.1 tethereal.1 editcap.1
32
33 sysconf_DATA = manuf
34
35 DISSECTOR_SOURCES = \
36         packet-aarp.c  \
37         packet-afs.c   \
38         packet-aim.c   \
39         packet-arp.c   \
40         packet-ascend.c\
41         packet-atalk.c \
42         packet-atm.c   \
43         packet-auto_rp.c   \
44         packet-bgp.c   \
45         packet-bootp.c \
46         packet-bootparams.c \
47         packet-bpdu.c  \
48         packet-bxxp.c \
49         packet-cdp.c   \
50         packet-cgmp.c  \
51         packet-clip.c  \
52         packet-clnp.c  \
53         packet-cops.c  \
54         packet-data.c  \
55         packet-ddtp.c  \
56         packet-diameter.c \
57         packet-dns.c   \
58         packet-eigrp.c \
59         packet-esis.c  \
60         packet-eth.c   \
61         packet-ethertype.c   \
62         packet-fddi.c  \
63         packet-frame.c  \
64         packet-ftp.c   \
65         packet-giop.c  \
66         packet-gre.c   \
67         packet-gvrp.c  \
68         packet-h1.c    \
69         packet-h261.c  \
70         packet-hsrp.c  \
71         packet-http.c  \
72         packet-icmpv6.c\
73         packet-icp.c   \
74         packet-icq.c   \
75         packet-igrp.c  \
76         packet-imap.c   \
77         packet-ip.c    \
78         packet-ipp.c   \
79         packet-ipsec.c \
80         packet-ipv6.c  \
81         packet-ipx.c   \
82         packet-irc.c   \
83         packet-ieee80211.c \
84         packet-isakmp.c\
85         packet-isis.c  \
86         packet-isis-clv.c \
87         packet-isis-hello.c \
88         packet-isis-lsp.c \
89         packet-isis-snp.c \
90         packet-isl.c   \
91         packet-kerberos.c \
92         packet-l2tp.c  \
93         packet-lapb.c  \
94         packet-lapd.c  \
95         packet-ldap.c  \
96         packet-ldp.c   \
97         packet-llc.c   \
98         packet-lpd.c   \
99         packet-mapi.c  \
100         packet-mip.c  \
101         packet-mount.c \
102         packet-mpls.c \
103         packet-msproxy.c \
104         packet-nbipx.c \
105         packet-nbns.c  \
106         packet-ncp.c   \
107         packet-ncp2222.c   \
108         packet-netbios.c \
109         packet-nfs.c   \
110         packet-nlm.c   \
111         packet-nntp.c  \
112         packet-ntp.c  \
113         packet-null.c  \
114         packet-osi.c   \
115         packet-osi-options.c \
116         packet-ospf.c  \
117         packet-pim.c   \
118         packet-pop.c   \
119         packet-portmap.c   \
120         packet-ppp.c   \
121         packet-pppoe.c \
122         packet-pptp.c  \
123         packet-q2931.c \
124         packet-q931.c  \
125         packet-quake.c \
126         packet-radius.c\
127         packet-raw.c   \
128         packet-rip.c   \
129         packet-ripng.c \
130         packet-rlogin.c \
131         packet-rpc.c   \
132         packet-rsh.c   \
133         packet-rsvp.c  \
134         packet-rtcp.c  \
135         packet-rtp.c   \
136         packet-rtsp.c  \
137         packet-rx.c  \
138         packet-sap.c   \
139         packet-sctp.c   \
140         packet-sdp.c   \
141         packet-sip.c   \
142         packet-smb.c   \
143         packet-smb-browse.c \
144         packet-smb-common.c \
145         packet-smb-logon.c \
146         packet-smb-mailslot.c \
147         packet-smb-pipe.c \
148         packet-smtp.c \
149         packet-sna.c   \
150         packet-snmp.c   \
151         packet-socks.c \
152         packet-srvloc.c \
153         packet-sscop.c \
154         packet-stat.c   \
155         packet-syslog.c \
156         packet-tacacs.c \
157         packet-tcp.c   \
158         packet-telnet.c\
159         packet-tftp.c  \
160         packet-time.c  \
161         packet-tns.c \
162         packet-tpkt.c  \
163         packet-tr.c    \
164         packet-trmac.c \
165         packet-udp.c   \
166         packet-v120.c \
167         packet-vines.c \
168         packet-vlan.c \
169         packet-vrrp.c \
170         packet-vtp.c  \
171         packet-wccp.c \
172         packet-who.c  \
173         packet-wsp.c \
174         packet-wtp.c \
175         packet-x11.c   \
176         packet-x25.c   \
177         packet-xot.c   \
178         packet-yhoo.c  \
179         packet-ypbind.c \
180         packet-ypserv.c \
181         packet-ypxfr.c \
182         packet-zebra.c
183
184 noinst_HEADERS = \
185         packet-afs.h   \
186         packet-afs-macros.h \
187         packet-afs-register-info.h \
188         packet-afs-defs.h \
189         packet-arp.h   \
190         packet-atalk.h \
191         packet-bgp.h   \
192         packet-bootparams.h \
193         packet-cdp.h   \
194         packet-cgmp.h  \
195         packet-clip.h  \
196         packet-ddtp.h  \
197         packet-diameter.h \
198         packet-diameter-defs.h \
199         packet-dns.h   \
200         packet-esis.h  \
201         packet-eth.h   \
202         packet-fddi.h  \
203         packet-frame.h  \
204         packet-gvrp.h  \
205         packet-h261.h  \
206         packet-http.h  \
207         packet-ieee80211.h \
208         packet-ip.h    \
209         packet-ipsec.h \
210         packet-ipv6.h  \
211         packet-ipx.h   \
212         packet-isis.h  \
213         packet-isis-clv.h \
214         packet-isis-hello.h \
215         packet-isis-lsp.h \
216         packet-isis-snp.h \
217         packet-isl.h   \
218         packet-kerberos.h \
219         packet-ldap.h  \
220         packet-llc.h   \
221         packet-mount.h \
222         packet-ncp-int.h \
223         packet-netbios.h \
224         packet-nfs.h   \
225         packet-nlm.h   \
226         packet-ntp.h  \
227         packet-null.h  \
228         packet-osi.h   \
229         packet-osi-options.h \
230         packet-ospf.h  \
231         packet-portmap.h   \
232         packet-ppp.h   \
233         packet-q2931.h \
234         packet-q931.h  \
235         packet-raw.h   \
236         packet-rip.h   \
237         packet-ripng.h \
238         packet-rpc.h   \
239         packet-rtcp.h  \
240         packet-rtp.h   \
241         packet-rx.h  \
242         packet-smb.h   \
243         packet-smb-common.h \
244         packet-sna.h   \
245         packet-snmp.h   \
246         packet-sscop.h \
247         packet-stat.h   \
248         packet-tcp.h   \
249         packet-tns.h \
250         packet-tpkt.h  \
251         packet-tr.h    \
252         packet-trmac.h \
253         packet-udp.h   \
254         packet-vines.h \
255         packet-vlan.h \
256         packet-vtp.h  \
257         packet-wap.h \
258         packet-wccp.h \
259         packet-wsp.h \
260         packet-wtp.h \
261         packet-x11-declarations.h       \
262         packet-x11-register-info.h      \
263         packet-x11-keysym.h     \
264         packet-x25.h   \
265         packet-yhoo.h  \
266         packet-ypbind.h \
267         packet-ypserv.h \
268         packet-ypxfr.h 
269
270 ETHEREAL_COMMON_SOURCES = \
271         aftypes.h      \
272         alignment.h    \
273         asn1.c         \
274         asn1.h         \
275         column.c       \
276         column.h       \
277         color.h        \
278         etypes.h       \
279         follow.c       \
280         follow.h       \
281         in_cksum.c     \
282         in_cksum.h     \
283         ipproto.c      \
284         llcsaps.h      \
285         nlpid.h        \
286         oui.h          \
287         ppptypes.h     \
288         prefs.c        \
289         prefs.h        \
290         prefs-int.h    \
291         print.c        \
292         print.h        \
293         ps.c           \
294         ps.h           \
295         ptvcursor.c     \
296         ptvcursor.h     \
297         register.c     \
298         register.h     \
299         smb.h          \
300         timestamp.h    \
301         util.c         \
302         util.h         \
303         xdlc.c         \
304         xdlc.h
305
306 ethereal_SOURCES = \
307         $(DISSECTOR_SOURCES) \
308         $(ETHEREAL_COMMON_SOURCES) \
309         capture.c      \
310         capture.h      \
311         file.c         \
312         file.h         \
313         globals.h      \
314         menu.h         \
315         simple_dialog.h \
316         summary.c      \
317         summary.h      \
318         ui_util.h
319
320 ethereal_static_SOURCES = \
321         $(ethereal_SOURCES)
322
323 EXTRA_ethereal_SOURCES = \
324         snprintf.c      \
325         snprintf.h      \
326         snprintf-imp.h  \
327         strerror.c      \
328         strerror.h      \
329         strcasecmp.c    \
330         strncasecmp.c   \
331         mkstemp.c       \
332         mkstemp.h
333
334 # Optional objects that I know how to build. These will be
335 # linked into the ethereal executable.
336 # They will also be linked into the tethereal executable; if this
337 # list ever grows to include something that can't be linked with
338 # tethereal, or if tethereal needs something that ethereal doesn't,
339 # we should probably split this into stuff needed both
340 # by ethereal and tethereal and stuff needed only by one or the
341 # other.
342 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ \
343         @STRCASECMP_O@ @STRNCASECMP_O@ @MKSTEMP_O@
344
345 # Additional libs that I know how to build. These will be
346 # linked into the ethereal executable.
347 ethereal_additional_libs = wiretap/libwiretap.a gtk/libui.a epan/libethereal.a
348
349 # This is the automake dependency variable for the executable
350 ethereal_DEPENDENCIES = \
351         $(ethereal_optional_objects)    \
352         $(ethereal_additional_libs)     \
353         plugins/gryphon/gryphon.la \
354         plugins/mgcp/mgcp.la
355
356 ethereal_static_DEPENDENCIES = \
357         $(ethereal_optional_objects)    \
358         $(ethereal_additional_libs)
359
360 # This automake variable adds to the link-line for the executable.
361 #
362 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
363 # they are included in @GTK_LIBS@, and doesn't have to be linked with
364 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
365 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
366 # applications are X applications).
367 ethereal_LDADD = \
368         $(ethereal_optional_objects)    \
369         $(ethereal_additional_libs)     \
370         @SNMP_LIBS@                     \
371         "-dlopen" self  \
372         "-dlopen" plugins/gryphon/gryphon.la @PCAP_LIBS@ @GTK_LIBS@ \
373         "-dlopen" plugins/mgcp/mgcp.la @PCAP_LIBS@ @GTK_LIBS@
374
375 ethereal_static_LDADD = \
376         $(ethereal_optional_objects)    \
377         $(ethereal_additional_libs) \
378         @SNMP_LIBS@                     \
379         @PCAP_LIBS@ @GTK_LIBS@
380
381 ethereal_LDFLAGS = -export-dynamic
382 ethereal_static_LDFLAGS = -Wl,-static
383
384 tethereal_SOURCES = \
385         $(DISSECTOR_SOURCES) \
386         $(ETHEREAL_COMMON_SOURCES) \
387         tethereal.c
388
389 # Additional libs that I know how to build. These will be
390 # linked into the tethereal executable.
391 tethereal_additional_libs = wiretap/libwiretap.a epan/libethereal.a
392
393 # This is the automake dependency variable for the executable
394 tethereal_DEPENDENCIES = \
395         $(ethereal_optional_objects)    \
396         $(tethereal_additional_libs)    \
397         plugins/gryphon/gryphon.la      \
398         plugins/mgcp/mgcp.la
399
400 # This automake variable adds to the link-line for the executable
401 tethereal_LDADD = wiretap/libwiretap.a  \
402         $(ethereal_optional_objects)    \
403         $(tethereal_additional_libs)    \
404         @SNMP_LIBS@                     \
405         "-dlopen" self  \
406         "-dlopen" plugins/gryphon/gryphon.la @GLIB_LIBS@ -lm \
407         "-dlopen" plugins/mgcp/mgcp.la @GLIB_LIBS@ -lm \
408         @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
409
410 tethereal_LDFLAGS = -export-dynamic
411
412 editcap_SOURCES = editcap.c
413
414 # This is the automake dependency variable for the executable
415 editcap_DEPENDENCIES = wiretap/libwiretap.a
416
417 # This automake variable adds to the link-line for the executable
418 editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
419
420 #
421 # Build "register.c", which contains a function "register_all_protocols()"
422 # that calls the register routines for all protocols.
423 #
424 # We do this by grepping through sources.  If that turns out to be too slow,
425 # maybe we could just require every .o file to have an register routine
426 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
427 #
428 # Formatting conventions:  The name of the proto_register_* routines must
429 # start in column zero, or must be preceded only by "void " starting in
430 # column zero, and must not be inside #if.
431 #
432 # We assume that all dissector routines are in "packet-XXX.c" files.
433 #
434 # For some unknown reason, having a big "for" loop in the Makefile
435 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
436 # they seem to pass only the first few names in the list to the shell,
437 # for some reason.
438 #
439 # Therefore, we have a script to generate the "register.c" file.
440 #
441 # The first argument is the directory in which the source files live.
442 # All subsequent arguments are the files to scan.
443 #
444 register.c: $(DISSECTOR_SOURCES) $(srcdir)/make-reg-dotc
445         @echo Making register.c
446         @$(srcdir)/make-reg-dotc $(srcdir) $(DISSECTOR_SOURCES)
447
448 ps.c: print.ps rdps
449         ./rdps $(srcdir)/print.ps ps.c
450
451 rdps: rdps.c
452         $(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
453
454 randpkt.o: randpkt.c
455         $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
456
457 randpkt: randpkt.o wiretap/libwiretap.a
458         $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
459
460 DISTCLEANFILES =        \
461         register.c      \
462         rdps            \
463         ps.c            \
464         *~
465
466 EXTRA_DIST = \
467         aclocal-flags           \
468         config.h.win32          \
469         config.nmake            \
470         debian/README.debian    \
471         debian/changelog        \
472         debian/control          \
473         debian/copyright        \
474         debian/dirs             \
475         debian/docs             \
476         debian/menu             \
477         debian/postinst         \
478         debian/prerm            \
479         debian/rules            \
480         doc/README.developer    \
481         doc/Makefile.in         \
482         doc/Makefile.am         \
483         doc/README.regression   \
484         doc/README.tvbuff       \
485         doc/dfilter2pod.pl      \
486         doc/editcap.pod         \
487         doc/ethereal.pod.template \
488         doc/randpkt.txt         \
489         doc/tethereal.pod.template \
490         editcap.c               \
491         getopt.c                \
492         getopt.h                \
493         ieee-float.h            \
494         image/editcap.rc        \
495         image/ethereal48x48-trans.png  \
496         image/ethereal48x48.png \
497         image/ethereal.ico      \
498         image/ethereal.rc       \
499         image/icon-excl.xpm     \
500         image/icon-ethereal.xpm \
501         image/tethereal.rc      \
502         INSTALL.configure       \
503         libpcap-0.4.HPUX.HPUXPAC.patch \
504         libpcap-0.4.HPUX.LBL.patch \
505         libpcap-0.5.HPUX.tcpdump.org.patch \
506         Makefile.nmake          \
507         make-reg-dotc           \
508         manuf                   \
509         ncp2222.py              \
510         packet-ncp2222.inc      \
511         print.ps                \
512         README.aix              \
513         README.bsd              \
514         README.hpux             \
515         README.irix             \
516         README.linux            \
517         README.tru64            \
518         README.vmware           \
519         README.win32            \
520         randpkt.c               \
521         rdps.c                  \
522         TODO
523
524 if SETUID_INSTALL
525 install-exec-hook:
526         -chmod +s $(DESTDIR)$(bindir)/ethereal
527         -chmod +s $(DESTDIR)$(bindir)/tethereal
528         -chmod +s $(DESTDIR)$(bindir)/ethereal_static
529 else
530 install-exec-hook:
531 endif
532
533 #
534 # Currently register.c can be included in the distribution because
535 # we always build all protocol dissectors. We used to have to check
536 # whether or not to build the snmp dissector. If we again need to
537 # variably build something, making register.c non-portable, uncomment
538 # the dist-hook line below.
539 #
540 # Oh, yuk.  We don't want to include "register.c" in the distribution, as
541 # its contents depend on the configuration, and therefore we want it
542 # to be built when the first "make" is done; however, Automake insists
543 # on putting *all* source into the distribution.
544 #
545 # We work around this by having a "dist-hook" rule that deletes
546 # "register.c", so that "dist" won't pick it up.
547 #
548 #dist-hook:
549 #       @rm -f $(distdir)/register.c
550
551 SUBDIRS = wiretap epan plugins packaging @ethereal_SUBDIRS@
552
553 ethereal.1: ethereal doc/ethereal.pod.template
554         (cd doc ; \
555         $(MAKE) ../ethereal.1 )
556
557 tethereal.1: tethereal doc/tethereal.pod.template
558         (cd doc ; \
559         $(MAKE) ../tethereal.1 )
560
561 editcap.1: doc/editcap.pod
562         (cd doc ; \
563         $(MAKE) ../editcap.1 )
564
565 packet-ncp2222.c : ncp2222.py
566         $(PYTHON) $(srcdir)/ncp2222.py > $@
567
568 libtool: $(LIBTOOL_DEPS)
569         $(SHELL) ./config.status --recheck
570
571 # We load top_stagedir with an explicit path so that libtool doesn't freak.
572 top_stagedir=`cd $(top_srcdir) && pwd`/packaging/svr4.stage
573 stagedir=$(top_stagedir)/$(PACKAGE).stage
574 host_cpu=@host_cpu@
575 host_os=@host_os@
576
577 svr4-package: $(bin_SCRIPTS) $(lib_LTLIBRARIES)
578         if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
579                 rm -rf $(stagedir) ; \
580                 $(MAKE) DESTDIR=$(stagedir) install-strip; \
581                 $(srcdir)/packaging/svr4/mkpkg \
582                         $(PACKAGE) \
583                         $(PACKAGE)-$(VERSION)-$(host_os)-$(host_cpu)-local \
584                         $(prefix) \
585                         $(top_stagedir) ; \
586         else \
587                 echo "Error: SVR4 packaging tools not found." ; \
588                 echo "Package build abandoned." ; \
589         fi
590
591 solaris-package: svr4-package
592
593 specfile=$(top_srcdir)/packaging/rpm/ethereal.spec
594
595 rpm-package: dist
596         if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
597                 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
598                 rpm -bb --clean --rmsource $(specfile) ; \
599         else \
600                 echo "Error: RPM executable and/or source directory not found." ; \
601                 echo "Package build abandoned." ; \
602         fi
603
604 srpm-package: dist
605         if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
606                 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
607                 rpm -bs --clean --rmsource $(specfile) ; \
608         else \
609                 echo "Error: RPM executable and/or source directory not found." ; \
610                 echo "Package build abandoned." ; \
611         fi
612
613 debian-package: debian/rules
614         dpkg-buildpackage -rfakeroot -us -uc
615
616 clean-local:
617         rm -rf $(top_stagedir)