2 # Automake file for Ethereal
4 # $Id: Makefile.am,v 1.271 2001/01/11 05:41:47 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 ACLOCAL_AMFLAGS = `./aclocal-flags`
27 bin_PROGRAMS = @ethereal_bin@ @editcap_bin@ @tethereal_bin@
28 man_MANS = @ethereal_man@ @editcap_man@ @tethereal_man@
30 EXTRA_PROGRAMS = ethereal ethereal_static tethereal tethereal_static editcap
31 EXTRA_MANS = ethereal.1 tethereal.1 editcap.1
119 packet-osi-options.c \
148 packet-smb-browse.c \
149 packet-smb-common.c \
151 packet-smb-mailslot.c \
191 packet-afs-macros.h \
192 packet-afs-register-info.h \
197 packet-bootparams.h \
201 packet-diameter-defs.h \
216 packet-isis-hello.h \
230 packet-osi-options.h \
242 packet-smb-common.h \
258 packet-x11-declarations.h \
259 packet-x11-register-info.h \
260 packet-x11-keysym.h \
267 ETHEREAL_COMMON_SOURCES = \
305 $(DISSECTOR_SOURCES) \
306 $(ETHEREAL_COMMON_SOURCES) \
318 ethereal_static_SOURCES = \
321 EXTRA_ethereal_SOURCES = \
332 # Optional objects that I know how to build. These will be
333 # linked into the ethereal executable.
334 # They will also be linked into the tethereal executable; if this
335 # list ever grows to include something that can't be linked with
336 # tethereal, or if tethereal needs something that ethereal doesn't,
337 # we should probably split this into stuff needed both
338 # by ethereal and tethereal and stuff needed only by one or the
340 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ \
341 @STRCASECMP_O@ @STRNCASECMP_O@ @MKSTEMP_O@
343 # Additional libs that I know how to build. These will be
344 # linked into the ethereal executable.
345 ethereal_additional_libs = wiretap/libwiretap.a gtk/libui.a epan/libethereal.a
347 # This is the automake dependency variable for the executable
348 ethereal_DEPENDENCIES = \
349 $(ethereal_optional_objects) \
350 $(ethereal_additional_libs) \
351 plugins/gryphon/gryphon.la \
354 ethereal_static_DEPENDENCIES = \
355 $(ethereal_optional_objects) \
356 $(ethereal_additional_libs)
358 # This automake variable adds to the link-line for the executable.
360 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
361 # they are included in @GTK_LIBS@, and doesn't have to be linked with
362 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
363 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
364 # applications are X applications).
366 $(ethereal_optional_objects) \
367 $(ethereal_additional_libs) \
370 "-dlopen" plugins/gryphon/gryphon.la @PCAP_LIBS@ @GTK_LIBS@ \
371 "-dlopen" plugins/mgcp/mgcp.la @PCAP_LIBS@ @GTK_LIBS@
373 ethereal_static_LDADD = \
374 $(ethereal_optional_objects) \
375 $(ethereal_additional_libs) \
377 @PCAP_LIBS@ @GTK_LIBS@
379 ethereal_LDFLAGS = -export-dynamic
380 ethereal_static_LDFLAGS = -Wl,-static
382 tethereal_SOURCES = \
383 $(DISSECTOR_SOURCES) \
384 $(ETHEREAL_COMMON_SOURCES) \
387 tethereal_static_SOURCES = \
390 # Additional libs that I know how to build. These will be
391 # linked into the tethereal executable.
392 tethereal_additional_libs = wiretap/libwiretap.a epan/libethereal.a
394 # This is the automake dependency variable for the executable
395 tethereal_DEPENDENCIES = \
396 $(ethereal_optional_objects) \
397 $(tethereal_additional_libs) \
398 plugins/gryphon/gryphon.la \
401 tethereal_static_DEPENDENCIES = \
402 $(ethereal_optional_objects) \
403 $(tethereal_additional_libs)
405 # This automake variable adds to the link-line for the executable
406 tethereal_LDADD = wiretap/libwiretap.a \
407 $(ethereal_optional_objects) \
408 $(tethereal_additional_libs) \
411 "-dlopen" plugins/gryphon/gryphon.la @GLIB_LIBS@ -lm \
412 "-dlopen" plugins/mgcp/mgcp.la @GLIB_LIBS@ -lm \
413 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
415 tethereal_static_LDADD = wiretap/libwiretap.a \
416 $(ethereal_optional_objects) \
417 $(tethereal_additional_libs) \
420 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
422 tethereal_LDFLAGS = -export-dynamic
423 tethereal_static_LDFLAGS = -Wl,-static
425 editcap_SOURCES = editcap.c
427 # This is the automake dependency variable for the executable
428 editcap_DEPENDENCIES = wiretap/libwiretap.a
430 # This automake variable adds to the link-line for the executable
431 editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
434 # Build "register.c", which contains a function "register_all_protocols()"
435 # that calls the register routines for all protocols.
437 # We do this by grepping through sources. If that turns out to be too slow,
438 # maybe we could just require every .o file to have an register routine
439 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
441 # Formatting conventions: The name of the proto_register_* routines must
442 # start in column zero, or must be preceded only by "void " starting in
443 # column zero, and must not be inside #if.
445 # We assume that all dissector routines are in "packet-XXX.c" files.
447 # For some unknown reason, having a big "for" loop in the Makefile
448 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
449 # they seem to pass only the first few names in the list to the shell,
452 # Therefore, we have a script to generate the "register.c" file.
454 # The first argument is the directory in which the source files live.
455 # All subsequent arguments are the files to scan.
457 register.c: $(DISSECTOR_SOURCES) $(srcdir)/make-reg-dotc
458 @echo Making register.c
459 @$(srcdir)/make-reg-dotc $(srcdir) $(DISSECTOR_SOURCES)
462 ./rdps $(srcdir)/print.ps ps.c
465 $(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
468 $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
470 randpkt: randpkt.o wiretap/libwiretap.a
471 $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
483 debian/README.debian \
493 doc/README.developer \
496 doc/README.regression \
500 doc/ethereal.pod.template \
502 doc/tethereal.pod.template \
508 image/ethereal48x48-trans.png \
509 image/ethereal48x48.png \
512 image/icon-excl.xpm \
513 image/icon-ethereal.xpm \
516 libpcap-0.4.HPUX.HPUXPAC.patch \
517 libpcap-0.4.HPUX.LBL.patch \
518 libpcap-0.5.HPUX.tcpdump.org.patch \
539 -chmod +s $(DESTDIR)$(bindir)/ethereal
540 -chmod +s $(DESTDIR)$(bindir)/tethereal
541 -chmod +s $(DESTDIR)$(bindir)/ethereal_static
547 # Currently register.c can be included in the distribution because
548 # we always build all protocol dissectors. We used to have to check
549 # whether or not to build the snmp dissector. If we again need to
550 # variably build something, making register.c non-portable, uncomment
551 # the dist-hook line below.
553 # Oh, yuk. We don't want to include "register.c" in the distribution, as
554 # its contents depend on the configuration, and therefore we want it
555 # to be built when the first "make" is done; however, Automake insists
556 # on putting *all* source into the distribution.
558 # We work around this by having a "dist-hook" rule that deletes
559 # "register.c", so that "dist" won't pick it up.
562 # @rm -f $(distdir)/register.c
564 SUBDIRS = wiretap epan plugins packaging @ethereal_SUBDIRS@
566 ethereal.1: ethereal doc/ethereal.pod.template
568 $(MAKE) ../ethereal.1 )
570 tethereal.1: tethereal doc/tethereal.pod.template
572 $(MAKE) ../tethereal.1 )
574 editcap.1: doc/editcap.pod
576 $(MAKE) ../editcap.1 )
578 packet-ncp2222.c : ncp2222.py
579 $(PYTHON) $(srcdir)/ncp2222.py > $@
581 libtool: $(LIBTOOL_DEPS)
582 $(SHELL) ./config.status --recheck
584 # We load top_stagedir with an explicit path so that libtool doesn't freak.
585 top_stagedir=`cd $(top_srcdir) && pwd`/packaging/svr4.stage
586 stagedir=$(top_stagedir)/$(PACKAGE).stage
590 svr4-package: $(bin_SCRIPTS) $(lib_LTLIBRARIES)
591 if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
592 rm -rf $(stagedir) ; \
593 $(MAKE) DESTDIR=$(stagedir) install-strip; \
594 $(srcdir)/packaging/svr4/mkpkg \
596 $(PACKAGE)-$(VERSION)-$(host_os)-$(host_cpu)-local \
600 echo "Error: SVR4 packaging tools not found." ; \
601 echo "Package build abandoned." ; \
604 solaris-package: svr4-package
606 specfile=$(top_srcdir)/packaging/rpm/ethereal.spec
609 if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
610 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
611 rpm -bb --clean --rmsource $(specfile) ; \
613 echo "Error: RPM executable and/or source directory not found." ; \
614 echo "Package build abandoned." ; \
618 if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
619 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
620 rpm -bs --clean --rmsource $(specfile) ; \
622 echo "Error: RPM executable and/or source directory not found." ; \
623 echo "Package build abandoned." ; \
626 debian-package: debian/rules
627 dpkg-buildpackage -rfakeroot -us -uc
630 rm -rf $(top_stagedir)