2 # Automake file for Ethereal
4 # $Id: Makefile.am,v 1.414 2002/03/04 22:39:21 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
101 packet-dcerpc-conv.c \
102 packet-dcerpc-dfs.c \
103 packet-dcerpc-epm.c \
104 packet-dcerpc-lsa.c \
105 packet-dcerpc-mgmt.c \
106 packet-dcerpc-ndr.c \
107 packet-dcerpc-netlogon.c \
108 packet-dcerpc-oxid.c \
109 packet-dcerpc-reg.c \
110 packet-dcerpc-remact.c \
111 packet-dcerpc-samr.c \
112 packet-dcerpc-spoolss.c \
113 packet-dcerpc-srvsvc.c \
114 packet-dcerpc-wkssvc.c \
164 packet-isis-hello.c \
210 packet-osi-options.c \
226 packet-quakeworld.c \
254 packet-smb-browse.c \
255 packet-smb-common.c \
257 packet-smb-mailslot.c \
270 packet-stat-notify.c \
310 plugins/gryphon/packet-gryphon.c \
311 plugins/mgcp/packet-mgcp.c \
312 plugins/giop/packet-cosnaming.c \
313 plugins/giop/packet-coseventcomm.c
315 plugin_static_ldadd = \
316 plugins/gryphon/packet-gryphon-static.o \
317 plugins/mgcp/packet-mgcp-static.o \
318 plugins/giop/packet-cosnaming-static.o \
319 plugins/giop/packet-coseventcomm-static.o
322 plugins/gryphon/gryphon.la \
323 plugins/mgcp/mgcp.la \
324 plugins/giop/cosnaming.la \
325 plugins/giop/coseventcomm.la
329 "-dlopen" plugins/gryphon/gryphon.la \
330 "-dlopen" plugins/mgcp/mgcp.la \
331 "-dlopen" plugins/giop/cosnaming.la \
332 "-dlopen" plugins/giop/coseventcomm.la
336 plugin_static_ldadd =
345 packet-afs-macros.h \
346 packet-afs-register-info.h \
351 packet-bootparams.h \
355 packet-dcerpc-dfs.h \
356 packet-dcerpc-lsa.h \
357 packet-dcerpc-netlogon.h \
358 packet-dcerpc-reg.h \
359 packet-dcerpc-samr.h \
360 packet-dcerpc-spoolss.h \
361 packet-dcerpc-srvsvc.h \
362 packet-dcerpc-wkssvc.h \
364 packet-diameter-defs.h \
384 packet-isis-hello.h \
403 packet-osi-options.h \
422 packet-smb-browse.h \
423 packet-smb-common.h \
425 packet-smb-mailslot.h \
431 packet-stat-notify.h \
444 packet-x11-keysym.h \
451 ETHEREAL_COMMON_SRC = \
464 capture_stop_conditions.h \
465 capture_stop_conditions.c \
501 x11-register-info.h \
514 $(ETHEREAL_COMMON_SRC) \
533 ethereal_static_SOURCES = \
535 $(ETHEREAL_COMMON_SRC) \
554 EXTRA_ethereal_SOURCES = \
567 # Optional objects that I know how to build. These will be
568 # linked into the ethereal executable.
569 # They will also be linked into the tethereal executable; if this
570 # list ever grows to include something that can't be linked with
571 # tethereal, or if tethereal needs something that ethereal doesn't,
572 # we should probably split this into stuff needed both
573 # by ethereal and tethereal and stuff needed only by one or the
575 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ \
576 @STRCASECMP_O@ @STRNCASECMP_O@ @MKSTEMP_O@ @STRPTIME_O@
578 # Additional libs that I know how to build. These will be
579 # linked into the ethereal executable.
580 ethereal_additional_libs = \
581 wiretap/libwiretap.a \
584 epan/ftypes/libftypes.a \
585 epan/dfilter/libdfilter.a
587 # This is the automake dependency variable for the executable
588 ethereal_DEPENDENCIES = \
589 $(ethereal_optional_objects) \
590 $(ethereal_additional_libs) \
593 ethereal_static_DEPENDENCIES = \
594 $(ethereal_optional_objects) \
595 $(ethereal_additional_libs)
597 # This automake variable adds to the link-line for the executable.
599 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
600 # they are included in @GTK_LIBS@, and doesn't have to be linked with
601 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
602 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
603 # applications are X applications).
605 $(ethereal_optional_objects) \
606 $(ethereal_additional_libs) \
607 @SNMP_LIBS@ @SSL_LIBS@ \
609 @PCAP_LIBS@ @GTK_LIBS@
611 ethereal_static_LDADD = \
613 $(plugin_static_ldadd) \
614 $(ethereal_optional_objects) \
615 $(ethereal_additional_libs) \
616 @SNMP_LIBS@ @SSL_LIBS@ \
617 @PCAP_LIBS@ @GTK_LIBS@
619 ethereal_LDFLAGS = -export-dynamic
620 ethereal_static_LDFLAGS = -Wl,-static
622 tethereal_SOURCES = \
624 $(ETHEREAL_COMMON_SRC) \
628 tethereal_static_SOURCES = \
630 $(ETHEREAL_COMMON_SRC) \
634 # Additional libs that I know how to build. These will be
635 # linked into the tethereal executable.
636 tethereal_additional_libs = \
637 wiretap/libwiretap.a \
639 epan/ftypes/libftypes.a \
640 epan/dfilter/libdfilter.a
642 # This is the automake dependency variable for the executable
643 tethereal_DEPENDENCIES = \
644 $(ethereal_optional_objects) \
645 $(tethereal_additional_libs) \
648 tethereal_static_DEPENDENCIES = \
649 $(ethereal_optional_objects) \
650 $(tethereal_additional_libs)
652 # This automake variable adds to the link-line for the executable
653 tethereal_LDADD = wiretap/libwiretap.a \
654 $(ethereal_optional_objects) \
655 $(tethereal_additional_libs) \
656 @SNMP_LIBS@ @SSL_LIBS@ \
659 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
661 tethereal_static_LDADD = \
663 $(plugin_static_ldadd) \
664 wiretap/libwiretap.a \
665 $(ethereal_optional_objects) \
666 $(tethereal_additional_libs) \
667 @SNMP_LIBS@ @SSL_LIBS@ \
669 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
671 tethereal_LDFLAGS = -export-dynamic
672 tethereal_static_LDFLAGS = -Wl,-static
674 # Optional objects that I know how to build, and that are needed by
676 text2pcap_optional_objects = @STRERROR_O@ @STRPTIME_O@
678 text2pcap_SOURCES = text2pcap.c text2pcap-scanner.l
679 text2pcap_DEPENDENCIES = text2pcap.h
681 # This automake variable adds to the link-line for the executable
682 text2pcap_LDADD = $(text2pcap_optional_objects)
684 mergecap_SOURCES = mergecap.c
685 mergecap_DEPENDENCIES = wiretap/libwiretap.a
687 editcap_SOURCES = editcap.c
689 # This is the automake dependency variable for the executable
690 editcap_DEPENDENCIES = wiretap/libwiretap.a
692 # This automake variable adds to the link-line for the executable
693 editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
694 mergecap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
697 # Build various header files for the X11 dissector.
699 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
700 $(PERL) $(srcdir)/process-x11-fields.pl <$(srcdir)/x11-fields
703 # Build shell scripts by doing variable substitution.
704 # Taken from autoconf 2.13.
706 editsh = sed -e 's,@''SHELL''@,$(SHELL),g'
711 $(editsh) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
714 # Build "register.c", which contains a function "register_all_protocols()"
715 # that calls the register routines for all protocols.
717 # We do this by grepping through sources. If that turns out to be too slow,
718 # maybe we could just require every .o file to have an register routine
719 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
721 # Formatting conventions: The name of the proto_register_* routines must
722 # start in column zero, or must be preceded only by "void " starting in
723 # column zero, and must not be inside #if.
725 # We assume that all dissector routines are in "packet-XXX.c" files.
727 # For some unknown reason, having a big "for" loop in the Makefile
728 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
729 # they seem to pass only the first few names in the list to the shell,
732 # Therefore, we have a script to generate the "register.c" file.
734 # The first argument is the directory in which the source files live.
735 # All subsequent arguments are the files to scan.
737 register.c: $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
738 @echo Making register.c
739 @$(srcdir)/make-reg-dotc register.c $(srcdir) $(DISSECTOR_SRC)
741 register-static.c: $(plugin_src) $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
742 @echo Making register-static.c
743 @$(srcdir)/make-reg-dotc register-static.c $(srcdir) $(plugin_src) $(DISSECTOR_SRC)
746 ./rdps $(srcdir)/print.ps ps.c
749 $(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
752 $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
754 randpkt: randpkt.o wiretap/libwiretap.a
755 $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
760 $(ETHEREAL_COMMON_SRC) \
764 dftest_additional_libs = \
765 wiretap/libwiretap.a \
767 epan/ftypes/libftypes.a \
768 epan/dfilter/libdfilter.a
770 dftest_DEPENDENCIES = \
771 $(ethereal_optional_objects) \
772 $(dftest_additional_libs) \
775 # This automake variable adds to the link-line for the executable
777 $(ethereal_optional_objects) \
778 $(dftest_additional_libs) \
779 @SNMP_LIBS@ @SSL_LIBS@ \
782 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
784 dftest_LDFLAGS = -export-dynamic
804 debian/README.debian \
817 doc/README.developer \
820 doc/README.regression \
824 doc/ethereal.pod.template \
828 doc/tethereal.pod.template \
836 text2pcap-scanner.l \
841 image/Makefile.nmake \
843 image/clist_ascend.xpm \
844 image/clist_descend.xpm \
846 image/editcap.rc.in \
847 image/eexcl3d64.xpm \
848 image/eicon3d16.xpm \
849 image/eicon3d32.xpm \
850 image/eicon3d48.xpm \
851 image/eicon3d64.xpm \
852 image/elogo3d48x48.png \
854 image/ethereal.rc.in \
855 image/ethereal48x48-trans.png \
856 image/ethereal48x48.png \
857 image/hi16-app-ethereal.png \
858 image/hi32-app-ethereal.png \
859 image/hi48-app-ethereal.png \
860 image/icon-ethereal.xpm \
861 image/icon-excl.xpm \
862 image/lo16-app-ethereal.png \
863 image/lo32-app-ethereal.png \
864 image/lo48-app-ethereal.png \
865 image/mergecap.rc.in \
866 image/tethereal.rc.in \
867 image/text2pcap.rc.in \
879 process-x11-fields.pl \
900 -chmod +s $(DESTDIR)$(bindir)/ethereal
901 -chmod +s $(DESTDIR)$(bindir)/tethereal
902 -chmod +s $(DESTDIR)$(bindir)/ethereal_static
908 # Currently register.c can be included in the distribution because
909 # we always build all protocol dissectors. We used to have to check
910 # whether or not to build the snmp dissector. If we again need to
911 # variably build something, making register.c non-portable, uncomment
912 # the dist-hook line below.
914 # Oh, yuk. We don't want to include "register.c" in the distribution, as
915 # its contents depend on the configuration, and therefore we want it
916 # to be built when the first "make" is done; however, Automake insists
917 # on putting *all* source into the distribution.
919 # We work around this by having a "dist-hook" rule that deletes
920 # "register.c", so that "dist" won't pick it up.
923 # @rm -f $(distdir)/register.c
926 SUBDIRS = tools wiretap doc epan plugins packaging @ethereal_SUBDIRS@
928 SUBDIRS = tools wiretap doc epan packaging @ethereal_SUBDIRS@
931 ethereal.1: ethereal doc/ethereal.pod.template
933 $(MAKE) ../ethereal.1 )
935 tethereal.1: tethereal doc/tethereal.pod.template
937 $(MAKE) ../tethereal.1 )
939 editcap.1: doc/editcap.pod
941 $(MAKE) ../editcap.1 )
943 idl2eth.1: doc/idl2eth.pod
945 $(MAKE) ../idl2eth.1 )
947 mergecap.1: doc/mergecap.pod
949 $(MAKE) ../mergecap.1 )
951 text2pcap.1: doc/text2pcap.pod
953 $(MAKE) ../text2pcap.1 )
955 packet-ncp2222.c : ncp2222.py
956 $(PYTHON) $(srcdir)/ncp2222.py > $@
958 libtool: $(LIBTOOL_DEPS)
959 $(SHELL) ./config.status --recheck
961 # We load top_stagedir with an explicit path so that libtool doesn't freak.
962 top_stagedir=`cd $(top_srcdir) && pwd`/packaging/svr4.stage
963 stagedir=$(top_stagedir)/$(PACKAGE).stage
967 svr4-package: $(bin_SCRIPTS) $(lib_LTLIBRARIES)
968 if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
969 rm -rf $(stagedir) ; \
970 $(MAKE) DESTDIR=$(stagedir) install-strip; \
971 $(srcdir)/packaging/svr4/mkpkg \
973 $(PACKAGE)-$(VERSION)-$(host_os)-$(host_cpu)-local \
977 echo "Error: SVR4 packaging tools not found." ; \
978 echo "Package build abandoned." ; \
981 solaris-package: svr4-package
983 rpm_topdir=`cd $(top_srcdir) && pwd`/packaging/rpm
985 if test x$(HAVE_RPM) = xyes ; then \
987 mkdir BUILD RPMS SOURCES ; \
989 ln -s ../../../$(distdir).tar.gz ; \
991 rpm --define "_topdir `cd . && pwd`" -bb SPECS/ethereal.spec && \
992 echo "Package successfully built in `pwd`/RPMS." ; \
994 echo "Error: RPM executable and/or source directory not found." ; \
997 if test x$(HAVE_RPM) = xyes ; then \
999 mkdir BUILD SRPMS SOURCES ; \
1001 ln -s ../../../$(distdir).tar.gz ; \
1003 rpm --define "_topdir `cd . && pwd`" -bs SPECS/ethereal.spec && \
1004 echo "Package successfully built in `pwd`/SRPMS." ; \
1006 echo "Error: RPM executable and/or source directory not found." ; \
1009 debian-package: debian/rules
1010 dpkg-buildpackage -rfakeroot -us -uc
1013 rm -rf $(top_stagedir)