2 # Automake file for Ethereal
4 # $Id: Makefile.am,v 1.707 2004/02/10 00:50:04 jmayer 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@
66 man4_MANS = @etherealfilter_man@
69 EXTRA_PROGRAMS = ethereal tethereal editcap mergecap dftest text2pcap
70 EXTRA_SCRIPTS = idl2eth
73 # Ethereal configuration files are put in $(pkgdatadir). It currently
74 # contains the "manuf" file and a "diameter" directory.
79 # Install the Diameter DTD and XML files in the "diameter" subdirectory
82 diameterdir = $(pkgdatadir)/diameter
83 diameter_DATA = dictionary.dtd dictionary.xml mobileipv4.xml \
84 nasreq.xml sunping.xml
86 include Makefile.common
91 plugins/artnet/artnet.la \
92 plugins/asn1/asn1.la \
93 plugins/docsis/docsis.la \
94 plugins/enttec/enttec.la \
95 plugins/giop/cosnaming.la \
96 plugins/giop/coseventcomm.la \
97 plugins/gryphon/gryphon.la \
98 plugins/irda/irda.la \
99 plugins/lwres/lwres.la \
100 plugins/megaco/megaco.la \
101 plugins/mgcp/mgcp.la \
102 plugins/pcli/pcli.la \
104 plugins/rtnet/rtnet.la \
109 plugins/acn/packet-acn.o \
110 plugins/artnet/packet-artnet.o \
111 plugins/asn1/packet-asn1.o \
112 plugins/docsis/packet-bpkmattr.o \
113 plugins/docsis/packet-bpkmreq.o \
114 plugins/docsis/packet-bpkmrsp.o \
115 plugins/docsis/packet-docsis.o \
116 plugins/docsis/packet-dsaack.o \
117 plugins/docsis/packet-dsareq.o \
118 plugins/docsis/packet-dsarsp.o \
119 plugins/docsis/packet-dscack.o \
120 plugins/docsis/packet-dscreq.o \
121 plugins/docsis/packet-dscrsp.o \
122 plugins/docsis/packet-dsdreq.o \
123 plugins/docsis/packet-dsdrsp.o \
124 plugins/docsis/packet-macmgmt.o \
125 plugins/docsis/packet-map.o \
126 plugins/docsis/packet-regack.o \
127 plugins/docsis/packet-regreq.o \
128 plugins/docsis/packet-regrsp.o \
129 plugins/docsis/packet-rngreq.o \
130 plugins/docsis/packet-rngrsp.o \
131 plugins/docsis/packet-tlv.o \
132 plugins/docsis/packet-uccreq.o \
133 plugins/docsis/packet-uccrsp.o \
134 plugins/docsis/packet-ucd.o \
135 plugins/enttec/packet-enttec.o \
136 plugins/giop/packet-cosnaming.o \
137 plugins/giop/packet-coseventcomm.o \
138 plugins/gryphon/packet-gryphon.o \
139 plugins/irda/packet-irda.o \
140 plugins/lwres/packet-lwres.o \
141 plugins/megaco/packet-megaco.o \
142 plugins/mgcp/packet-mgcp.o \
143 plugins/pcli/packet-pcli.o \
144 plugins/rdm/packet-rdm.o \
145 plugins/rtnet/packet-rtnet.o \
146 plugins/v5ua/packet-v5ua.o
149 plugins/acn/packet-acn.c \
150 plugins/artnet/packet-artnet.c \
151 plugins/asn1/packet-asn1.c \
152 plugins/docsis/packet-bpkmattr.c \
153 plugins/docsis/packet-bpkmreq.c \
154 plugins/docsis/packet-bpkmrsp.c \
155 plugins/docsis/packet-docsis.c \
156 plugins/docsis/packet-dsaack.c \
157 plugins/docsis/packet-dsareq.c \
158 plugins/docsis/packet-dsarsp.c \
159 plugins/docsis/packet-dscack.c \
160 plugins/docsis/packet-dscreq.c \
161 plugins/docsis/packet-dscrsp.c \
162 plugins/docsis/packet-dsdreq.c \
163 plugins/docsis/packet-dsdrsp.c \
164 plugins/docsis/packet-macmgmt.c \
165 plugins/docsis/packet-map.c \
166 plugins/docsis/packet-regack.c \
167 plugins/docsis/packet-regreq.c \
168 plugins/docsis/packet-regrsp.c \
169 plugins/docsis/packet-rngreq.c \
170 plugins/docsis/packet-rngrsp.c \
171 plugins/docsis/packet-tlv.c \
172 plugins/docsis/packet-uccreq.c \
173 plugins/docsis/packet-uccrsp.c \
174 plugins/docsis/packet-ucd.c \
175 plugins/enttec/packet-enttec.c \
176 plugins/giop/packet-cosnaming.c \
177 plugins/giop/packet-coseventcomm.c \
178 plugins/gryphon/packet-gryphon.c \
179 plugins/irda/packet-irda.c \
180 plugins/lwres/packet-lwres.c \
181 plugins/megaco/packet-megaco.c \
182 plugins/mgcp/packet-mgcp.c \
183 plugins/pcli/packet-pcli.c \
184 plugins/rdm/packet-rdm.c \
185 plugins/rtnet/packet-rtnet.c \
186 plugins/v5ua/packet-v5ua.c
191 "-dlopen" plugins/acn/acn.la \
192 "-dlopen" plugins/artnet/artnet.la \
193 "-dlopen" plugins/asn1/asn1.la \
194 "-dlopen" plugins/docsis/docsis.la \
195 "-dlopen" plugins/enttec/enttec.la \
196 "-dlopen" plugins/giop/cosnaming.la \
197 "-dlopen" plugins/giop/coseventcomm.la \
198 "-dlopen" plugins/gryphon/gryphon.la \
199 "-dlopen" plugins/irda/irda.la \
200 "-dlopen" plugins/lwres/lwres.la \
201 "-dlopen" plugins/megaco/megaco.la \
202 "-dlopen" plugins/mgcp/mgcp.la \
203 "-dlopen" plugins/pcli/pcli.la \
204 "-dlopen" plugins/rdm/rdm.la \
205 "-dlopen" plugins/rtnet/rtnet.la \
206 "-dlopen" plugins/v5ua/v5ua.la
210 endif # ENABLE_STATIC
220 # Optional objects that I know how to build. These will be
221 # linked into the ethereal executable.
222 # They will also be linked into the tethereal executable; if this
223 # list ever grows to include something that can't be linked with
224 # tethereal, or if tethereal needs something that ethereal doesn't,
225 # we should probably split this into stuff needed both
226 # by ethereal and tethereal and stuff needed only by one or the
228 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ \
229 @STRCASECMP_O@ @STRNCASECMP_O@ @MKSTEMP_O@ @STRPTIME_O@
231 # Additional libs that I know how to build. These will be
232 # linked into the ethereal executable.
233 ethereal_additional_libs = \
234 wiretap/libwiretap.a \
237 epan/ftypes/libftypes.a \
238 epan/dfilter/libdfilter.a
240 # This is the automake dependency variable for the executable
241 ethereal_DEPENDENCIES = \
242 $(ethereal_optional_objects) \
243 $(ethereal_additional_libs) \
246 # This automake variable adds to the link-line for the executable.
248 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
249 # they are included in @GTK_LIBS@, and doesn't have to be linked with
250 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
251 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
252 # applications are X applications).
255 ethereal_LDFLAGS = -Wl,-static -all-static
257 ethereal_LDFLAGS = -export-dynamic
261 $(ethereal_optional_objects) \
262 $(ethereal_additional_libs) \
263 @SNMP_LIBS@ @SSL_LIBS@ \
266 @PCAP_LIBS@ @GTK_LIBS@ @ADNS_LIBS@
268 # Additional libs that I know how to build. These will be
269 # linked into the tethereal executable.
270 tethereal_additional_libs = \
271 wiretap/libwiretap.a \
273 epan/ftypes/libftypes.a \
274 epan/dfilter/libdfilter.a
276 # This is the automake dependency variable for the executable
277 tethereal_DEPENDENCIES = \
278 $(ethereal_optional_objects) \
279 $(tethereal_additional_libs) \
282 # This automake variable adds to the link-line for the executable
284 $(ethereal_optional_objects) \
285 $(tethereal_additional_libs) \
286 @SNMP_LIBS@ @SSL_LIBS@ \
290 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@ @ADNS_LIBS@
293 tethereal_LDFLAGS = -Wl,-static -all-static
295 tethereal_LDFLAGS = -export-dynamic
298 # Optional objects that I know how to build, and that are needed by
300 text2pcap_optional_objects = @STRERROR_O@ @STRPTIME_O@
302 text2pcap_DEPENDENCIES = text2pcap.h
304 # This automake variable adds to the link-line for the executable
305 text2pcap_LDADD = $(text2pcap_optional_objects) \
308 mergecap_DEPENDENCIES = wiretap/libwiretap.a
310 # This is the automake dependency variable for the executable
311 editcap_DEPENDENCIES = wiretap/libwiretap.a
313 # This automake variable adds to the link-line for the executable
314 editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
315 mergecap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
318 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/wiretap
321 # Build the version string
326 $(PERL) $(srcdir)/make-version.pl
329 # Build various header files for the X11 dissector.
331 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
332 $(PERL) $(srcdir)/process-x11-fields.pl <$(srcdir)/x11-fields
335 # Build shell scripts by doing variable substitution.
336 # Taken from autoconf 2.13.
338 editsh = sed -e 's,@''SHELL''@,$(SHELL),g'
343 $(editsh) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
346 # Build "register.c", which contains a function "register_all_protocols()"
347 # that calls the register routines for all protocols.
349 # We do this by grepping through sources. If that turns out to be too slow,
350 # maybe we could just require every .o file to have an register routine
351 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
353 # Formatting conventions: The name of the proto_register_* routines must
354 # start in column zero, or must be preceded only by "void " starting in
355 # column zero, and must not be inside #if.
357 # We assume that all dissector routines are in "packet-XXX.c" files.
359 # For some unknown reason, having a big "for" loop in the Makefile
360 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
361 # they seem to pass only the first few names in the list to the shell,
364 # Therefore, we have a script to generate the "register.c" file.
366 # The first argument is the name of the file to write.
367 # The second argument is the directory in which the source files live.
368 # All subsequent arguments are the files to scan.
370 register.c: $(plugin_src) $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
371 @if test -n $(PYTHON); then \
372 echo Making register.c with python ; \
373 $(PYTHON) $(srcdir)/make-reg-dotc.py $(srcdir) $(DISSECTOR_SRC) ; \
375 echo Making register.c with shell script ; \
376 $(srcdir)/make-reg-dotc register.c $(srcdir) \
377 $(plugin_src) $(DISSECTOR_SRC) ; \
381 # Build "tethereal-tap-register.c", which contains a function
382 # "register_all_tap_listeners()"
383 # that calls the register routines for all tehtereal tap listeners.
385 # We do this by grepping through sources.
387 # Formatting conventions: The name of the tap_listener_register_*
388 # routines must start in column zero, or must be preceded only by
389 # "void " starting in column zero, and must not be inside #if.
391 # The first argument is the directory in which the source files live.
392 # All subsequent arguments are the files to scan.
394 tethereal-tap-register.c: $(TETHEREAL_TAP_SRC) $(srcdir)/make-tapreg-dotc
395 @echo Making tethereal-tap-register.c
396 @$(srcdir)/make-tapreg-dotc tethereal-tap-register.c $(srcdir) $(TETHEREAL_TAP_SRC)
399 ./rdps $(srcdir)/print.ps ps.c
402 $(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
405 $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
407 randpkt: randpkt.o wiretap/libwiretap.a
408 $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
411 dftest_additional_libs = \
412 wiretap/libwiretap.a \
414 epan/ftypes/libftypes.a \
415 epan/dfilter/libdfilter.a
417 dftest_DEPENDENCIES = \
418 $(ethereal_optional_objects) \
419 $(dftest_additional_libs) \
422 # This automake variable adds to the link-line for the executable
424 $(ethereal_optional_objects) \
425 $(dftest_additional_libs) \
426 @SNMP_LIBS@ @SSL_LIBS@ \
430 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@ @ADNS_LIBS@
432 dftest_LDFLAGS = -export-dynamic
439 aclocal-missing/*.m4 \
443 MAINTAINERCLEANFILES = \
462 aclocal-fallback/glib-2.0.m4 \
463 aclocal-fallback/glib.m4 \
464 aclocal-fallback/gtk-2.0.m4 \
465 aclocal-fallback/gtk.m4 \
467 aclocal-missing/dummy \
474 debian/README.debian \
490 doc/README.developer \
493 doc/README.regression \
496 doc/README.xml-output \
499 doc/ethereal-filter.pod.template \
512 image/Ethereal.icns \
513 image/Makefile.nmake \
515 image/clist_ascend.xpm \
516 image/clist_descend.xpm \
518 image/editcap.rc.in \
519 image/eexcl3d64.xpm \
520 image/eicon3d16.xpm \
521 image/eicon3d32.xpm \
522 image/eicon3d48.xpm \
523 image/eicon3d64.xpm \
524 image/elogo3d48x48.png \
526 image/ethereal.rc.in \
527 image/ethereal48x48-trans.png \
528 image/ethereal48x48.png \
529 image/hi16-app-ethereal.png \
530 image/hi32-app-ethereal.png \
531 image/hi48-app-ethereal.png \
532 image/icon-ethereal.xpm \
533 image/icon-excl.xpm \
534 image/lo16-app-ethereal.png \
535 image/lo32-app-ethereal.png \
536 image/lo48-app-ethereal.png \
537 image/mergecap.rc.in \
538 image/nsis-checked.bmp \
539 image/nsis-unchecked.bmp \
540 image/stock_dialog_error_48.xpm \
541 image/stock_dialog_warning_48.xpm \
542 image/stock_dialog_question_48.xpm \
543 image/stock_dialog_info_48.xpm \
544 image/tethereal.rc.in \
545 image/text2pcap.rc.in \
546 image/toolbar/capture_24.xpm \
547 image/toolbar/cfilter_24.xpm \
548 image/toolbar/dfilter_24.xpm \
549 image/toolbar/stock_close_24.xpm \
550 image/toolbar/stock_colorselector_24.xpm \
551 image/toolbar/stock_help_24.xpm \
552 image/toolbar/stock_jump_to_24.xpm \
553 image/toolbar/stock_open_24.xpm \
554 image/toolbar/stock_preferences_24.xpm \
555 image/toolbar/stock_print_24.xpm \
556 image/toolbar/stock_refresh_24.xpm \
557 image/toolbar/stock_right_arrow_24.xpm \
558 image/toolbar/stock_save_24.xpm \
559 image/toolbar/stock_search_24.xpm \
560 image/toolbar/stock_stop_24.xpm \
574 process-x11-fields.pl \
578 text2pcap-scanner.l \
586 -chmod +s $(DESTDIR)$(bindir)/ethereal
587 -chmod +s $(DESTDIR)$(bindir)/tethereal
593 # Currently register.c can be included in the distribution because
594 # we always build all protocol dissectors. We used to have to check
595 # whether or not to build the snmp dissector. If we again need to
596 # variably build something, making register.c non-portable, uncomment
597 # the dist-hook line below.
599 # Oh, yuk. We don't want to include "register.c" in the distribution, as
600 # its contents depend on the configuration, and therefore we want it
601 # to be built when the first "make" is done; however, Automake insists
602 # on putting *all* source into the distribution.
604 # We work around this by having a "dist-hook" rule that deletes
605 # "register.c", so that "dist" won't pick it up.
608 # @rm -f $(distdir)/register.c
610 DIST_SUBDIRS = tools wiretap doc epan plugins packaging gtk help
613 SUBDIRS = tools wiretap doc epan plugins packaging help @ethereal_SUBDIRS@
615 SUBDIRS = tools wiretap doc epan packaging help @ethereal_SUBDIRS@
618 ethereal.1: ethereal doc/ethereal.pod
620 $(MAKE) ../ethereal.1 )
622 tethereal.1: tethereal doc/tethereal.pod
624 $(MAKE) ../tethereal.1 )
626 ethereal-filter.4: tethereal doc/ethereal-filter.pod.template
628 $(MAKE) ../ethereal-filter.4 )
630 editcap.1: doc/editcap.pod
632 $(MAKE) ../editcap.1 )
634 idl2eth.1: doc/idl2eth.pod
636 $(MAKE) ../idl2eth.1 )
638 mergecap.1: doc/mergecap.pod
640 $(MAKE) ../mergecap.1 )
642 text2pcap.1: doc/text2pcap.pod
644 $(MAKE) ../text2pcap.1 )
646 packet-ncp2222.c : ncp2222.py
647 $(PYTHON) $(srcdir)/ncp2222.py -o $@
649 libtool: $(LIBTOOL_DEPS)
650 $(SHELL) ./config.status --recheck
652 # We load top_stagedir with an explicit path so that libtool doesn't freak.
653 top_stagedir=`cd $(top_srcdir) && pwd`/packaging/svr4.stage
654 stagedir=$(top_stagedir)/$(PACKAGE).stage
658 svr4-package: $(bin_SCRIPTS) $(lib_LTLIBRARIES)
659 @if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
660 rm -rf $(stagedir) ; \
661 $(MAKE) DESTDIR=$(stagedir) install; \
662 $(srcdir)/packaging/svr4/mkpkg \
664 $(PACKAGE)-$(VERSION)-$(host_os)-$(host_cpu)-local \
668 echo "Error: SVR4 packaging tools not found." ; \
669 echo "Package build abandoned." ; \
672 solaris-package: svr4-package
674 rpm_topdir=`cd $(top_srcdir) && pwd`/packaging/rpm
676 if test x$(HAVE_RPM) = xyes ; then \
678 mkdir -p BUILD RPMS SOURCES ; \
680 ln -s ../../../$(distdir).tar.gz ; \
682 rpm --define "_topdir `cd . && pwd`" -bb SPECS/ethereal.spec && \
683 echo "Package successfully built in `pwd`/RPMS." ; \
685 echo "Error: RPM executable and/or source directory not found." ; \
688 if test x$(HAVE_RPM) = xyes ; then \
690 mkdir -p BUILD SRPMS SOURCES ; \
692 ln -s ../../../$(distdir).tar.gz ; \
694 rpm --define "_topdir `cd . && pwd`" -bs SPECS/ethereal.spec && \
695 echo "Package successfully built in `pwd`/SRPMS." ; \
697 echo "Error: RPM executable and/or source directory not found." ; \
700 debian-package: debian/rules
701 dpkg-buildpackage -rfakeroot -us -uc
704 rm -rf $(top_stagedir)
706 test-splint: $(ethereal_SOURCES)
708 -gnu-extensions -D_U_="" \
709 -I. `glib-config --cflags` \