2 # Automake file for Ethereal
4 # $Id: Makefile.am,v 1.377 2001/11/06 20:30:38 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 \
151 packet-isis-hello.c \
194 packet-osi-options.c \
207 packet-quakeworld.c \
232 packet-smb-browse.c \
233 packet-smb-common.c \
235 packet-smb-mailslot.c \
246 packet-stat-notify.c \
284 plugins/gryphon/packet-gryphon.c \
285 plugins/mgcp/packet-mgcp.c \
286 plugins/giop/packet-cosnaming.c \
287 plugins/giop/packet-coseventcomm.c
289 plugin_static_ldadd = \
290 plugins/gryphon/packet-gryphon-static.o \
291 plugins/mgcp/packet-mgcp-static.o \
292 plugins/giop/packet-cosnaming-static.o \
293 plugins/giop/packet-coseventcomm-static.o
296 plugins/gryphon/gryphon.la \
297 plugins/mgcp/mgcp.la \
298 plugins/giop/cosnaming.la \
299 plugins/giop/coseventcomm.la
303 "-dlopen" plugins/gryphon/gryphon.la \
304 "-dlopen" plugins/mgcp/mgcp.la \
305 "-dlopen" plugins/giop/cosnaming.la \
306 "-dlopen" plugins/giop/coseventcomm.la
310 plugin_static_ldadd =
319 packet-afs-macros.h \
320 packet-afs-register-info.h \
325 packet-bootparams.h \
330 packet-diameter-defs.h \
350 packet-isis-hello.h \
368 packet-osi-options.h \
383 packet-smb-browse.h \
384 packet-smb-common.h \
386 packet-smb-mailslot.h \
392 packet-stat-notify.h \
405 packet-x11-keysym.h \
412 ETHEREAL_COMMON_SRC = \
453 x11-register-info.h \
465 $(ETHEREAL_COMMON_SRC) \
484 ethereal_static_SOURCES = \
486 $(ETHEREAL_COMMON_SRC) \
505 EXTRA_ethereal_SOURCES = \
518 # Optional objects that I know how to build. These will be
519 # linked into the ethereal executable.
520 # They will also be linked into the tethereal executable; if this
521 # list ever grows to include something that can't be linked with
522 # tethereal, or if tethereal needs something that ethereal doesn't,
523 # we should probably split this into stuff needed both
524 # by ethereal and tethereal and stuff needed only by one or the
526 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ \
527 @STRCASECMP_O@ @STRNCASECMP_O@ @MKSTEMP_O@ @STRPTIME_O@
529 # Additional libs that I know how to build. These will be
530 # linked into the ethereal executable.
531 ethereal_additional_libs = \
532 wiretap/libwiretap.a \
535 epan/ftypes/libftypes.a \
536 epan/dfilter/libdfilter.a
538 # This is the automake dependency variable for the executable
539 ethereal_DEPENDENCIES = \
540 $(ethereal_optional_objects) \
541 $(ethereal_additional_libs) \
544 ethereal_static_DEPENDENCIES = \
545 $(ethereal_optional_objects) \
546 $(ethereal_additional_libs)
548 # This automake variable adds to the link-line for the executable.
550 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
551 # they are included in @GTK_LIBS@, and doesn't have to be linked with
552 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
553 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
554 # applications are X applications).
556 $(ethereal_optional_objects) \
557 $(ethereal_additional_libs) \
558 @SNMP_LIBS@ @SSL_LIBS@ \
560 @PCAP_LIBS@ @GTK_LIBS@
562 ethereal_static_LDADD = \
564 $(plugin_static_ldadd) \
565 $(ethereal_optional_objects) \
566 $(ethereal_additional_libs) \
567 @SNMP_LIBS@ @SSL_LIBS@ \
568 @PCAP_LIBS@ @GTK_LIBS@
570 ethereal_LDFLAGS = -export-dynamic
571 ethereal_static_LDFLAGS = -Wl,-static
573 tethereal_SOURCES = \
575 $(ETHEREAL_COMMON_SRC) \
579 tethereal_static_SOURCES = \
581 $(ETHEREAL_COMMON_SRC) \
585 # Additional libs that I know how to build. These will be
586 # linked into the tethereal executable.
587 tethereal_additional_libs = \
588 wiretap/libwiretap.a \
590 epan/ftypes/libftypes.a \
591 epan/dfilter/libdfilter.a
593 # This is the automake dependency variable for the executable
594 tethereal_DEPENDENCIES = \
595 $(ethereal_optional_objects) \
596 $(tethereal_additional_libs) \
599 tethereal_static_DEPENDENCIES = \
600 $(ethereal_optional_objects) \
601 $(tethereal_additional_libs)
603 # This automake variable adds to the link-line for the executable
604 tethereal_LDADD = wiretap/libwiretap.a \
605 $(ethereal_optional_objects) \
606 $(tethereal_additional_libs) \
607 @SNMP_LIBS@ @SSL_LIBS@ \
610 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
612 tethereal_static_LDADD = \
614 $(plugin_static_ldadd) \
615 wiretap/libwiretap.a \
616 $(ethereal_optional_objects) \
617 $(tethereal_additional_libs) \
618 @SNMP_LIBS@ @SSL_LIBS@ \
620 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
622 tethereal_LDFLAGS = -export-dynamic
623 tethereal_static_LDFLAGS = -Wl,-static
625 text2pcap_SOURCES = text2pcap.c text2pcap-scanner.l
626 text2pcap_DEPENDENCIES = text2pcap.h
628 mergecap_SOURCES = mergecap.c
629 mergecap_DEPENDENCIES = wiretap/libwiretap.a
631 editcap_SOURCES = editcap.c
633 # This is the automake dependency variable for the executable
634 editcap_DEPENDENCIES = wiretap/libwiretap.a
636 # This automake variable adds to the link-line for the executable
637 editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
638 mergecap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
641 # Build various header files for the X11 dissector.
643 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
644 $(PERL) $(srcdir)/process-x11-fields.pl <$(srcdir)/x11-fields
647 # Build shell scripts by doing variable substitution.
648 # Taken from autoconf 2.13.
650 editsh = sed -e 's,@''SHELL''@,$(SHELL),g'
655 $(editsh) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
658 # Build "register.c", which contains a function "register_all_protocols()"
659 # that calls the register routines for all protocols.
661 # We do this by grepping through sources. If that turns out to be too slow,
662 # maybe we could just require every .o file to have an register routine
663 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
665 # Formatting conventions: The name of the proto_register_* routines must
666 # start in column zero, or must be preceded only by "void " starting in
667 # column zero, and must not be inside #if.
669 # We assume that all dissector routines are in "packet-XXX.c" files.
671 # For some unknown reason, having a big "for" loop in the Makefile
672 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
673 # they seem to pass only the first few names in the list to the shell,
676 # Therefore, we have a script to generate the "register.c" file.
678 # The first argument is the directory in which the source files live.
679 # All subsequent arguments are the files to scan.
681 register.c: $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
682 @echo Making register.c
683 @$(srcdir)/make-reg-dotc register.c $(srcdir) $(DISSECTOR_SRC)
685 register-static.c: $(plugin_src) $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
686 @echo Making register-static.c
687 @$(srcdir)/make-reg-dotc register-static.c $(srcdir) $(plugin_src) $(DISSECTOR_SRC)
690 ./rdps $(srcdir)/print.ps ps.c
693 $(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
696 $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
698 randpkt: randpkt.o wiretap/libwiretap.a
699 $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
704 $(ETHEREAL_COMMON_SRC) \
708 dftest_additional_libs = \
710 epan/ftypes/libftypes.a \
711 epan/dfilter/libdfilter.a
713 dftest_DEPENDENCIES = \
714 $(ethereal_optional_objects) \
715 $(dftest_additional_libs) \
718 # This automake variable adds to the link-line for the executable
720 $(ethereal_optional_objects) \
721 $(dftest_additional_libs) \
722 @SNMP_LIBS@ @SSL_LIBS@ \
725 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
727 dftest_LDFLAGS = -export-dynamic
746 debian/README.debian \
759 doc/README.developer \
762 doc/README.regression \
766 doc/ethereal.pod.template \
770 doc/tethereal.pod.template \
778 text2pcap-scanner.l \
783 image/Makefile.nmake \
784 image/editcap.rc.in \
785 image/elogo3d48x48.png \
786 image/ethereal48x48-trans.png \
787 image/ethereal48x48.png \
789 image/ethereal.rc.in \
790 image/icon-excl.xpm \
791 image/icon-ethereal.xpm \
792 image/clist_ascend.xpm \
793 image/clist_descend.xpm \
794 image/mergecap.rc.in \
795 image/tethereal.rc.in \
796 image/text2pcap.rc.in \
807 process-x11-fields.pl \
828 -chmod +s $(DESTDIR)$(bindir)/ethereal
829 -chmod +s $(DESTDIR)$(bindir)/tethereal
830 -chmod +s $(DESTDIR)$(bindir)/ethereal_static
836 # Currently register.c can be included in the distribution because
837 # we always build all protocol dissectors. We used to have to check
838 # whether or not to build the snmp dissector. If we again need to
839 # variably build something, making register.c non-portable, uncomment
840 # the dist-hook line below.
842 # Oh, yuk. We don't want to include "register.c" in the distribution, as
843 # its contents depend on the configuration, and therefore we want it
844 # to be built when the first "make" is done; however, Automake insists
845 # on putting *all* source into the distribution.
847 # We work around this by having a "dist-hook" rule that deletes
848 # "register.c", so that "dist" won't pick it up.
851 # @rm -f $(distdir)/register.c
854 SUBDIRS = tools wiretap doc epan plugins packaging @ethereal_SUBDIRS@
856 SUBDIRS = tools wiretap doc epan packaging @ethereal_SUBDIRS@
859 ethereal.1: ethereal doc/ethereal.pod.template
861 $(MAKE) ../ethereal.1 )
863 tethereal.1: tethereal doc/tethereal.pod.template
865 $(MAKE) ../tethereal.1 )
867 editcap.1: doc/editcap.pod
869 $(MAKE) ../editcap.1 )
871 idl2eth.1: doc/idl2eth.pod
873 $(MAKE) ../idl2eth.1 )
875 mergecap.1: doc/mergecap.pod
877 $(MAKE) ../mergecap.1 )
879 text2pcap.1: doc/text2pcap.pod
881 $(MAKE) ../text2pcap.1 )
883 packet-ncp2222.c : ncp2222.py
884 $(PYTHON) $(srcdir)/ncp2222.py > $@
886 libtool: $(LIBTOOL_DEPS)
887 $(SHELL) ./config.status --recheck
889 # We load top_stagedir with an explicit path so that libtool doesn't freak.
890 top_stagedir=`cd $(top_srcdir) && pwd`/packaging/svr4.stage
891 stagedir=$(top_stagedir)/$(PACKAGE).stage
895 svr4-package: $(bin_SCRIPTS) $(lib_LTLIBRARIES)
896 if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
897 rm -rf $(stagedir) ; \
898 $(MAKE) DESTDIR=$(stagedir) install-strip; \
899 $(srcdir)/packaging/svr4/mkpkg \
901 $(PACKAGE)-$(VERSION)-$(host_os)-$(host_cpu)-local \
905 echo "Error: SVR4 packaging tools not found." ; \
906 echo "Package build abandoned." ; \
909 solaris-package: svr4-package
911 specfile=$(top_srcdir)/packaging/rpm/ethereal.spec
914 if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
915 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
916 rpm -bb --clean --rmsource $(specfile) ; \
918 echo "Error: RPM executable and/or source directory not found." ; \
919 echo "Package build abandoned." ; \
923 if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
924 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
925 rpm -bs --clean --rmsource $(specfile) ; \
927 echo "Error: RPM executable and/or source directory not found." ; \
928 echo "Package build abandoned." ; \
931 debian-package: debian/rules
932 dpkg-buildpackage -rfakeroot -us -uc
935 rm -rf $(top_stagedir)