2 # Automake file for Ethereal
4 # $Id: Makefile.am,v 1.157 2000/01/18 20:35:40 guy Exp $
6 # Ethereal - Network traffic analyzer
7 # By Gerald Combs <gerald@zing.org>
8 # Copyright 1998 Gerald Combs
11 # This program is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU General Public License
13 # as published by the Free Software Foundation; either version 2
14 # of the License, or (at your option) any later version.
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 bin_PROGRAMS = ethereal editcap tethereal
27 man_MANS = ethereal.1 editcap.1 tethereal.1
31 # Any POSIX-compatible YACC should honor the -p flag
173 ETHEREAL_COMMON_SOURCES = \
220 $(DISSECTOR_SOURCES) \
221 $(ETHEREAL_COMMON_SOURCES) \
235 EXTRA_ethereal_SOURCES = \
251 # Optional objects that I know how to build. These will be
252 # linked into the ethereal executable.
253 # They will also be linked into the tethereal executable; if this
254 # list ever grows to include something that can't be linked with
255 # tethereal, or if tethereal needs something that ethereal doesn't,
256 # we should probably split this into stuff needed both
257 # by ethereal and tethereal and stuff needed only by one or the
259 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ @STRNCASECMP_O@ @MKSTEMP_O@ \
260 @INET_ATON_O@ @INET_PTON_O@ @INET_NTOP_O@
262 # Additional libs that I know how to build. These will be
263 # linked into the ethereal executable.
264 ethereal_additional_libs = wiretap/libwiretap.a gtk/libui.a
266 # This is the automake dependency variable for the executable
267 ethereal_DEPENDENCIES = \
268 $(ethereal_optional_objects) \
269 $(ethereal_additional_libs) \
270 plugins/gryphon/gryphon.la
272 # This automake variable adds to the link-line for the executable.
274 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
275 # they are included in @GTK_LIBS@, and doesn't have to be linked with
276 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
277 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
278 # applications are X applications).
280 $(ethereal_optional_objects) \
281 $(ethereal_additional_libs) \
284 "-dlopen" plugins/gryphon/gryphon.la @PCAP_LIBS@ @GTK_LIBS@
286 ethereal_LDFLAGS = -export-dynamic
288 tethereal_SOURCES = \
289 $(DISSECTOR_SOURCES) \
290 $(ETHEREAL_COMMON_SOURCES) \
293 # Additional libs that I know how to build. These will be
294 # linked into the tethereal executable.
295 tethereal_additional_libs = wiretap/libwiretap.a
297 # This is the automake dependency variable for the executable
298 tethereal_DEPENDENCIES = \
299 $(ethereal_optional_objects) \
300 $(tethereal_additional_libs) \
301 plugins/gryphon/gryphon.la
303 # This automake variable adds to the link-line for the executable
304 tethereal_LDADD = wiretap/libwiretap.a \
305 $(ethereal_optional_objects) \
306 $(tethereal_additional_libs) \
309 "-dlopen" plugins/gryphon/gryphon.la @GLIB_LIBS@ -lm \
310 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
312 tethereal_LDFLAGS = -export-dynamic
314 editcap_SOURCES = editcap.c
316 # This is the automake dependency variable for the executable
317 editcap_DEPENDENCIES = wiretap/libwiretap.a
319 # This automake variable adds to the link-line for the executable
320 editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
323 # Build "register.c", which contains a function "register_all_protocols()"
324 # that calls the register routines for all protocols.
326 # We do this by grepping through sources. If that turns out to be too slow,
327 # maybe we could just require every .o file to have an register routine
328 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
330 # Formatting conventions: The name of the proto_register_* routines must
331 # start in column zero, or must be preceded only by "void " starting in
332 # column zero, and must not be inside #if.
334 # We assume that all dissector routines are in "packet-XXX.c" files,
337 # For some unknown reason, having a big "for" loop in the Makefile
338 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
339 # they seem to pass only the first few names in the list to the shell,
342 # Therefore, we have a script to generate the "register.c" file.
344 # The first argument is the directory in which the source files live.
345 # All subsequent arguments are the files to scan.
347 register.c: packet.c $(DISSECTOR_SOURCES)
348 @echo Making register.c
349 @$(srcdir)/make-reg-dotc $(srcdir) packet.c $(DISSECTOR_SOURCES)
352 ./rdps $(srcdir)/print.ps ps.c
355 $(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
358 $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
360 randpkt: randpkt.o wiretap/libwiretap.a
361 $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
375 doc/ethereal.pod.template \
378 doc/tethereal.pod.template \
381 image/ethereal48x48-trans.png \
382 image/ethereal48x48.png \
383 image/icon-excl.xpm \
384 image/icon-ethereal.xpm \
402 # Currently register.c can be included in the distribution because
403 # we always build all protocol dissectors. We used to have to check
404 # whether or not to build the snmp dissector. If we again need to
405 # variably build something, making register.c non-portable, uncomment
406 # the dist-hook line below.
408 # Oh, yuk. We don't want to include "register.c" in the distribution, as
409 # its contents depend on the configuration, and therefore we want it
410 # to be built when the first "make" is done; however, Automake insists
411 # on putting *all* source into the distribution.
413 # We work around this by having a "dist-hook" rule that deletes
414 # "register.c", so that "dist" won't pick it up.
417 # @rm -f $(distdir)/register.c
419 SUBDIRS = wiretap gtk plugins @ethereal_SUBDIRS@
421 ethereal.1: ethereal doc/ethereal.pod.template
423 $(MAKE) ../ethereal.1 )
425 tethereal.1: tethereal doc/tethereal.pod.template
427 $(MAKE) ../tethereal.1 )
429 editcap.1: doc/editcap.pod
431 $(MAKE) ../editcap.1 )
433 dfilter-scanner.c : dfilter-scanner.l
434 $(LEX) -Pdfilter_ -t $(srcdir)/dfilter-scanner.l > dfilter-scanner.c
436 libtool: $(LIBTOOL_DEPS)
437 $(SHELL) ./config.status --recheck