2 # Automake file for Ethereal
4 # $Id: Makefile.am,v 1.149 2000/01/13 00:41:10 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
27 man_MANS = ethereal.1 editcap.1
31 # Any POSIX-compatible YACC should honor the -p flag
34 ## use @LIBLTDL@ because some broken makes do not accept macros in targets
35 ## we can only do this because our LIBLTDL does not contain ${top_builddir}
36 @LIBLTDL@: libtool libltdl/libtool libltdl/config.h \
37 $(srcdir)/libltdl/ltdl.c $(srcdir)/libltdl/ltdl.h
38 (cd libltdl; $(MAKE) `echo $(LIBLTDL) | sed 's,.*\.\./libltdl/,,g'`)
39 # Without the following line, the check may fail if libltdl/libtool is
40 # removed after libltdl is configured
41 libltdl/libtool libltdl/config.h:
241 EXTRA_ethereal_SOURCES = \
256 # Optional objects that I know how to build. These will be
257 # linked into the ethereal executable.
258 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ @STRNCASECMP_O@ @MKSTEMP_O@ \
259 @INET_ATON_O@ @INET_PTON_O@ @INET_NTOP_O@
261 # Additional libs that I know how to build. These will be
262 # linked into the ethereal executable.
263 ethereal_additional_libs = wiretap/libwiretap.a gtk/libui.a
265 # This is the automake dependency variable for the executable
266 ethereal_DEPENDENCIES = \
267 $(ethereal_optional_objects) \
268 $(ethereal_additional_libs) \
270 plugins/gryphon/gryphon.la
272 # This automake variable adds to the link-line for the executable
274 $(ethereal_optional_objects) \
275 $(ethereal_additional_libs) \
277 @LIBLTDL@ "-dlopen" self \
278 "-dlopen" plugins/gryphon/gryphon.la @GTK_LIBS@
280 ethereal_LDFLAGS = -export-dynamic
282 editcap_SOURCES = editcap.c
283 editcap_DEPENDENCIES = wiretap/libwiretap.a
284 editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
287 # Build "register.c", which contains a function "register_all_protocols()"
288 # that calls the register routines for all protocols.
290 # We do this by grepping through sources. If that turns out to be too slow,
291 # maybe we could just require every .o file to have an register routine
292 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
294 # Formatting conventions: The name of the proto_register_* routines must
295 # start in column zero, or must be preceded only by "void " starting in
296 # column zero, and must not be inside #if.
298 # We assume that all dissector routines are in "packet-XXX.c" files,
301 # For some unknown reason, having a big "for" loop in the Makefile
302 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
303 # they seem to pass only the first few names in the list to the shell,
306 # Therefore, we have a script to generate the "register.c" file.
308 # The first argument is the directory in which the source files live.
309 # All subsequent arguments are the files to scan.
311 register.c: packet.c $(DISSECTOR_SOURCES)
312 @echo Making register.c
313 @$(srcdir)/make-reg-dotc $(srcdir) packet.c $(DISSECTOR_SOURCES)
316 ./rdps $(srcdir)/print.ps ps.c
319 $(CC) -o rdps $(srcdir)/rdps.c
322 $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
324 randpkt: randpkt.o wiretap/libwiretap.a
325 $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
338 doc/ethereal.pod.template \
343 image/ethereal48x48-trans.png \
344 image/ethereal48x48.png \
345 image/icon-excl.xpm \
346 image/icon-ethereal.xpm \
364 # Oh, yuk. We don't want to include "register.c" in the distribution, as
365 # its contents depend on the configuration, and therefore we want it
366 # to be built when the first "make" is done; however, Automake insists
367 # on putting *all* source into the distribution.
369 # We work around this by having a "dist-hook" rule that deletes
370 # "register.c", so that "dist" won't pick it up.
373 @rm -f $(distdir)/register.c
375 SUBDIRS = wiretap gtk plugins libltdl @ethereal_SUBDIRS@
377 ethereal.1: ethereal doc/ethereal.pod.template
379 $(MAKE) ../ethereal.1 )
381 editcap.1: doc/editcap.pod
383 $(MAKE) ../editcap.1 )
385 dfilter-scanner.c : dfilter-scanner.l
386 $(LEX) -Pdfilter_ -t $(srcdir)/dfilter-scanner.l > dfilter-scanner.c
388 INCLUDES = -I$(srcdir)/libltdl
390 libtool: $(LIBTOOL_DEPS)
391 $(SHELL) ./config.status --recheck