2 # Automake file for Ethereal
4 # $Id: Makefile.am,v 1.425 2002/04/25 23:58:02 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
103 packet-dcerpc-conv.c \
104 packet-dcerpc-dfs.c \
105 packet-dcerpc-epm.c \
106 packet-dcerpc-lsa.c \
107 packet-dcerpc-mgmt.c \
108 packet-dcerpc-ndr.c \
109 packet-dcerpc-netlogon.c \
111 packet-dcerpc-oxid.c \
112 packet-dcerpc-reg.c \
113 packet-dcerpc-remact.c \
114 packet-dcerpc-samr.c \
115 packet-dcerpc-spoolss.c \
116 packet-dcerpc-srvsvc.c \
117 packet-dcerpc-wkssvc.c \
167 packet-isis-hello.c \
215 packet-osi-options.c \
231 packet-quakeworld.c \
259 packet-smb-browse.c \
260 packet-smb-common.c \
262 packet-smb-mailslot.c \
275 packet-stat-notify.c \
316 plugins/gryphon/packet-gryphon.c \
317 plugins/mgcp/packet-mgcp.c \
318 plugins/giop/packet-cosnaming.c \
319 plugins/giop/packet-coseventcomm.c
321 plugin_static_ldadd = \
322 plugins/gryphon/packet-gryphon-static.o \
323 plugins/mgcp/packet-mgcp-static.o \
324 plugins/giop/packet-cosnaming-static.o \
325 plugins/giop/packet-coseventcomm-static.o
328 plugins/gryphon/gryphon.la \
329 plugins/mgcp/mgcp.la \
330 plugins/giop/cosnaming.la \
331 plugins/giop/coseventcomm.la
335 "-dlopen" plugins/gryphon/gryphon.la \
336 "-dlopen" plugins/mgcp/mgcp.la \
337 "-dlopen" plugins/giop/cosnaming.la \
338 "-dlopen" plugins/giop/coseventcomm.la
342 plugin_static_ldadd =
352 packet-afs-macros.h \
353 packet-afs-register-info.h \
358 packet-bootparams.h \
362 packet-dcerpc-dfs.h \
363 packet-dcerpc-lsa.h \
364 packet-dcerpc-netlogon.h \
366 packet-dcerpc-reg.h \
367 packet-dcerpc-samr.h \
368 packet-dcerpc-spoolss.h \
369 packet-dcerpc-srvsvc.h \
370 packet-dcerpc-wkssvc.h \
372 packet-diameter-defs.h \
392 packet-isis-hello.h \
411 packet-osi-options.h \
430 packet-smb-browse.h \
431 packet-smb-common.h \
433 packet-smb-mailslot.h \
439 packet-stat-notify.h \
452 packet-x11-keysym.h \
459 ETHEREAL_COMMON_SRC = \
472 capture_stop_conditions.h \
473 capture_stop_conditions.c \
508 x11-register-info.h \
521 $(ETHEREAL_COMMON_SRC) \
540 ethereal_static_SOURCES = \
542 $(ETHEREAL_COMMON_SRC) \
561 EXTRA_ethereal_SOURCES = \
574 # Optional objects that I know how to build. These will be
575 # linked into the ethereal executable.
576 # They will also be linked into the tethereal executable; if this
577 # list ever grows to include something that can't be linked with
578 # tethereal, or if tethereal needs something that ethereal doesn't,
579 # we should probably split this into stuff needed both
580 # by ethereal and tethereal and stuff needed only by one or the
582 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ \
583 @STRCASECMP_O@ @STRNCASECMP_O@ @MKSTEMP_O@ @STRPTIME_O@
585 # Additional libs that I know how to build. These will be
586 # linked into the ethereal executable.
587 ethereal_additional_libs = \
588 wiretap/libwiretap.a \
591 epan/ftypes/libftypes.a \
592 epan/dfilter/libdfilter.a
594 # This is the automake dependency variable for the executable
595 ethereal_DEPENDENCIES = \
596 $(ethereal_optional_objects) \
597 $(ethereal_additional_libs) \
600 ethereal_static_DEPENDENCIES = \
601 $(ethereal_optional_objects) \
602 $(ethereal_additional_libs)
604 # This automake variable adds to the link-line for the executable.
606 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
607 # they are included in @GTK_LIBS@, and doesn't have to be linked with
608 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
609 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
610 # applications are X applications).
612 $(ethereal_optional_objects) \
613 $(ethereal_additional_libs) \
614 @SNMP_LIBS@ @SSL_LIBS@ \
616 @PCAP_LIBS@ @GTK_LIBS@
618 ethereal_static_LDADD = \
620 $(plugin_static_ldadd) \
621 $(ethereal_optional_objects) \
622 $(ethereal_additional_libs) \
623 @SNMP_LIBS@ @SSL_LIBS@ \
624 @PCAP_LIBS@ @GTK_LIBS@
626 ethereal_LDFLAGS = -export-dynamic
627 ethereal_static_LDFLAGS = -Wl,-static
629 tethereal_SOURCES = \
631 $(ETHEREAL_COMMON_SRC) \
635 tethereal_static_SOURCES = \
637 $(ETHEREAL_COMMON_SRC) \
641 # Additional libs that I know how to build. These will be
642 # linked into the tethereal executable.
643 tethereal_additional_libs = \
644 wiretap/libwiretap.a \
646 epan/ftypes/libftypes.a \
647 epan/dfilter/libdfilter.a
649 # This is the automake dependency variable for the executable
650 tethereal_DEPENDENCIES = \
651 $(ethereal_optional_objects) \
652 $(tethereal_additional_libs) \
655 tethereal_static_DEPENDENCIES = \
656 $(ethereal_optional_objects) \
657 $(tethereal_additional_libs)
659 # This automake variable adds to the link-line for the executable
660 tethereal_LDADD = wiretap/libwiretap.a \
661 $(ethereal_optional_objects) \
662 $(tethereal_additional_libs) \
663 @SNMP_LIBS@ @SSL_LIBS@ \
666 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
668 tethereal_static_LDADD = \
670 $(plugin_static_ldadd) \
671 wiretap/libwiretap.a \
672 $(ethereal_optional_objects) \
673 $(tethereal_additional_libs) \
674 @SNMP_LIBS@ @SSL_LIBS@ \
676 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
678 tethereal_LDFLAGS = -export-dynamic
679 tethereal_static_LDFLAGS = -Wl,-static
681 # Optional objects that I know how to build, and that are needed by
683 text2pcap_optional_objects = @STRERROR_O@ @STRPTIME_O@
685 text2pcap_SOURCES = text2pcap.c text2pcap-scanner.l
686 text2pcap_DEPENDENCIES = text2pcap.h
688 # This automake variable adds to the link-line for the executable
689 text2pcap_LDADD = $(text2pcap_optional_objects)
691 mergecap_SOURCES = mergecap.c
692 mergecap_DEPENDENCIES = wiretap/libwiretap.a
694 editcap_SOURCES = editcap.c
696 # This is the automake dependency variable for the executable
697 editcap_DEPENDENCIES = wiretap/libwiretap.a
699 # This automake variable adds to the link-line for the executable
700 editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
701 mergecap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
704 # Build various header files for the X11 dissector.
706 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
707 $(PERL) $(srcdir)/process-x11-fields.pl <$(srcdir)/x11-fields
710 # Build shell scripts by doing variable substitution.
711 # Taken from autoconf 2.13.
713 editsh = sed -e 's,@''SHELL''@,$(SHELL),g'
718 $(editsh) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
721 # Build "register.c", which contains a function "register_all_protocols()"
722 # that calls the register routines for all protocols.
724 # We do this by grepping through sources. If that turns out to be too slow,
725 # maybe we could just require every .o file to have an register routine
726 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
728 # Formatting conventions: The name of the proto_register_* routines must
729 # start in column zero, or must be preceded only by "void " starting in
730 # column zero, and must not be inside #if.
732 # We assume that all dissector routines are in "packet-XXX.c" files.
734 # For some unknown reason, having a big "for" loop in the Makefile
735 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
736 # they seem to pass only the first few names in the list to the shell,
739 # Therefore, we have a script to generate the "register.c" file.
741 # The first argument is the directory in which the source files live.
742 # All subsequent arguments are the files to scan.
744 register.c: $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
745 @echo Making register.c
746 @$(srcdir)/make-reg-dotc register.c $(srcdir) $(DISSECTOR_SRC)
748 register-static.c: $(plugin_src) $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
749 @echo Making register-static.c
750 @$(srcdir)/make-reg-dotc register-static.c $(srcdir) $(plugin_src) $(DISSECTOR_SRC)
753 ./rdps $(srcdir)/print.ps ps.c
756 $(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
759 $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
761 randpkt: randpkt.o wiretap/libwiretap.a
762 $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
767 $(ETHEREAL_COMMON_SRC) \
771 dftest_additional_libs = \
772 wiretap/libwiretap.a \
774 epan/ftypes/libftypes.a \
775 epan/dfilter/libdfilter.a
777 dftest_DEPENDENCIES = \
778 $(ethereal_optional_objects) \
779 $(dftest_additional_libs) \
782 # This automake variable adds to the link-line for the executable
784 $(ethereal_optional_objects) \
785 $(dftest_additional_libs) \
786 @SNMP_LIBS@ @SSL_LIBS@ \
789 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
791 dftest_LDFLAGS = -export-dynamic
811 debian/README.debian \
824 doc/README.developer \
827 doc/README.regression \
831 doc/ethereal.pod.template \
835 doc/tethereal.pod.template \
843 text2pcap-scanner.l \
847 image/Makefile.nmake \
849 image/clist_ascend.xpm \
850 image/clist_descend.xpm \
852 image/editcap.rc.in \
853 image/eexcl3d64.xpm \
854 image/eicon3d16.xpm \
855 image/eicon3d32.xpm \
856 image/eicon3d48.xpm \
857 image/eicon3d64.xpm \
858 image/elogo3d48x48.png \
860 image/ethereal.rc.in \
861 image/ethereal48x48-trans.png \
862 image/ethereal48x48.png \
863 image/hi16-app-ethereal.png \
864 image/hi32-app-ethereal.png \
865 image/hi48-app-ethereal.png \
866 image/icon-ethereal.xpm \
867 image/icon-excl.xpm \
868 image/lo16-app-ethereal.png \
869 image/lo32-app-ethereal.png \
870 image/lo48-app-ethereal.png \
871 image/mergecap.rc.in \
872 image/tethereal.rc.in \
873 image/text2pcap.rc.in \
885 process-x11-fields.pl \
906 -chmod +s $(DESTDIR)$(bindir)/ethereal
907 -chmod +s $(DESTDIR)$(bindir)/tethereal
908 -chmod +s $(DESTDIR)$(bindir)/ethereal_static
914 # Currently register.c can be included in the distribution because
915 # we always build all protocol dissectors. We used to have to check
916 # whether or not to build the snmp dissector. If we again need to
917 # variably build something, making register.c non-portable, uncomment
918 # the dist-hook line below.
920 # Oh, yuk. We don't want to include "register.c" in the distribution, as
921 # its contents depend on the configuration, and therefore we want it
922 # to be built when the first "make" is done; however, Automake insists
923 # on putting *all* source into the distribution.
925 # We work around this by having a "dist-hook" rule that deletes
926 # "register.c", so that "dist" won't pick it up.
929 # @rm -f $(distdir)/register.c
932 SUBDIRS = tools wiretap doc epan plugins packaging @ethereal_SUBDIRS@
934 SUBDIRS = tools wiretap doc epan packaging @ethereal_SUBDIRS@
937 ethereal.1: ethereal doc/ethereal.pod.template
939 $(MAKE) ../ethereal.1 )
941 tethereal.1: tethereal doc/tethereal.pod.template
943 $(MAKE) ../tethereal.1 )
945 editcap.1: doc/editcap.pod
947 $(MAKE) ../editcap.1 )
949 idl2eth.1: doc/idl2eth.pod
951 $(MAKE) ../idl2eth.1 )
953 mergecap.1: doc/mergecap.pod
955 $(MAKE) ../mergecap.1 )
957 text2pcap.1: doc/text2pcap.pod
959 $(MAKE) ../text2pcap.1 )
961 packet-ncp2222.c : ncp2222.py
962 $(PYTHON) $(srcdir)/ncp2222.py > $@
964 libtool: $(LIBTOOL_DEPS)
965 $(SHELL) ./config.status --recheck
967 # We load top_stagedir with an explicit path so that libtool doesn't freak.
968 top_stagedir=`cd $(top_srcdir) && pwd`/packaging/svr4.stage
969 stagedir=$(top_stagedir)/$(PACKAGE).stage
973 svr4-package: $(bin_SCRIPTS) $(lib_LTLIBRARIES)
974 if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
975 rm -rf $(stagedir) ; \
976 $(MAKE) DESTDIR=$(stagedir) install-strip; \
977 $(srcdir)/packaging/svr4/mkpkg \
979 $(PACKAGE)-$(VERSION)-$(host_os)-$(host_cpu)-local \
983 echo "Error: SVR4 packaging tools not found." ; \
984 echo "Package build abandoned." ; \
987 solaris-package: svr4-package
989 rpm_topdir=`cd $(top_srcdir) && pwd`/packaging/rpm
991 if test x$(HAVE_RPM) = xyes ; then \
993 mkdir BUILD RPMS SOURCES ; \
995 ln -s ../../../$(distdir).tar.gz ; \
997 rpm --define "_topdir `cd . && pwd`" -bb SPECS/ethereal.spec && \
998 echo "Package successfully built in `pwd`/RPMS." ; \
1000 echo "Error: RPM executable and/or source directory not found." ; \
1003 if test x$(HAVE_RPM) = xyes ; then \
1004 cd $(rpm_topdir) ; \
1005 mkdir BUILD SRPMS SOURCES ; \
1007 ln -s ../../../$(distdir).tar.gz ; \
1009 rpm --define "_topdir `cd . && pwd`" -bs SPECS/ethereal.spec && \
1010 echo "Package successfully built in `pwd`/SRPMS." ; \
1012 echo "Error: RPM executable and/or source directory not found." ; \
1015 debian-package: debian/rules
1016 dpkg-buildpackage -rfakeroot -us -uc
1019 rm -rf $(top_stagedir)