2 # Automake file for Ethereal
4 # $Id: Makefile.am,v 1.498 2002/09/13 10:28:54 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-bossvr.c \
118 packet-dcerpc-browser.c \
119 packet-dcerpc-cds_clerkserver.c \
120 packet-dcerpc-cds_solicit.c \
121 packet-dcerpc-conv.c \
122 packet-dcerpc-cprpc_server.c \
123 packet-dcerpc-dfs.c \
124 packet-dcerpc-dnsserver.c \
125 packet-dcerpc-dtsprovider.c \
126 packet-dcerpc-dtsstime_req.c \
127 packet-dcerpc-epm.c \
128 packet-dcerpc-fldb.c \
129 packet-dcerpc-ftserver.c \
130 packet-dcerpc-krb5rpc.c \
131 packet-dcerpc-lsa.c \
132 packet-dcerpc-mapi.c \
133 packet-dcerpc-mgmt.c \
134 packet-dcerpc-ndr.c \
135 packet-dcerpc-netlogon.c \
136 packet-dcerpc-nspi.c \
138 packet-dcerpc-oxid.c \
139 packet-dcerpc-reg.c \
140 packet-dcerpc-remact.c \
141 packet-dcerpc-rep_proc.c \
142 packet-dcerpc-roverride.c \
143 packet-dcerpc-rpriv.c \
144 packet-dcerpc-rs_acct.c \
145 packet-dcerpc-rs_attr.c \
146 packet-dcerpc-rs_misc.c \
147 packet-dcerpc-rs_pgo.c \
148 packet-dcerpc-rs_repadm.c \
149 packet-dcerpc-rs_replist.c \
150 packet-dcerpc-rs_unix.c \
151 packet-dcerpc-rsec_login.c \
152 packet-dcerpc-samr.c \
153 packet-dcerpc-secidmap.c \
154 packet-dcerpc-spoolss.c \
155 packet-dcerpc-srvsvc.c \
156 packet-dcerpc-tapi.c \
157 packet-dcerpc-tkn4int.c \
158 packet-dcerpc-ubikdisk.c \
159 packet-dcerpc-ubikvote.c \
160 packet-dcerpc-wkssvc.c \
213 packet-isis-hello.c \
264 packet-osi-options.c \
283 packet-quakeworld.c \
311 packet-slowprotocols.c \
312 packet-smb-browse.c \
313 packet-smb-common.c \
315 packet-smb-mailslot.c \
329 packet-stat-notify.c \
373 plugins/docsis/packet-bpkmattr.c \
374 plugins/docsis/packet-bpkmreq.c \
375 plugins/docsis/packet-bpkmrsp.c \
376 plugins/docsis/packet-docsis.c \
377 plugins/docsis/packet-dsaack.c \
378 plugins/docsis/packet-dsareq.c \
379 plugins/docsis/packet-dsarsp.c \
380 plugins/docsis/packet-dscack.c \
381 plugins/docsis/packet-dscreq.c \
382 plugins/docsis/packet-dscrsp.c \
383 plugins/docsis/packet-dsdreq.c \
384 plugins/docsis/packet-dsdrsp.c \
385 plugins/docsis/packet-macmgmt.c \
386 plugins/docsis/packet-map.c \
387 plugins/docsis/packet-regack.c \
388 plugins/docsis/packet-regreq.c \
389 plugins/docsis/packet-regrsp.c \
390 plugins/docsis/packet-rngreq.c \
391 plugins/docsis/packet-rngrsp.c \
392 plugins/docsis/packet-tlv.c \
393 plugins/docsis/packet-uccreq.c \
394 plugins/docsis/packet-uccrsp.c \
395 plugins/docsis/packet-ucd.c \
396 plugins/giop/packet-cosnaming.c \
397 plugins/giop/packet-coseventcomm.c \
398 plugins/gryphon/packet-gryphon.c \
399 plugins/mgcp/packet-mgcp.c
402 plugin_static_ldadd = \
403 plugins/docsis/packet-bpkmattr-static.o \
404 plugins/docsis/packet-bpkmreq-static.o \
405 plugins/docsis/packet-bpkmrsp-static.o \
406 plugins/docsis/packet-docsis-static.o \
407 plugins/docsis/packet-dsaack-static.o \
408 plugins/docsis/packet-dsareq-static.o \
409 plugins/docsis/packet-dsarsp-static.o \
410 plugins/docsis/packet-dscack-static.o \
411 plugins/docsis/packet-dscreq-static.o \
412 plugins/docsis/packet-dscrsp-static.o \
413 plugins/docsis/packet-dsdreq-static.o \
414 plugins/docsis/packet-dsdrsp-static.o \
415 plugins/docsis/packet-macmgmt-static.o \
416 plugins/docsis/packet-map-static.o \
417 plugins/docsis/packet-regack-static.o \
418 plugins/docsis/packet-regreq-static.o \
419 plugins/docsis/packet-regrsp-static.o \
420 plugins/docsis/packet-rngreq-static.o \
421 plugins/docsis/packet-rngrsp-static.o \
422 plugins/docsis/packet-tlv-static.o \
423 plugins/docsis/packet-uccreq-static.o \
424 plugins/docsis/packet-uccrsp-static.o \
425 plugins/docsis/packet-ucd-static.o \
426 plugins/giop/packet-cosnaming-static.o \
427 plugins/giop/packet-coseventcomm-static.o \
428 plugins/gryphon/packet-gryphon-static.o \
429 plugins/mgcp/packet-mgcp-static.o
432 plugins/docsis/docsis.la \
433 plugins/giop/cosnaming.la \
434 plugins/giop/coseventcomm.la \
435 plugins/gryphon/gryphon.la \
440 "-dlopen" plugins/docsis/docsis.la \
441 "-dlopen" plugins/giop/cosnaming.la \
442 "-dlopen" plugins/giop/coseventcomm.la \
443 "-dlopen" plugins/gryphon/gryphon.la \
444 "-dlopen" plugins/mgcp/mgcp.la
448 plugin_static_ldadd =
458 packet-afs-macros.h \
459 packet-afs-register-info.h \
465 packet-bootparams.h \
470 packet-dcerpc-browser.h \
471 packet-dcerpc-dfs.h \
472 packet-dcerpc-dnsserver.h \
473 packet-dcerpc-lsa.h \
474 packet-dcerpc-mapi.h \
475 packet-dcerpc-netlogon.h \
477 packet-dcerpc-reg.h \
478 packet-dcerpc-samr.h \
479 packet-dcerpc-spoolss.h \
480 packet-dcerpc-srvsvc.h \
481 packet-dcerpc-tapi.h \
482 packet-dcerpc-wkssvc.h \
485 packet-diameter-defs.h \
506 packet-isis-hello.h \
527 packet-osi-options.h \
548 packet-smb-browse.h \
549 packet-smb-common.h \
551 packet-smb-mailslot.h \
556 packet-stat-notify.h \
570 packet-x11-keysym.h \
577 ETHEREAL_COMMON_SRC = \
585 capture_stop_conditions.c \
586 capture_stop_conditions.h \
635 x11-register-info.h \
648 $(ETHEREAL_COMMON_SRC) \
668 ethereal_static_SOURCES = \
670 $(ETHEREAL_COMMON_SRC) \
690 EXTRA_ethereal_SOURCES = \
703 # Optional objects that I know how to build. These will be
704 # linked into the ethereal executable.
705 # They will also be linked into the tethereal executable; if this
706 # list ever grows to include something that can't be linked with
707 # tethereal, or if tethereal needs something that ethereal doesn't,
708 # we should probably split this into stuff needed both
709 # by ethereal and tethereal and stuff needed only by one or the
711 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ \
712 @STRCASECMP_O@ @STRNCASECMP_O@ @MKSTEMP_O@ @STRPTIME_O@
714 # Additional libs that I know how to build. These will be
715 # linked into the ethereal executable.
717 ethereal_additional_libs = \
718 wiretap/libwiretap.a \
721 epan/ftypes/libftypes.a \
722 epan/dfilter/libdfilter.a
724 ethereal_additional_libs = \
725 wiretap/libwiretap.a \
728 epan/ftypes/libftypes.a \
729 epan/dfilter/libdfilter.a
732 # This is the automake dependency variable for the executable
733 ethereal_DEPENDENCIES = \
734 $(ethereal_optional_objects) \
735 $(ethereal_additional_libs) \
738 ethereal_static_DEPENDENCIES = \
739 $(ethereal_optional_objects) \
740 $(ethereal_additional_libs)
742 # This automake variable adds to the link-line for the executable.
744 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
745 # they are included in @GTK_LIBS@, and doesn't have to be linked with
746 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
747 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
748 # applications are X applications).
750 $(ethereal_optional_objects) \
751 $(ethereal_additional_libs) \
752 @SNMP_LIBS@ @SSL_LIBS@ \
754 @PCAP_LIBS@ @GTK_LIBS@
756 ethereal_static_LDADD = \
758 $(plugin_static_ldadd) \
759 $(ethereal_optional_objects) \
760 $(ethereal_additional_libs) \
761 @SNMP_LIBS@ @SSL_LIBS@ \
762 @PCAP_LIBS@ @GTK_LIBS@
764 ethereal_LDFLAGS = -export-dynamic
765 ethereal_static_LDFLAGS = -Wl,-static
767 tethereal_SOURCES = \
769 $(ETHEREAL_COMMON_SRC) \
773 tethereal_static_SOURCES = \
775 $(ETHEREAL_COMMON_SRC) \
779 # Additional libs that I know how to build. These will be
780 # linked into the tethereal executable.
781 tethereal_additional_libs = \
782 wiretap/libwiretap.a \
784 epan/ftypes/libftypes.a \
785 epan/dfilter/libdfilter.a
787 # This is the automake dependency variable for the executable
788 tethereal_DEPENDENCIES = \
789 $(ethereal_optional_objects) \
790 $(tethereal_additional_libs) \
793 tethereal_static_DEPENDENCIES = \
794 $(ethereal_optional_objects) \
795 $(tethereal_additional_libs)
797 # This automake variable adds to the link-line for the executable
798 tethereal_LDADD = wiretap/libwiretap.a \
799 $(ethereal_optional_objects) \
800 $(tethereal_additional_libs) \
801 @SNMP_LIBS@ @SSL_LIBS@ \
804 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
806 tethereal_static_LDADD = \
808 $(plugin_static_ldadd) \
809 wiretap/libwiretap.a \
810 $(ethereal_optional_objects) \
811 $(tethereal_additional_libs) \
812 @SNMP_LIBS@ @SSL_LIBS@ \
814 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
816 tethereal_LDFLAGS = -export-dynamic
817 tethereal_static_LDFLAGS = -Wl,-static
819 # Optional objects that I know how to build, and that are needed by
821 text2pcap_optional_objects = @STRERROR_O@ @STRPTIME_O@
823 text2pcap_SOURCES = text2pcap.c text2pcap-scanner.l
824 text2pcap_DEPENDENCIES = text2pcap.h
826 # This automake variable adds to the link-line for the executable
827 text2pcap_LDADD = $(text2pcap_optional_objects) \
830 mergecap_SOURCES = mergecap.c
831 mergecap_DEPENDENCIES = wiretap/libwiretap.a
833 editcap_SOURCES = editcap.c
835 # This is the automake dependency variable for the executable
836 editcap_DEPENDENCIES = wiretap/libwiretap.a
838 # This automake variable adds to the link-line for the executable
839 editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
840 mergecap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
843 # Build various header files for the X11 dissector.
845 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
846 $(PERL) $(srcdir)/process-x11-fields.pl <$(srcdir)/x11-fields
849 # Build shell scripts by doing variable substitution.
850 # Taken from autoconf 2.13.
852 editsh = sed -e 's,@''SHELL''@,$(SHELL),g'
857 $(editsh) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
860 # Build "register.c", which contains a function "register_all_protocols()"
861 # that calls the register routines for all protocols.
863 # We do this by grepping through sources. If that turns out to be too slow,
864 # maybe we could just require every .o file to have an register routine
865 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
867 # Formatting conventions: The name of the proto_register_* routines must
868 # start in column zero, or must be preceded only by "void " starting in
869 # column zero, and must not be inside #if.
871 # We assume that all dissector routines are in "packet-XXX.c" files.
873 # For some unknown reason, having a big "for" loop in the Makefile
874 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
875 # they seem to pass only the first few names in the list to the shell,
878 # Therefore, we have a script to generate the "register.c" file.
880 # The first argument is the directory in which the source files live.
881 # All subsequent arguments are the files to scan.
883 register.c: $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
884 @echo Making register.c
885 @$(srcdir)/make-reg-dotc register.c $(srcdir) $(DISSECTOR_SRC)
887 register-static.c: $(plugin_src) $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
888 @echo Making register-static.c
889 @$(srcdir)/make-reg-dotc register-static.c $(srcdir) $(plugin_src) $(DISSECTOR_SRC)
892 ./rdps $(srcdir)/print.ps ps.c
895 $(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
898 $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
900 randpkt: randpkt.o wiretap/libwiretap.a
901 $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
906 $(ETHEREAL_COMMON_SRC) \
910 dftest_additional_libs = \
911 wiretap/libwiretap.a \
913 epan/ftypes/libftypes.a \
914 epan/dfilter/libdfilter.a
916 dftest_DEPENDENCIES = \
917 $(ethereal_optional_objects) \
918 $(dftest_additional_libs) \
921 # This automake variable adds to the link-line for the executable
923 $(ethereal_optional_objects) \
924 $(dftest_additional_libs) \
925 @SNMP_LIBS@ @SSL_LIBS@ \
928 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
930 dftest_LDFLAGS = -export-dynamic
936 aclocal-missing/*.m4 \
957 aclocal-fallback/*.m4 \
965 debian/README.debian \
980 doc/README.developer \
983 doc/README.regression \
987 doc/ethereal.pod.template \
991 doc/tethereal.pod.template \
999 image/Makefile.nmake \
1000 image/README.image \
1001 image/clist_ascend.xpm \
1002 image/clist_descend.xpm \
1003 image/dn_arrow.xpm \
1004 image/editcap.rc.in \
1005 image/eexcl3d64.xpm \
1006 image/eicon3d16.xpm \
1007 image/eicon3d32.xpm \
1008 image/eicon3d48.xpm \
1009 image/eicon3d64.xpm \
1010 image/elogo3d48x48.png \
1011 image/ethereal.ico \
1012 image/ethereal.rc.in \
1013 image/ethereal48x48-trans.png \
1014 image/ethereal48x48.png \
1015 image/hi16-app-ethereal.png \
1016 image/hi32-app-ethereal.png \
1017 image/hi48-app-ethereal.png \
1018 image/icon-ethereal.xpm \
1019 image/icon-excl.xpm \
1020 image/lo16-app-ethereal.png \
1021 image/lo32-app-ethereal.png \
1022 image/lo48-app-ethereal.png \
1023 image/mergecap.rc.in \
1024 image/nsis-checked.bmp \
1025 image/nsis-unchecked.bmp \
1026 image/tethereal.rc.in \
1027 image/text2pcap.rc.in \
1028 image/up_arrow.xpm \
1038 packet-ncp2222.inc \
1040 process-x11-fields.pl \
1044 text2pcap-scanner.l \
1052 -chmod +s $(DESTDIR)$(bindir)/ethereal
1053 -chmod +s $(DESTDIR)$(bindir)/tethereal
1054 -chmod +s $(DESTDIR)$(bindir)/ethereal_static
1060 # Currently register.c can be included in the distribution because
1061 # we always build all protocol dissectors. We used to have to check
1062 # whether or not to build the snmp dissector. If we again need to
1063 # variably build something, making register.c non-portable, uncomment
1064 # the dist-hook line below.
1066 # Oh, yuk. We don't want to include "register.c" in the distribution, as
1067 # its contents depend on the configuration, and therefore we want it
1068 # to be built when the first "make" is done; however, Automake insists
1069 # on putting *all* source into the distribution.
1071 # We work around this by having a "dist-hook" rule that deletes
1072 # "register.c", so that "dist" won't pick it up.
1075 # @rm -f $(distdir)/register.c
1077 # Hack around the problem that I haven't found a way to include an
1078 # empty directroy in the distribution tarball.
1080 mkdir -p aclocal-missing
1082 DIST_SUBDIRS = tools wiretap doc epan plugins packaging \
1086 SUBDIRS = tools wiretap doc epan plugins packaging @ethereal_SUBDIRS@
1088 SUBDIRS = tools wiretap doc epan packaging @ethereal_SUBDIRS@
1091 ethereal.1: ethereal doc/ethereal.pod.template
1093 $(MAKE) ../ethereal.1 )
1095 tethereal.1: tethereal doc/tethereal.pod.template
1097 $(MAKE) ../tethereal.1 )
1099 editcap.1: doc/editcap.pod
1101 $(MAKE) ../editcap.1 )
1103 idl2eth.1: doc/idl2eth.pod
1105 $(MAKE) ../idl2eth.1 )
1107 mergecap.1: doc/mergecap.pod
1109 $(MAKE) ../mergecap.1 )
1111 text2pcap.1: doc/text2pcap.pod
1113 $(MAKE) ../text2pcap.1 )
1115 packet-ncp2222.c : ncp2222.py
1116 $(PYTHON) $(srcdir)/ncp2222.py -o $@
1118 libtool: $(LIBTOOL_DEPS)
1119 $(SHELL) ./config.status --recheck
1121 # We load top_stagedir with an explicit path so that libtool doesn't freak.
1122 top_stagedir=`cd $(top_srcdir) && pwd`/packaging/svr4.stage
1123 stagedir=$(top_stagedir)/$(PACKAGE).stage
1127 svr4-package: $(bin_SCRIPTS) $(lib_LTLIBRARIES)
1128 if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
1129 rm -rf $(stagedir) ; \
1130 $(MAKE) DESTDIR=$(stagedir) install; \
1131 $(srcdir)/packaging/svr4/mkpkg \
1133 $(PACKAGE)-$(VERSION)-$(host_os)-$(host_cpu)-local \
1137 echo "Error: SVR4 packaging tools not found." ; \
1138 echo "Package build abandoned." ; \
1141 solaris-package: svr4-package
1143 rpm_topdir=`cd $(top_srcdir) && pwd`/packaging/rpm
1145 if test x$(HAVE_RPM) = xyes ; then \
1146 cd $(rpm_topdir) ; \
1147 mkdir -p BUILD RPMS SOURCES ; \
1149 ln -s ../../../$(distdir).tar.gz ; \
1151 rpm --define "_topdir `cd . && pwd`" -bb SPECS/ethereal.spec && \
1152 echo "Package successfully built in `pwd`/RPMS." ; \
1154 echo "Error: RPM executable and/or source directory not found." ; \
1157 if test x$(HAVE_RPM) = xyes ; then \
1158 cd $(rpm_topdir) ; \
1159 mkdir -p BUILD SRPMS SOURCES ; \
1161 ln -s ../../../$(distdir).tar.gz ; \
1163 rpm --define "_topdir `cd . && pwd`" -bs SPECS/ethereal.spec && \
1164 echo "Package successfully built in `pwd`/SRPMS." ; \
1166 echo "Error: RPM executable and/or source directory not found." ; \
1169 debian-package: debian/rules
1170 dpkg-buildpackage -rfakeroot -us -uc
1173 rm -rf $(top_stagedir)