2 # Automake file for Ethereal
4 # $Id: Makefile.am,v 1.366 2001/09/15 23:01:12 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
99 packet-dcerpc-conv.c \
100 packet-dcerpc-epm.c \
101 packet-dcerpc-mgmt.c \
102 packet-dcerpc-remact.c \
103 packet-dcerpc-oxid.c \
148 packet-isis-hello.c \
190 packet-osi-options.c \
202 packet-quakeworld.c \
226 packet-smb-browse.c \
227 packet-smb-common.c \
229 packet-smb-mailslot.c \
240 packet-stat-notify.c \
277 plugins/gryphon/packet-gryphon.c \
278 plugins/mgcp/packet-mgcp.c \
279 plugins/giop/packet-cosnaming.c \
280 plugins/giop/packet-coseventcomm.c
282 plugin_static_ldadd = \
283 plugins/gryphon/packet-gryphon-static.o \
284 plugins/mgcp/packet-mgcp-static.o \
285 plugins/giop/packet-cosnaming-static.o \
286 plugins/giop/packet-coseventcomm-static.o
289 plugins/gryphon/gryphon.la \
290 plugins/mgcp/mgcp.la \
291 plugins/giop/cosnaming.la \
292 plugins/giop/coseventcomm.la
296 "-dlopen" plugins/gryphon/gryphon.la \
297 "-dlopen" plugins/mgcp/mgcp.la \
298 "-dlopen" plugins/giop/cosnaming.la \
299 "-dlopen" plugins/giop/coseventcomm.la
303 plugin_static_ldadd =
312 packet-afs-macros.h \
313 packet-afs-register-info.h \
318 packet-bootparams.h \
323 packet-diameter-defs.h \
343 packet-isis-hello.h \
361 packet-osi-options.h \
377 packet-smb-browse.h \
378 packet-smb-common.h \
380 packet-smb-mailslot.h \
386 packet-stat-notify.h \
399 packet-x11-keysym.h \
406 ETHEREAL_COMMON_SRC = \
445 x11-register-info.h \
455 $(ETHEREAL_COMMON_SRC) \
474 ethereal_static_SOURCES = \
476 $(ETHEREAL_COMMON_SRC) \
495 EXTRA_ethereal_SOURCES = \
508 # Optional objects that I know how to build. These will be
509 # linked into the ethereal executable.
510 # They will also be linked into the tethereal executable; if this
511 # list ever grows to include something that can't be linked with
512 # tethereal, or if tethereal needs something that ethereal doesn't,
513 # we should probably split this into stuff needed both
514 # by ethereal and tethereal and stuff needed only by one or the
516 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ \
517 @STRCASECMP_O@ @STRNCASECMP_O@ @MKSTEMP_O@ @STRPTIME_O@
519 # Additional libs that I know how to build. These will be
520 # linked into the ethereal executable.
521 ethereal_additional_libs = \
522 wiretap/libwiretap.a \
525 epan/ftypes/libftypes.a \
526 epan/dfilter/libdfilter.a
528 # This is the automake dependency variable for the executable
529 ethereal_DEPENDENCIES = \
530 $(ethereal_optional_objects) \
531 $(ethereal_additional_libs) \
534 ethereal_static_DEPENDENCIES = \
535 $(ethereal_optional_objects) \
536 $(ethereal_additional_libs)
538 # This automake variable adds to the link-line for the executable.
540 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
541 # they are included in @GTK_LIBS@, and doesn't have to be linked with
542 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
543 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
544 # applications are X applications).
546 $(ethereal_optional_objects) \
547 $(ethereal_additional_libs) \
548 @SNMP_LIBS@ @SSL_LIBS@ \
550 @PCAP_LIBS@ @GTK_LIBS@
552 ethereal_static_LDADD = \
554 $(plugin_static_ldadd) \
555 $(ethereal_optional_objects) \
556 $(ethereal_additional_libs) \
557 @SNMP_LIBS@ @SSL_LIBS@ \
558 @PCAP_LIBS@ @GTK_LIBS@
560 ethereal_LDFLAGS = -export-dynamic
561 ethereal_static_LDFLAGS = -Wl,-static
563 tethereal_SOURCES = \
565 $(ETHEREAL_COMMON_SRC) \
569 tethereal_static_SOURCES = \
571 $(ETHEREAL_COMMON_SRC) \
575 # Additional libs that I know how to build. These will be
576 # linked into the tethereal executable.
577 tethereal_additional_libs = \
578 wiretap/libwiretap.a \
580 epan/ftypes/libftypes.a \
581 epan/dfilter/libdfilter.a
583 # This is the automake dependency variable for the executable
584 tethereal_DEPENDENCIES = \
585 $(ethereal_optional_objects) \
586 $(tethereal_additional_libs) \
589 tethereal_static_DEPENDENCIES = \
590 $(ethereal_optional_objects) \
591 $(tethereal_additional_libs)
593 # This automake variable adds to the link-line for the executable
594 tethereal_LDADD = wiretap/libwiretap.a \
595 $(ethereal_optional_objects) \
596 $(tethereal_additional_libs) \
597 @SNMP_LIBS@ @SSL_LIBS@ \
600 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
602 tethereal_static_LDADD = \
604 $(plugin_static_ldadd) \
605 wiretap/libwiretap.a \
606 $(ethereal_optional_objects) \
607 $(tethereal_additional_libs) \
608 @SNMP_LIBS@ @SSL_LIBS@ \
610 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
612 tethereal_LDFLAGS = -export-dynamic
613 tethereal_static_LDFLAGS = -Wl,-static
615 text2pcap_SOURCES = text2pcap.c text2pcap-scanner.l
616 text2pcap_DEPENDENCIES = text2pcap.h
618 mergecap_SOURCES = mergecap.c
619 mergecap_DEPENDENCIES = wiretap/libwiretap.a
621 editcap_SOURCES = editcap.c
623 # This is the automake dependency variable for the executable
624 editcap_DEPENDENCIES = wiretap/libwiretap.a
626 # This automake variable adds to the link-line for the executable
627 editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
628 mergecap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
631 # Build various header files for the X11 dissector.
633 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
634 $(PERL) $(srcdir)/process-x11-fields.pl <$(srcdir)/x11-fields
637 # Build shell scripts by doing variable substitution.
638 # Taken from autoconf 2.13.
640 editsh = sed -e 's,@''SHELL''@,$(SHELL),g'
645 $(editsh) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
648 # Build "register.c", which contains a function "register_all_protocols()"
649 # that calls the register routines for all protocols.
651 # We do this by grepping through sources. If that turns out to be too slow,
652 # maybe we could just require every .o file to have an register routine
653 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
655 # Formatting conventions: The name of the proto_register_* routines must
656 # start in column zero, or must be preceded only by "void " starting in
657 # column zero, and must not be inside #if.
659 # We assume that all dissector routines are in "packet-XXX.c" files.
661 # For some unknown reason, having a big "for" loop in the Makefile
662 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
663 # they seem to pass only the first few names in the list to the shell,
666 # Therefore, we have a script to generate the "register.c" file.
668 # The first argument is the directory in which the source files live.
669 # All subsequent arguments are the files to scan.
671 register.c: $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
672 @echo Making register.c
673 @$(srcdir)/make-reg-dotc register.c $(srcdir) $(DISSECTOR_SRC)
675 register-static.c: $(plugin_src) $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
676 @echo Making register-static.c
677 @$(srcdir)/make-reg-dotc register-static.c $(srcdir) $(plugin_src) $(DISSECTOR_SRC)
680 ./rdps $(srcdir)/print.ps ps.c
683 $(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
686 $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
688 randpkt: randpkt.o wiretap/libwiretap.a
689 $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
694 $(ETHEREAL_COMMON_SRC) \
698 dftest_additional_libs = \
700 epan/ftypes/libftypes.a \
701 epan/dfilter/libdfilter.a
703 dftest_DEPENDENCIES = \
704 $(ethereal_optional_objects) \
705 $(dftest_additional_libs) \
708 # This automake variable adds to the link-line for the executable
710 $(ethereal_optional_objects) \
711 $(dftest_additional_libs) \
712 @SNMP_LIBS@ @SSL_LIBS@ \
715 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
717 dftest_LDFLAGS = -export-dynamic
736 debian/README.debian \
749 doc/README.developer \
752 doc/README.regression \
756 doc/ethereal.pod.template \
760 doc/tethereal.pod.template \
768 text2pcap-scanner.l \
773 image/Makefile.nmake \
774 image/editcap.rc.in \
775 image/elogo3d48x48.png \
776 image/ethereal48x48-trans.png \
777 image/ethereal48x48.png \
779 image/ethereal.rc.in \
780 image/icon-excl.xpm \
781 image/icon-ethereal.xpm \
782 image/mergecap.rc.in \
783 image/tethereal.rc.in \
784 image/text2pcap.rc.in \
793 process-x11-fields.pl \
809 -chmod +s $(DESTDIR)$(bindir)/ethereal
810 -chmod +s $(DESTDIR)$(bindir)/tethereal
811 -chmod +s $(DESTDIR)$(bindir)/ethereal_static
817 # Currently register.c can be included in the distribution because
818 # we always build all protocol dissectors. We used to have to check
819 # whether or not to build the snmp dissector. If we again need to
820 # variably build something, making register.c non-portable, uncomment
821 # the dist-hook line below.
823 # Oh, yuk. We don't want to include "register.c" in the distribution, as
824 # its contents depend on the configuration, and therefore we want it
825 # to be built when the first "make" is done; however, Automake insists
826 # on putting *all* source into the distribution.
828 # We work around this by having a "dist-hook" rule that deletes
829 # "register.c", so that "dist" won't pick it up.
832 # @rm -f $(distdir)/register.c
835 SUBDIRS = tools wiretap doc epan plugins packaging @ethereal_SUBDIRS@
837 SUBDIRS = tools wiretap doc epan packaging @ethereal_SUBDIRS@
840 ethereal.1: ethereal doc/ethereal.pod.template
842 $(MAKE) ../ethereal.1 )
844 tethereal.1: tethereal doc/tethereal.pod.template
846 $(MAKE) ../tethereal.1 )
848 editcap.1: doc/editcap.pod
850 $(MAKE) ../editcap.1 )
852 idl2eth.1: doc/idl2eth.pod
854 $(MAKE) ../idl2eth.1 )
856 mergecap.1: doc/mergecap.pod
858 $(MAKE) ../mergecap.1 )
860 text2pcap.1: doc/text2pcap.pod
862 $(MAKE) ../text2pcap.1 )
864 packet-ncp2222.c : ncp2222.py
865 $(PYTHON) $(srcdir)/ncp2222.py > $@
867 libtool: $(LIBTOOL_DEPS)
868 $(SHELL) ./config.status --recheck
870 # We load top_stagedir with an explicit path so that libtool doesn't freak.
871 top_stagedir=`cd $(top_srcdir) && pwd`/packaging/svr4.stage
872 stagedir=$(top_stagedir)/$(PACKAGE).stage
876 svr4-package: $(bin_SCRIPTS) $(lib_LTLIBRARIES)
877 if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
878 rm -rf $(stagedir) ; \
879 $(MAKE) DESTDIR=$(stagedir) install-strip; \
880 $(srcdir)/packaging/svr4/mkpkg \
882 $(PACKAGE)-$(VERSION)-$(host_os)-$(host_cpu)-local \
886 echo "Error: SVR4 packaging tools not found." ; \
887 echo "Package build abandoned." ; \
890 solaris-package: svr4-package
892 specfile=$(top_srcdir)/packaging/rpm/ethereal.spec
895 if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
896 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
897 rpm -bb --clean --rmsource $(specfile) ; \
899 echo "Error: RPM executable and/or source directory not found." ; \
900 echo "Package build abandoned." ; \
904 if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
905 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
906 rpm -bs --clean --rmsource $(specfile) ; \
908 echo "Error: RPM executable and/or source directory not found." ; \
909 echo "Package build abandoned." ; \
912 debian-package: debian/rules
913 dpkg-buildpackage -rfakeroot -us -uc
916 rm -rf $(top_stagedir)