2 # Automake file for Ethereal
4 # $Id: Makefile.am,v 1.372 2001/10/29 21:13:07 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 \
191 packet-osi-options.c \
203 packet-quakeworld.c \
228 packet-smb-browse.c \
229 packet-smb-common.c \
231 packet-smb-mailslot.c \
242 packet-stat-notify.c \
280 plugins/gryphon/packet-gryphon.c \
281 plugins/mgcp/packet-mgcp.c \
282 plugins/giop/packet-cosnaming.c \
283 plugins/giop/packet-coseventcomm.c
285 plugin_static_ldadd = \
286 plugins/gryphon/packet-gryphon-static.o \
287 plugins/mgcp/packet-mgcp-static.o \
288 plugins/giop/packet-cosnaming-static.o \
289 plugins/giop/packet-coseventcomm-static.o
292 plugins/gryphon/gryphon.la \
293 plugins/mgcp/mgcp.la \
294 plugins/giop/cosnaming.la \
295 plugins/giop/coseventcomm.la
299 "-dlopen" plugins/gryphon/gryphon.la \
300 "-dlopen" plugins/mgcp/mgcp.la \
301 "-dlopen" plugins/giop/cosnaming.la \
302 "-dlopen" plugins/giop/coseventcomm.la
306 plugin_static_ldadd =
315 packet-afs-macros.h \
316 packet-afs-register-info.h \
321 packet-bootparams.h \
326 packet-diameter-defs.h \
346 packet-isis-hello.h \
364 packet-osi-options.h \
379 packet-smb-browse.h \
380 packet-smb-common.h \
382 packet-smb-mailslot.h \
388 packet-stat-notify.h \
401 packet-x11-keysym.h \
408 ETHEREAL_COMMON_SRC = \
449 x11-register-info.h \
459 $(ETHEREAL_COMMON_SRC) \
478 ethereal_static_SOURCES = \
480 $(ETHEREAL_COMMON_SRC) \
499 EXTRA_ethereal_SOURCES = \
512 # Optional objects that I know how to build. These will be
513 # linked into the ethereal executable.
514 # They will also be linked into the tethereal executable; if this
515 # list ever grows to include something that can't be linked with
516 # tethereal, or if tethereal needs something that ethereal doesn't,
517 # we should probably split this into stuff needed both
518 # by ethereal and tethereal and stuff needed only by one or the
520 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ \
521 @STRCASECMP_O@ @STRNCASECMP_O@ @MKSTEMP_O@ @STRPTIME_O@
523 # Additional libs that I know how to build. These will be
524 # linked into the ethereal executable.
525 ethereal_additional_libs = \
526 wiretap/libwiretap.a \
529 epan/ftypes/libftypes.a \
530 epan/dfilter/libdfilter.a
532 # This is the automake dependency variable for the executable
533 ethereal_DEPENDENCIES = \
534 $(ethereal_optional_objects) \
535 $(ethereal_additional_libs) \
538 ethereal_static_DEPENDENCIES = \
539 $(ethereal_optional_objects) \
540 $(ethereal_additional_libs)
542 # This automake variable adds to the link-line for the executable.
544 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
545 # they are included in @GTK_LIBS@, and doesn't have to be linked with
546 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
547 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
548 # applications are X applications).
550 $(ethereal_optional_objects) \
551 $(ethereal_additional_libs) \
552 @SNMP_LIBS@ @SSL_LIBS@ \
554 @PCAP_LIBS@ @GTK_LIBS@
556 ethereal_static_LDADD = \
558 $(plugin_static_ldadd) \
559 $(ethereal_optional_objects) \
560 $(ethereal_additional_libs) \
561 @SNMP_LIBS@ @SSL_LIBS@ \
562 @PCAP_LIBS@ @GTK_LIBS@
564 ethereal_LDFLAGS = -export-dynamic
565 ethereal_static_LDFLAGS = -Wl,-static
567 tethereal_SOURCES = \
569 $(ETHEREAL_COMMON_SRC) \
573 tethereal_static_SOURCES = \
575 $(ETHEREAL_COMMON_SRC) \
579 # Additional libs that I know how to build. These will be
580 # linked into the tethereal executable.
581 tethereal_additional_libs = \
582 wiretap/libwiretap.a \
584 epan/ftypes/libftypes.a \
585 epan/dfilter/libdfilter.a
587 # This is the automake dependency variable for the executable
588 tethereal_DEPENDENCIES = \
589 $(ethereal_optional_objects) \
590 $(tethereal_additional_libs) \
593 tethereal_static_DEPENDENCIES = \
594 $(ethereal_optional_objects) \
595 $(tethereal_additional_libs)
597 # This automake variable adds to the link-line for the executable
598 tethereal_LDADD = wiretap/libwiretap.a \
599 $(ethereal_optional_objects) \
600 $(tethereal_additional_libs) \
601 @SNMP_LIBS@ @SSL_LIBS@ \
604 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
606 tethereal_static_LDADD = \
608 $(plugin_static_ldadd) \
609 wiretap/libwiretap.a \
610 $(ethereal_optional_objects) \
611 $(tethereal_additional_libs) \
612 @SNMP_LIBS@ @SSL_LIBS@ \
614 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
616 tethereal_LDFLAGS = -export-dynamic
617 tethereal_static_LDFLAGS = -Wl,-static
619 text2pcap_SOURCES = text2pcap.c text2pcap-scanner.l
620 text2pcap_DEPENDENCIES = text2pcap.h
622 mergecap_SOURCES = mergecap.c
623 mergecap_DEPENDENCIES = wiretap/libwiretap.a
625 editcap_SOURCES = editcap.c
627 # This is the automake dependency variable for the executable
628 editcap_DEPENDENCIES = wiretap/libwiretap.a
630 # This automake variable adds to the link-line for the executable
631 editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
632 mergecap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
635 # Build various header files for the X11 dissector.
637 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
638 $(PERL) $(srcdir)/process-x11-fields.pl <$(srcdir)/x11-fields
641 # Build shell scripts by doing variable substitution.
642 # Taken from autoconf 2.13.
644 editsh = sed -e 's,@''SHELL''@,$(SHELL),g'
649 $(editsh) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
652 # Build "register.c", which contains a function "register_all_protocols()"
653 # that calls the register routines for all protocols.
655 # We do this by grepping through sources. If that turns out to be too slow,
656 # maybe we could just require every .o file to have an register routine
657 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
659 # Formatting conventions: The name of the proto_register_* routines must
660 # start in column zero, or must be preceded only by "void " starting in
661 # column zero, and must not be inside #if.
663 # We assume that all dissector routines are in "packet-XXX.c" files.
665 # For some unknown reason, having a big "for" loop in the Makefile
666 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
667 # they seem to pass only the first few names in the list to the shell,
670 # Therefore, we have a script to generate the "register.c" file.
672 # The first argument is the directory in which the source files live.
673 # All subsequent arguments are the files to scan.
675 register.c: $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
676 @echo Making register.c
677 @$(srcdir)/make-reg-dotc register.c $(srcdir) $(DISSECTOR_SRC)
679 register-static.c: $(plugin_src) $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
680 @echo Making register-static.c
681 @$(srcdir)/make-reg-dotc register-static.c $(srcdir) $(plugin_src) $(DISSECTOR_SRC)
684 ./rdps $(srcdir)/print.ps ps.c
687 $(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
690 $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
692 randpkt: randpkt.o wiretap/libwiretap.a
693 $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
698 $(ETHEREAL_COMMON_SRC) \
702 dftest_additional_libs = \
704 epan/ftypes/libftypes.a \
705 epan/dfilter/libdfilter.a
707 dftest_DEPENDENCIES = \
708 $(ethereal_optional_objects) \
709 $(dftest_additional_libs) \
712 # This automake variable adds to the link-line for the executable
714 $(ethereal_optional_objects) \
715 $(dftest_additional_libs) \
716 @SNMP_LIBS@ @SSL_LIBS@ \
719 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
721 dftest_LDFLAGS = -export-dynamic
740 debian/README.debian \
753 doc/README.developer \
756 doc/README.regression \
760 doc/ethereal.pod.template \
764 doc/tethereal.pod.template \
772 text2pcap-scanner.l \
777 image/Makefile.nmake \
778 image/editcap.rc.in \
779 image/elogo3d48x48.png \
780 image/ethereal48x48-trans.png \
781 image/ethereal48x48.png \
783 image/ethereal.rc.in \
784 image/icon-excl.xpm \
785 image/icon-ethereal.xpm \
786 image/mergecap.rc.in \
787 image/tethereal.rc.in \
788 image/text2pcap.rc.in \
799 process-x11-fields.pl \
815 -chmod +s $(DESTDIR)$(bindir)/ethereal
816 -chmod +s $(DESTDIR)$(bindir)/tethereal
817 -chmod +s $(DESTDIR)$(bindir)/ethereal_static
823 # Currently register.c can be included in the distribution because
824 # we always build all protocol dissectors. We used to have to check
825 # whether or not to build the snmp dissector. If we again need to
826 # variably build something, making register.c non-portable, uncomment
827 # the dist-hook line below.
829 # Oh, yuk. We don't want to include "register.c" in the distribution, as
830 # its contents depend on the configuration, and therefore we want it
831 # to be built when the first "make" is done; however, Automake insists
832 # on putting *all* source into the distribution.
834 # We work around this by having a "dist-hook" rule that deletes
835 # "register.c", so that "dist" won't pick it up.
838 # @rm -f $(distdir)/register.c
841 SUBDIRS = tools wiretap doc epan plugins packaging @ethereal_SUBDIRS@
843 SUBDIRS = tools wiretap doc epan packaging @ethereal_SUBDIRS@
846 ethereal.1: ethereal doc/ethereal.pod.template
848 $(MAKE) ../ethereal.1 )
850 tethereal.1: tethereal doc/tethereal.pod.template
852 $(MAKE) ../tethereal.1 )
854 editcap.1: doc/editcap.pod
856 $(MAKE) ../editcap.1 )
858 idl2eth.1: doc/idl2eth.pod
860 $(MAKE) ../idl2eth.1 )
862 mergecap.1: doc/mergecap.pod
864 $(MAKE) ../mergecap.1 )
866 text2pcap.1: doc/text2pcap.pod
868 $(MAKE) ../text2pcap.1 )
870 packet-ncp2222.c : ncp2222.py
871 $(PYTHON) $(srcdir)/ncp2222.py > $@
873 libtool: $(LIBTOOL_DEPS)
874 $(SHELL) ./config.status --recheck
876 # We load top_stagedir with an explicit path so that libtool doesn't freak.
877 top_stagedir=`cd $(top_srcdir) && pwd`/packaging/svr4.stage
878 stagedir=$(top_stagedir)/$(PACKAGE).stage
882 svr4-package: $(bin_SCRIPTS) $(lib_LTLIBRARIES)
883 if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
884 rm -rf $(stagedir) ; \
885 $(MAKE) DESTDIR=$(stagedir) install-strip; \
886 $(srcdir)/packaging/svr4/mkpkg \
888 $(PACKAGE)-$(VERSION)-$(host_os)-$(host_cpu)-local \
892 echo "Error: SVR4 packaging tools not found." ; \
893 echo "Package build abandoned." ; \
896 solaris-package: svr4-package
898 specfile=$(top_srcdir)/packaging/rpm/ethereal.spec
901 if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
902 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
903 rpm -bb --clean --rmsource $(specfile) ; \
905 echo "Error: RPM executable and/or source directory not found." ; \
906 echo "Package build abandoned." ; \
910 if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
911 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
912 rpm -bs --clean --rmsource $(specfile) ; \
914 echo "Error: RPM executable and/or source directory not found." ; \
915 echo "Package build abandoned." ; \
918 debian-package: debian/rules
919 dpkg-buildpackage -rfakeroot -us -uc
922 rm -rf $(top_stagedir)