2 # Automake file for Ethereal
4 # $Id: Makefile.am,v 1.469 2002/09/05 09:27:50 sahlberg 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
72 # Install "manuf" in the directory for Ethereal configuration files.
77 # Install the Diameter DTD and XML files in the "diameter" subdirectory
80 diameterdir = $(sysconfdir)/diameter
81 diameter_DATA = dictionary.dtd dictionary.xml mobileipv4.xml \
82 nasreq.xml sunping.xml
103 packet-bootparams.c \
117 packet-dcerpc-browser.c \
118 packet-dcerpc-conv.c \
119 packet-dcerpc-dfs.c \
120 packet-dcerpc-epm.c \
121 packet-dcerpc-lsa.c \
122 packet-dcerpc-mapi.c \
123 packet-dcerpc-mgmt.c \
124 packet-dcerpc-ndr.c \
125 packet-dcerpc-netlogon.c \
126 packet-dcerpc-nspi.c \
128 packet-dcerpc-oxid.c \
129 packet-dcerpc-reg.c \
130 packet-dcerpc-remact.c \
131 packet-dcerpc-samr.c \
132 packet-dcerpc-spoolss.c \
133 packet-dcerpc-srvsvc.c \
134 packet-dcerpc-tapi.c \
135 packet-dcerpc-wkssvc.c \
188 packet-isis-hello.c \
239 packet-osi-options.c \
258 packet-quakeworld.c \
286 packet-slowprotocols.c \
287 packet-smb-browse.c \
288 packet-smb-common.c \
290 packet-smb-mailslot.c \
304 packet-stat-notify.c \
348 plugins/docsis/packet-bpkmattr.c \
349 plugins/docsis/packet-bpkmreq.c \
350 plugins/docsis/packet-bpkmrsp.c \
351 plugins/docsis/packet-docsis.c \
352 plugins/docsis/packet-dsaack.c \
353 plugins/docsis/packet-dsareq.c \
354 plugins/docsis/packet-dsarsp.c \
355 plugins/docsis/packet-dscack.c \
356 plugins/docsis/packet-dscreq.c \
357 plugins/docsis/packet-dscrsp.c \
358 plugins/docsis/packet-dsdreq.c \
359 plugins/docsis/packet-dsdrsp.c \
360 plugins/docsis/packet-macmgmt.c \
361 plugins/docsis/packet-map.c \
362 plugins/docsis/packet-regack.c \
363 plugins/docsis/packet-regreq.c \
364 plugins/docsis/packet-regrsp.c \
365 plugins/docsis/packet-rngreq.c \
366 plugins/docsis/packet-rngrsp.c \
367 plugins/docsis/packet-tlv.c \
368 plugins/docsis/packet-uccreq.c \
369 plugins/docsis/packet-uccrsp.c \
370 plugins/docsis/packet-ucd.c \
371 plugins/giop/packet-cosnaming.c \
372 plugins/giop/packet-coseventcomm.c \
373 plugins/gryphon/packet-gryphon.c \
374 plugins/mgcp/packet-mgcp.c
377 plugin_static_ldadd = \
378 plugins/docsis/packet-bpkmattr-static.o \
379 plugins/docsis/packet-bpkmreq-static.o \
380 plugins/docsis/packet-bpkmrsp-static.o \
381 plugins/docsis/packet-docsis-static.o \
382 plugins/docsis/packet-dsaack-static.o \
383 plugins/docsis/packet-dsareq-static.o \
384 plugins/docsis/packet-dsarsp-static.o \
385 plugins/docsis/packet-dscack-static.o \
386 plugins/docsis/packet-dscreq-static.o \
387 plugins/docsis/packet-dscrsp-static.o \
388 plugins/docsis/packet-dsdreq-static.o \
389 plugins/docsis/packet-dsdrsp-static.o \
390 plugins/docsis/packet-macmgmt-static.o \
391 plugins/docsis/packet-map-static.o \
392 plugins/docsis/packet-regack-static.o \
393 plugins/docsis/packet-regreq-static.o \
394 plugins/docsis/packet-regrsp-static.o \
395 plugins/docsis/packet-rngreq-static.o \
396 plugins/docsis/packet-rngrsp-static.o \
397 plugins/docsis/packet-tlv-static.o \
398 plugins/docsis/packet-uccreq-static.o \
399 plugins/docsis/packet-uccrsp-static.o \
400 plugins/docsis/packet-ucd-static.o \
401 plugins/giop/packet-cosnaming-static.o \
402 plugins/giop/packet-coseventcomm-static.o \
403 plugins/gryphon/packet-gryphon-static.o \
404 plugins/mgcp/packet-mgcp-static.o
407 plugins/docsis/docsis.la \
408 plugins/giop/cosnaming.la \
409 plugins/giop/coseventcomm.la \
410 plugins/gryphon/gryphon.la \
415 "-dlopen" plugins/docsis/docsis.la \
416 "-dlopen" plugins/giop/cosnaming.la \
417 "-dlopen" plugins/giop/coseventcomm.la \
418 "-dlopen" plugins/gryphon/gryphon.la \
419 "-dlopen" plugins/mgcp/mgcp.la
423 plugin_static_ldadd =
433 packet-afs-macros.h \
434 packet-afs-register-info.h \
440 packet-bootparams.h \
445 packet-dcerpc-browser.h \
446 packet-dcerpc-dfs.h \
447 packet-dcerpc-lsa.h \
448 packet-dcerpc-mapi.h \
449 packet-dcerpc-netlogon.h \
451 packet-dcerpc-reg.h \
452 packet-dcerpc-samr.h \
453 packet-dcerpc-spoolss.h \
454 packet-dcerpc-srvsvc.h \
455 packet-dcerpc-tapi.h \
456 packet-dcerpc-wkssvc.h \
459 packet-diameter-defs.h \
480 packet-isis-hello.h \
500 packet-osi-options.h \
521 packet-smb-browse.h \
522 packet-smb-common.h \
524 packet-smb-mailslot.h \
529 packet-stat-notify.h \
543 packet-x11-keysym.h \
550 ETHEREAL_COMMON_SRC = \
558 capture_stop_conditions.c \
559 capture_stop_conditions.h \
605 x11-register-info.h \
618 $(ETHEREAL_COMMON_SRC) \
637 ethereal_static_SOURCES = \
639 $(ETHEREAL_COMMON_SRC) \
658 EXTRA_ethereal_SOURCES = \
671 # Optional objects that I know how to build. These will be
672 # linked into the ethereal executable.
673 # They will also be linked into the tethereal executable; if this
674 # list ever grows to include something that can't be linked with
675 # tethereal, or if tethereal needs something that ethereal doesn't,
676 # we should probably split this into stuff needed both
677 # by ethereal and tethereal and stuff needed only by one or the
679 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ \
680 @STRCASECMP_O@ @STRNCASECMP_O@ @MKSTEMP_O@ @STRPTIME_O@
682 # Additional libs that I know how to build. These will be
683 # linked into the ethereal executable.
685 ethereal_additional_libs = \
686 wiretap/libwiretap.a \
689 epan/ftypes/libftypes.a \
690 epan/dfilter/libdfilter.a
692 ethereal_additional_libs = \
693 wiretap/libwiretap.a \
696 epan/ftypes/libftypes.a \
697 epan/dfilter/libdfilter.a
700 # This is the automake dependency variable for the executable
701 ethereal_DEPENDENCIES = \
702 $(ethereal_optional_objects) \
703 $(ethereal_additional_libs) \
706 ethereal_static_DEPENDENCIES = \
707 $(ethereal_optional_objects) \
708 $(ethereal_additional_libs)
710 # This automake variable adds to the link-line for the executable.
712 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
713 # they are included in @GTK_LIBS@, and doesn't have to be linked with
714 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
715 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
716 # applications are X applications).
718 $(ethereal_optional_objects) \
719 $(ethereal_additional_libs) \
720 @SNMP_LIBS@ @SSL_LIBS@ \
722 @PCAP_LIBS@ @GTK_LIBS@
724 ethereal_static_LDADD = \
726 $(plugin_static_ldadd) \
727 $(ethereal_optional_objects) \
728 $(ethereal_additional_libs) \
729 @SNMP_LIBS@ @SSL_LIBS@ \
730 @PCAP_LIBS@ @GTK_LIBS@
732 ethereal_LDFLAGS = -export-dynamic
733 ethereal_static_LDFLAGS = -Wl,-static
735 tethereal_SOURCES = \
737 $(ETHEREAL_COMMON_SRC) \
741 tethereal_static_SOURCES = \
743 $(ETHEREAL_COMMON_SRC) \
747 # Additional libs that I know how to build. These will be
748 # linked into the tethereal executable.
749 tethereal_additional_libs = \
750 wiretap/libwiretap.a \
752 epan/ftypes/libftypes.a \
753 epan/dfilter/libdfilter.a
755 # This is the automake dependency variable for the executable
756 tethereal_DEPENDENCIES = \
757 $(ethereal_optional_objects) \
758 $(tethereal_additional_libs) \
761 tethereal_static_DEPENDENCIES = \
762 $(ethereal_optional_objects) \
763 $(tethereal_additional_libs)
765 # This automake variable adds to the link-line for the executable
766 tethereal_LDADD = wiretap/libwiretap.a \
767 $(ethereal_optional_objects) \
768 $(tethereal_additional_libs) \
769 @SNMP_LIBS@ @SSL_LIBS@ \
772 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
774 tethereal_static_LDADD = \
776 $(plugin_static_ldadd) \
777 wiretap/libwiretap.a \
778 $(ethereal_optional_objects) \
779 $(tethereal_additional_libs) \
780 @SNMP_LIBS@ @SSL_LIBS@ \
782 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
784 tethereal_LDFLAGS = -export-dynamic
785 tethereal_static_LDFLAGS = -Wl,-static
787 # Optional objects that I know how to build, and that are needed by
789 text2pcap_optional_objects = @STRERROR_O@ @STRPTIME_O@
791 text2pcap_SOURCES = text2pcap.c text2pcap-scanner.l
792 text2pcap_DEPENDENCIES = text2pcap.h
794 # This automake variable adds to the link-line for the executable
795 text2pcap_LDADD = $(text2pcap_optional_objects) \
798 mergecap_SOURCES = mergecap.c
799 mergecap_DEPENDENCIES = wiretap/libwiretap.a
801 editcap_SOURCES = editcap.c
803 # This is the automake dependency variable for the executable
804 editcap_DEPENDENCIES = wiretap/libwiretap.a
806 # This automake variable adds to the link-line for the executable
807 editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
808 mergecap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
811 # Build various header files for the X11 dissector.
813 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
814 $(PERL) $(srcdir)/process-x11-fields.pl <$(srcdir)/x11-fields
817 # Build shell scripts by doing variable substitution.
818 # Taken from autoconf 2.13.
820 editsh = sed -e 's,@''SHELL''@,$(SHELL),g'
825 $(editsh) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
828 # Build "register.c", which contains a function "register_all_protocols()"
829 # that calls the register routines for all protocols.
831 # We do this by grepping through sources. If that turns out to be too slow,
832 # maybe we could just require every .o file to have an register routine
833 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
835 # Formatting conventions: The name of the proto_register_* routines must
836 # start in column zero, or must be preceded only by "void " starting in
837 # column zero, and must not be inside #if.
839 # We assume that all dissector routines are in "packet-XXX.c" files.
841 # For some unknown reason, having a big "for" loop in the Makefile
842 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
843 # they seem to pass only the first few names in the list to the shell,
846 # Therefore, we have a script to generate the "register.c" file.
848 # The first argument is the directory in which the source files live.
849 # All subsequent arguments are the files to scan.
851 register.c: $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
852 @echo Making register.c
853 @$(srcdir)/make-reg-dotc register.c $(srcdir) $(DISSECTOR_SRC)
855 register-static.c: $(plugin_src) $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
856 @echo Making register-static.c
857 @$(srcdir)/make-reg-dotc register-static.c $(srcdir) $(plugin_src) $(DISSECTOR_SRC)
860 ./rdps $(srcdir)/print.ps ps.c
863 $(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
866 $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
868 randpkt: randpkt.o wiretap/libwiretap.a
869 $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
874 $(ETHEREAL_COMMON_SRC) \
878 dftest_additional_libs = \
879 wiretap/libwiretap.a \
881 epan/ftypes/libftypes.a \
882 epan/dfilter/libdfilter.a
884 dftest_DEPENDENCIES = \
885 $(ethereal_optional_objects) \
886 $(dftest_additional_libs) \
889 # This automake variable adds to the link-line for the executable
891 $(ethereal_optional_objects) \
892 $(dftest_additional_libs) \
893 @SNMP_LIBS@ @SSL_LIBS@ \
896 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
898 dftest_LDFLAGS = -export-dynamic
904 aclocal-missing/*.m4 \
925 aclocal-fallback/*.m4 \
933 debian/README.debian \
948 doc/README.developer \
951 doc/README.regression \
955 doc/ethereal.pod.template \
959 doc/tethereal.pod.template \
967 image/Makefile.nmake \
969 image/clist_ascend.xpm \
970 image/clist_descend.xpm \
972 image/editcap.rc.in \
973 image/eexcl3d64.xpm \
974 image/eicon3d16.xpm \
975 image/eicon3d32.xpm \
976 image/eicon3d48.xpm \
977 image/eicon3d64.xpm \
978 image/elogo3d48x48.png \
980 image/ethereal.rc.in \
981 image/ethereal48x48-trans.png \
982 image/ethereal48x48.png \
983 image/hi16-app-ethereal.png \
984 image/hi32-app-ethereal.png \
985 image/hi48-app-ethereal.png \
986 image/icon-ethereal.xpm \
987 image/icon-excl.xpm \
988 image/lo16-app-ethereal.png \
989 image/lo32-app-ethereal.png \
990 image/lo48-app-ethereal.png \
991 image/mergecap.rc.in \
992 image/nsis-checked.bmp \
993 image/nsis-unchecked.bmp \
994 image/tethereal.rc.in \
995 image/text2pcap.rc.in \
1006 packet-ncp2222.inc \
1008 process-x11-fields.pl \
1012 text2pcap-scanner.l \
1019 -chmod +s $(DESTDIR)$(bindir)/ethereal
1020 -chmod +s $(DESTDIR)$(bindir)/tethereal
1021 -chmod +s $(DESTDIR)$(bindir)/ethereal_static
1027 # Currently register.c can be included in the distribution because
1028 # we always build all protocol dissectors. We used to have to check
1029 # whether or not to build the snmp dissector. If we again need to
1030 # variably build something, making register.c non-portable, uncomment
1031 # the dist-hook line below.
1033 # Oh, yuk. We don't want to include "register.c" in the distribution, as
1034 # its contents depend on the configuration, and therefore we want it
1035 # to be built when the first "make" is done; however, Automake insists
1036 # on putting *all* source into the distribution.
1038 # We work around this by having a "dist-hook" rule that deletes
1039 # "register.c", so that "dist" won't pick it up.
1042 # @rm -f $(distdir)/register.c
1044 # Hack around the problem that I haven't found a way to include an
1045 # empty directroy in the distribution tarball.
1047 mkdir -p aclocal-missing
1050 SUBDIRS = tools wiretap doc epan plugins packaging @ethereal_SUBDIRS@
1052 SUBDIRS = tools wiretap doc epan packaging @ethereal_SUBDIRS@
1055 ethereal.1: ethereal doc/ethereal.pod.template
1057 $(MAKE) ../ethereal.1 )
1059 tethereal.1: tethereal doc/tethereal.pod.template
1061 $(MAKE) ../tethereal.1 )
1063 editcap.1: doc/editcap.pod
1065 $(MAKE) ../editcap.1 )
1067 idl2eth.1: doc/idl2eth.pod
1069 $(MAKE) ../idl2eth.1 )
1071 mergecap.1: doc/mergecap.pod
1073 $(MAKE) ../mergecap.1 )
1075 text2pcap.1: doc/text2pcap.pod
1077 $(MAKE) ../text2pcap.1 )
1079 packet-ncp2222.c : ncp2222.py
1080 $(PYTHON) $(srcdir)/ncp2222.py -o $@
1082 libtool: $(LIBTOOL_DEPS)
1083 $(SHELL) ./config.status --recheck
1085 # We load top_stagedir with an explicit path so that libtool doesn't freak.
1086 top_stagedir=`cd $(top_srcdir) && pwd`/packaging/svr4.stage
1087 stagedir=$(top_stagedir)/$(PACKAGE).stage
1091 svr4-package: $(bin_SCRIPTS) $(lib_LTLIBRARIES)
1092 if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
1093 rm -rf $(stagedir) ; \
1094 $(MAKE) DESTDIR=$(stagedir) install; \
1095 $(srcdir)/packaging/svr4/mkpkg \
1097 $(PACKAGE)-$(VERSION)-$(host_os)-$(host_cpu)-local \
1101 echo "Error: SVR4 packaging tools not found." ; \
1102 echo "Package build abandoned." ; \
1105 solaris-package: svr4-package
1107 rpm_topdir=`cd $(top_srcdir) && pwd`/packaging/rpm
1109 if test x$(HAVE_RPM) = xyes ; then \
1110 cd $(rpm_topdir) ; \
1111 mkdir -p BUILD RPMS SOURCES ; \
1113 ln -s ../../../$(distdir).tar.gz ; \
1115 rpm --define "_topdir `cd . && pwd`" -bb SPECS/ethereal.spec && \
1116 echo "Package successfully built in `pwd`/RPMS." ; \
1118 echo "Error: RPM executable and/or source directory not found." ; \
1121 if test x$(HAVE_RPM) = xyes ; then \
1122 cd $(rpm_topdir) ; \
1123 mkdir -p BUILD SRPMS SOURCES ; \
1125 ln -s ../../../$(distdir).tar.gz ; \
1127 rpm --define "_topdir `cd . && pwd`" -bs SPECS/ethereal.spec && \
1128 echo "Package successfully built in `pwd`/SRPMS." ; \
1130 echo "Error: RPM executable and/or source directory not found." ; \
1133 debian-package: debian/rules
1134 dpkg-buildpackage -rfakeroot -us -uc
1137 rm -rf $(top_stagedir)