2 # Automake file for Ethereal
4 # $Id: Makefile.am,v 1.374 2001/11/03 01:56:10 guy Exp $
6 # Ethereal - Network traffic analyzer
7 # By Gerald Combs <gerald@ethereal.com>
8 # Copyright 1998 Gerald Combs
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.
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.
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.
24 ACLOCAL_AMFLAGS = `./aclocal-flags`
27 # This is a hideous hack.
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).
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.
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
46 # So, as all our man pages go in section 1, we define "man1_MANS" to
47 # contain all the man page.
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.)
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.
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@
68 EXTRA_PROGRAMS = ethereal ethereal_static tethereal tethereal_static editcap mergecap dftest text2pcap
69 EXTRA_SCRIPTS = idl2eth
71 sysconf_DATA = manuf dictionary.dtd dictionary.xml mobileipv4.xml \
72 nasreq.xml sunping.xml
100 packet-dcerpc-conv.c \
101 packet-dcerpc-epm.c \
102 packet-dcerpc-mgmt.c \
103 packet-dcerpc-remact.c \
104 packet-dcerpc-oxid.c \
149 packet-isis-hello.c \
192 packet-osi-options.c \
204 packet-quakeworld.c \
229 packet-smb-browse.c \
230 packet-smb-common.c \
232 packet-smb-mailslot.c \
243 packet-stat-notify.c \
281 plugins/gryphon/packet-gryphon.c \
282 plugins/mgcp/packet-mgcp.c \
283 plugins/giop/packet-cosnaming.c \
284 plugins/giop/packet-coseventcomm.c
286 plugin_static_ldadd = \
287 plugins/gryphon/packet-gryphon-static.o \
288 plugins/mgcp/packet-mgcp-static.o \
289 plugins/giop/packet-cosnaming-static.o \
290 plugins/giop/packet-coseventcomm-static.o
293 plugins/gryphon/gryphon.la \
294 plugins/mgcp/mgcp.la \
295 plugins/giop/cosnaming.la \
296 plugins/giop/coseventcomm.la
300 "-dlopen" plugins/gryphon/gryphon.la \
301 "-dlopen" plugins/mgcp/mgcp.la \
302 "-dlopen" plugins/giop/cosnaming.la \
303 "-dlopen" plugins/giop/coseventcomm.la
307 plugin_static_ldadd =
316 packet-afs-macros.h \
317 packet-afs-register-info.h \
322 packet-bootparams.h \
327 packet-diameter-defs.h \
347 packet-isis-hello.h \
365 packet-osi-options.h \
380 packet-smb-browse.h \
381 packet-smb-common.h \
383 packet-smb-mailslot.h \
389 packet-stat-notify.h \
402 packet-x11-keysym.h \
409 ETHEREAL_COMMON_SRC = \
450 x11-register-info.h \
462 $(ETHEREAL_COMMON_SRC) \
481 ethereal_static_SOURCES = \
483 $(ETHEREAL_COMMON_SRC) \
502 EXTRA_ethereal_SOURCES = \
515 # Optional objects that I know how to build. These will be
516 # linked into the ethereal executable.
517 # They will also be linked into the tethereal executable; if this
518 # list ever grows to include something that can't be linked with
519 # tethereal, or if tethereal needs something that ethereal doesn't,
520 # we should probably split this into stuff needed both
521 # by ethereal and tethereal and stuff needed only by one or the
523 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ \
524 @STRCASECMP_O@ @STRNCASECMP_O@ @MKSTEMP_O@ @STRPTIME_O@
526 # Additional libs that I know how to build. These will be
527 # linked into the ethereal executable.
528 ethereal_additional_libs = \
529 wiretap/libwiretap.a \
532 epan/ftypes/libftypes.a \
533 epan/dfilter/libdfilter.a
535 # This is the automake dependency variable for the executable
536 ethereal_DEPENDENCIES = \
537 $(ethereal_optional_objects) \
538 $(ethereal_additional_libs) \
541 ethereal_static_DEPENDENCIES = \
542 $(ethereal_optional_objects) \
543 $(ethereal_additional_libs)
545 # This automake variable adds to the link-line for the executable.
547 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
548 # they are included in @GTK_LIBS@, and doesn't have to be linked with
549 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
550 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
551 # applications are X applications).
553 $(ethereal_optional_objects) \
554 $(ethereal_additional_libs) \
555 @SNMP_LIBS@ @SSL_LIBS@ \
557 @PCAP_LIBS@ @GTK_LIBS@
559 ethereal_static_LDADD = \
561 $(plugin_static_ldadd) \
562 $(ethereal_optional_objects) \
563 $(ethereal_additional_libs) \
564 @SNMP_LIBS@ @SSL_LIBS@ \
565 @PCAP_LIBS@ @GTK_LIBS@
567 ethereal_LDFLAGS = -export-dynamic
568 ethereal_static_LDFLAGS = -Wl,-static
570 tethereal_SOURCES = \
572 $(ETHEREAL_COMMON_SRC) \
576 tethereal_static_SOURCES = \
578 $(ETHEREAL_COMMON_SRC) \
582 # Additional libs that I know how to build. These will be
583 # linked into the tethereal executable.
584 tethereal_additional_libs = \
585 wiretap/libwiretap.a \
587 epan/ftypes/libftypes.a \
588 epan/dfilter/libdfilter.a
590 # This is the automake dependency variable for the executable
591 tethereal_DEPENDENCIES = \
592 $(ethereal_optional_objects) \
593 $(tethereal_additional_libs) \
596 tethereal_static_DEPENDENCIES = \
597 $(ethereal_optional_objects) \
598 $(tethereal_additional_libs)
600 # This automake variable adds to the link-line for the executable
601 tethereal_LDADD = wiretap/libwiretap.a \
602 $(ethereal_optional_objects) \
603 $(tethereal_additional_libs) \
604 @SNMP_LIBS@ @SSL_LIBS@ \
607 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
609 tethereal_static_LDADD = \
611 $(plugin_static_ldadd) \
612 wiretap/libwiretap.a \
613 $(ethereal_optional_objects) \
614 $(tethereal_additional_libs) \
615 @SNMP_LIBS@ @SSL_LIBS@ \
617 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
619 tethereal_LDFLAGS = -export-dynamic
620 tethereal_static_LDFLAGS = -Wl,-static
622 text2pcap_SOURCES = text2pcap.c text2pcap-scanner.l
623 text2pcap_DEPENDENCIES = text2pcap.h
625 mergecap_SOURCES = mergecap.c
626 mergecap_DEPENDENCIES = wiretap/libwiretap.a
628 editcap_SOURCES = editcap.c
630 # This is the automake dependency variable for the executable
631 editcap_DEPENDENCIES = wiretap/libwiretap.a
633 # This automake variable adds to the link-line for the executable
634 editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
635 mergecap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
638 # Build various header files for the X11 dissector.
640 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
641 $(PERL) $(srcdir)/process-x11-fields.pl <$(srcdir)/x11-fields
644 # Build shell scripts by doing variable substitution.
645 # Taken from autoconf 2.13.
647 editsh = sed -e 's,@''SHELL''@,$(SHELL),g'
652 $(editsh) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
655 # Build "register.c", which contains a function "register_all_protocols()"
656 # that calls the register routines for all protocols.
658 # We do this by grepping through sources. If that turns out to be too slow,
659 # maybe we could just require every .o file to have an register routine
660 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
662 # Formatting conventions: The name of the proto_register_* routines must
663 # start in column zero, or must be preceded only by "void " starting in
664 # column zero, and must not be inside #if.
666 # We assume that all dissector routines are in "packet-XXX.c" files.
668 # For some unknown reason, having a big "for" loop in the Makefile
669 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
670 # they seem to pass only the first few names in the list to the shell,
673 # Therefore, we have a script to generate the "register.c" file.
675 # The first argument is the directory in which the source files live.
676 # All subsequent arguments are the files to scan.
678 register.c: $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
679 @echo Making register.c
680 @$(srcdir)/make-reg-dotc register.c $(srcdir) $(DISSECTOR_SRC)
682 register-static.c: $(plugin_src) $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
683 @echo Making register-static.c
684 @$(srcdir)/make-reg-dotc register-static.c $(srcdir) $(plugin_src) $(DISSECTOR_SRC)
687 ./rdps $(srcdir)/print.ps ps.c
690 $(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
693 $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
695 randpkt: randpkt.o wiretap/libwiretap.a
696 $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
701 $(ETHEREAL_COMMON_SRC) \
705 dftest_additional_libs = \
707 epan/ftypes/libftypes.a \
708 epan/dfilter/libdfilter.a
710 dftest_DEPENDENCIES = \
711 $(ethereal_optional_objects) \
712 $(dftest_additional_libs) \
715 # This automake variable adds to the link-line for the executable
717 $(ethereal_optional_objects) \
718 $(dftest_additional_libs) \
719 @SNMP_LIBS@ @SSL_LIBS@ \
722 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
724 dftest_LDFLAGS = -export-dynamic
743 debian/README.debian \
756 doc/README.developer \
759 doc/README.regression \
763 doc/ethereal.pod.template \
767 doc/tethereal.pod.template \
775 text2pcap-scanner.l \
780 image/Makefile.nmake \
781 image/editcap.rc.in \
782 image/elogo3d48x48.png \
783 image/ethereal48x48-trans.png \
784 image/ethereal48x48.png \
786 image/ethereal.rc.in \
787 image/icon-excl.xpm \
788 image/icon-ethereal.xpm \
789 image/clist_ascend.xpm \
790 image/clist_descend.xpm \
791 image/mergecap.rc.in \
792 image/tethereal.rc.in \
793 image/text2pcap.rc.in \
804 process-x11-fields.pl \
825 -chmod +s $(DESTDIR)$(bindir)/ethereal
826 -chmod +s $(DESTDIR)$(bindir)/tethereal
827 -chmod +s $(DESTDIR)$(bindir)/ethereal_static
833 # Currently register.c can be included in the distribution because
834 # we always build all protocol dissectors. We used to have to check
835 # whether or not to build the snmp dissector. If we again need to
836 # variably build something, making register.c non-portable, uncomment
837 # the dist-hook line below.
839 # Oh, yuk. We don't want to include "register.c" in the distribution, as
840 # its contents depend on the configuration, and therefore we want it
841 # to be built when the first "make" is done; however, Automake insists
842 # on putting *all* source into the distribution.
844 # We work around this by having a "dist-hook" rule that deletes
845 # "register.c", so that "dist" won't pick it up.
848 # @rm -f $(distdir)/register.c
851 SUBDIRS = tools wiretap doc epan plugins packaging @ethereal_SUBDIRS@
853 SUBDIRS = tools wiretap doc epan packaging @ethereal_SUBDIRS@
856 ethereal.1: ethereal doc/ethereal.pod.template
858 $(MAKE) ../ethereal.1 )
860 tethereal.1: tethereal doc/tethereal.pod.template
862 $(MAKE) ../tethereal.1 )
864 editcap.1: doc/editcap.pod
866 $(MAKE) ../editcap.1 )
868 idl2eth.1: doc/idl2eth.pod
870 $(MAKE) ../idl2eth.1 )
872 mergecap.1: doc/mergecap.pod
874 $(MAKE) ../mergecap.1 )
876 text2pcap.1: doc/text2pcap.pod
878 $(MAKE) ../text2pcap.1 )
880 packet-ncp2222.c : ncp2222.py
881 $(PYTHON) $(srcdir)/ncp2222.py > $@
883 libtool: $(LIBTOOL_DEPS)
884 $(SHELL) ./config.status --recheck
886 # We load top_stagedir with an explicit path so that libtool doesn't freak.
887 top_stagedir=`cd $(top_srcdir) && pwd`/packaging/svr4.stage
888 stagedir=$(top_stagedir)/$(PACKAGE).stage
892 svr4-package: $(bin_SCRIPTS) $(lib_LTLIBRARIES)
893 if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
894 rm -rf $(stagedir) ; \
895 $(MAKE) DESTDIR=$(stagedir) install-strip; \
896 $(srcdir)/packaging/svr4/mkpkg \
898 $(PACKAGE)-$(VERSION)-$(host_os)-$(host_cpu)-local \
902 echo "Error: SVR4 packaging tools not found." ; \
903 echo "Package build abandoned." ; \
906 solaris-package: svr4-package
908 specfile=$(top_srcdir)/packaging/rpm/ethereal.spec
911 if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
912 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
913 rpm -bb --clean --rmsource $(specfile) ; \
915 echo "Error: RPM executable and/or source directory not found." ; \
916 echo "Package build abandoned." ; \
920 if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
921 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
922 rpm -bs --clean --rmsource $(specfile) ; \
924 echo "Error: RPM executable and/or source directory not found." ; \
925 echo "Package build abandoned." ; \
928 debian-package: debian/rules
929 dpkg-buildpackage -rfakeroot -us -uc
932 rm -rf $(top_stagedir)