2 # Automake file for Ethereal
4 # $Id: Makefile.am,v 1.284 2001/02/13 00:17:54 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`
28 # This is a hideous hack.
30 # Automake needs to know into which sections to install various man
31 # pages; if the names in "man_MANS" have suffixes, it can infer the
32 # sections from the name (e.g., "hello.1" goes in section 1), but if
33 # they don't have suffixes, it can't tell what sections to put them, and
34 # it just gives up and doesn't create any rules to install them (and it
35 # gives up silently, so you have no clue what's wrong).
37 # Therefore, we can't just set "man_MANS" to a list of variables to be
38 # filled in by the configure script, as those variables don't have man
39 # page section numbers.
41 # It turns out (although this is not documented anywhere I could find
42 # in the automake Info file) that if you define, instead, variables with
43 # names like "man{section}_MANS", automake will infer that the names in
44 # those variables are the names of man pages to be installed in section
47 # So, as all our man pages go in section 1, we define "man1_MANS" to
48 # contain all the man page.
50 # *However*, if "man_MANS" isn't defined at all, automake concludes that
51 # there are no man pages, the fact that, say, "man1_MANS" is defined
52 # nonwithstanding! (I suspect this is the result of a mistaken attempt
53 # to get people to fix their automake files not to use "MANS"; if "MANS"
54 # is defined, it prints a warning and sets the exit status, but doesn't
55 # exit, and then it just gives up if "man_MANS" isn't defined,
56 # presumably on the theory that the only reason it wouldn't be defined
57 # is because the automake file uses the obsolete "MANS" variable instead
58 # of the shiny new "man_MANS" variable.)
60 # So we also define "man_MANS", but don't define it as anything;
61 # automake will arrange that the Makefile define it as the union of all
62 # the "man{section}_MANS" variables.
64 bin_PROGRAMS = @ethereal_bin@ @editcap_bin@ @tethereal_bin@ @dftest_bin@ @randpkt_bin@
65 man1_MANS = @ethereal_man@ @editcap_man@ @tethereal_man@
68 EXTRA_PROGRAMS = ethereal ethereal_static tethereal tethereal_static editcap dftest
128 packet-isis-hello.c \
159 packet-osi-options.c \
188 packet-smb-browse.c \
189 packet-smb-common.c \
191 packet-smb-mailslot.c \
234 packet-afs-macros.h \
235 packet-afs-register-info.h \
240 packet-bootparams.h \
244 packet-diameter-defs.h \
262 packet-isis-hello.h \
276 packet-osi-options.h \
289 packet-smb-common.h \
306 packet-x11-declarations.h \
307 packet-x11-register-info.h \
308 packet-x11-keysym.h \
314 ETHEREAL_COMMON_SOURCES = \
353 $(DISSECTOR_SOURCES) \
354 $(ETHEREAL_COMMON_SOURCES) \
368 ethereal_static_SOURCES = \
371 EXTRA_ethereal_SOURCES = \
382 # Optional objects that I know how to build. These will be
383 # linked into the ethereal executable.
384 # They will also be linked into the tethereal executable; if this
385 # list ever grows to include something that can't be linked with
386 # tethereal, or if tethereal needs something that ethereal doesn't,
387 # we should probably split this into stuff needed both
388 # by ethereal and tethereal and stuff needed only by one or the
390 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ \
391 @STRCASECMP_O@ @STRNCASECMP_O@ @MKSTEMP_O@
393 # Additional libs that I know how to build. These will be
394 # linked into the ethereal executable.
395 ethereal_additional_libs = \
396 wiretap/libwiretap.a \
399 epan/ftypes/libftypes.a \
400 epan/dfilter/libdfilter.a
402 # This is the automake dependency variable for the executable
403 ethereal_DEPENDENCIES = \
404 $(ethereal_optional_objects) \
405 $(ethereal_additional_libs) \
406 plugins/gryphon/gryphon.la \
409 ethereal_static_DEPENDENCIES = \
410 $(ethereal_optional_objects) \
411 $(ethereal_additional_libs)
413 # This automake variable adds to the link-line for the executable.
415 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
416 # they are included in @GTK_LIBS@, and doesn't have to be linked with
417 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
418 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
419 # applications are X applications).
421 $(ethereal_optional_objects) \
422 $(ethereal_additional_libs) \
425 "-dlopen" plugins/gryphon/gryphon.la @PCAP_LIBS@ @GTK_LIBS@ \
426 "-dlopen" plugins/mgcp/mgcp.la @PCAP_LIBS@ @GTK_LIBS@
428 ethereal_static_LDADD = \
429 $(ethereal_optional_objects) \
430 $(ethereal_additional_libs) \
432 @PCAP_LIBS@ @GTK_LIBS@
434 ethereal_LDFLAGS = -export-dynamic
435 ethereal_static_LDFLAGS = -Wl,-static
437 tethereal_SOURCES = \
438 $(DISSECTOR_SOURCES) \
439 $(ETHEREAL_COMMON_SOURCES) \
442 tethereal_static_SOURCES = \
445 # Additional libs that I know how to build. These will be
446 # linked into the tethereal executable.
447 tethereal_additional_libs = \
448 wiretap/libwiretap.a \
450 epan/ftypes/libftypes.a \
451 epan/dfilter/libdfilter.a
453 # This is the automake dependency variable for the executable
454 tethereal_DEPENDENCIES = \
455 $(ethereal_optional_objects) \
456 $(tethereal_additional_libs) \
457 plugins/gryphon/gryphon.la \
460 tethereal_static_DEPENDENCIES = \
461 $(ethereal_optional_objects) \
462 $(tethereal_additional_libs)
464 # This automake variable adds to the link-line for the executable
465 tethereal_LDADD = wiretap/libwiretap.a \
466 $(ethereal_optional_objects) \
467 $(tethereal_additional_libs) \
470 "-dlopen" plugins/gryphon/gryphon.la @GLIB_LIBS@ -lm \
471 "-dlopen" plugins/mgcp/mgcp.la @GLIB_LIBS@ -lm \
472 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
474 tethereal_static_LDADD = wiretap/libwiretap.a \
475 $(ethereal_optional_objects) \
476 $(tethereal_additional_libs) \
479 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
481 tethereal_LDFLAGS = -export-dynamic
482 tethereal_static_LDFLAGS = -Wl,-static
484 editcap_SOURCES = editcap.c
486 # This is the automake dependency variable for the executable
487 editcap_DEPENDENCIES = wiretap/libwiretap.a
489 # This automake variable adds to the link-line for the executable
490 editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
493 # Build "register.c", which contains a function "register_all_protocols()"
494 # that calls the register routines for all protocols.
496 # We do this by grepping through sources. If that turns out to be too slow,
497 # maybe we could just require every .o file to have an register routine
498 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
500 # Formatting conventions: The name of the proto_register_* routines must
501 # start in column zero, or must be preceded only by "void " starting in
502 # column zero, and must not be inside #if.
504 # We assume that all dissector routines are in "packet-XXX.c" files.
506 # For some unknown reason, having a big "for" loop in the Makefile
507 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
508 # they seem to pass only the first few names in the list to the shell,
511 # Therefore, we have a script to generate the "register.c" file.
513 # The first argument is the directory in which the source files live.
514 # All subsequent arguments are the files to scan.
516 register.c: $(DISSECTOR_SOURCES) $(srcdir)/make-reg-dotc
517 @echo Making register.c
518 @$(srcdir)/make-reg-dotc $(srcdir) $(DISSECTOR_SOURCES)
521 ./rdps $(srcdir)/print.ps ps.c
524 $(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
527 $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
529 randpkt: randpkt.o wiretap/libwiretap.a
530 $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
534 $(DISSECTOR_SOURCES) \
535 $(ETHEREAL_COMMON_SOURCES) \
538 dftest_additional_libs = \
540 epan/ftypes/libftypes.a \
541 epan/dfilter/libdfilter.a
543 dftest_DEPENDENCIES = \
544 $(ethereal_optional_objects) \
545 $(dftest_additional_libs) \
546 plugins/gryphon/gryphon.la \
549 # This automake variable adds to the link-line for the executable
551 $(ethereal_optional_objects) \
552 $(dftest_additional_libs) \
555 "-dlopen" plugins/gryphon/gryphon.la @GLIB_LIBS@ -lm \
556 "-dlopen" plugins/mgcp/mgcp.la @GLIB_LIBS@ -lm \
557 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
559 dftest_LDFLAGS = -export-dynamic
571 debian/README.debian \
581 doc/README.developer \
584 doc/README.regression \
588 doc/ethereal.pod.template \
590 doc/tethereal.pod.template \
596 image/ethereal48x48-trans.png \
597 image/ethereal48x48.png \
600 image/icon-excl.xpm \
601 image/icon-ethereal.xpm \
604 libpcap-0.4.HPUX.HPUXPAC.patch \
605 libpcap-0.4.HPUX.LBL.patch \
606 libpcap-0.5.HPUX.tcpdump.org.patch \
628 -chmod +s $(DESTDIR)$(bindir)/ethereal
629 -chmod +s $(DESTDIR)$(bindir)/tethereal
630 -chmod +s $(DESTDIR)$(bindir)/ethereal_static
636 # Currently register.c can be included in the distribution because
637 # we always build all protocol dissectors. We used to have to check
638 # whether or not to build the snmp dissector. If we again need to
639 # variably build something, making register.c non-portable, uncomment
640 # the dist-hook line below.
642 # Oh, yuk. We don't want to include "register.c" in the distribution, as
643 # its contents depend on the configuration, and therefore we want it
644 # to be built when the first "make" is done; however, Automake insists
645 # on putting *all* source into the distribution.
647 # We work around this by having a "dist-hook" rule that deletes
648 # "register.c", so that "dist" won't pick it up.
651 # @rm -f $(distdir)/register.c
653 SUBDIRS = tools wiretap epan plugins packaging @ethereal_SUBDIRS@
655 ethereal.1: ethereal doc/ethereal.pod.template
657 $(MAKE) ../ethereal.1 )
659 tethereal.1: tethereal doc/tethereal.pod.template
661 $(MAKE) ../tethereal.1 )
663 editcap.1: doc/editcap.pod
665 $(MAKE) ../editcap.1 )
667 packet-ncp2222.c : ncp2222.py
668 $(PYTHON) $(srcdir)/ncp2222.py > $@
670 libtool: $(LIBTOOL_DEPS)
671 $(SHELL) ./config.status --recheck
673 # We load top_stagedir with an explicit path so that libtool doesn't freak.
674 top_stagedir=`cd $(top_srcdir) && pwd`/packaging/svr4.stage
675 stagedir=$(top_stagedir)/$(PACKAGE).stage
679 svr4-package: $(bin_SCRIPTS) $(lib_LTLIBRARIES)
680 if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
681 rm -rf $(stagedir) ; \
682 $(MAKE) DESTDIR=$(stagedir) install-strip; \
683 $(srcdir)/packaging/svr4/mkpkg \
685 $(PACKAGE)-$(VERSION)-$(host_os)-$(host_cpu)-local \
689 echo "Error: SVR4 packaging tools not found." ; \
690 echo "Package build abandoned." ; \
693 solaris-package: svr4-package
695 specfile=$(top_srcdir)/packaging/rpm/ethereal.spec
698 if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
699 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
700 rpm -bb --clean --rmsource $(specfile) ; \
702 echo "Error: RPM executable and/or source directory not found." ; \
703 echo "Package build abandoned." ; \
707 if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
708 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
709 rpm -bs --clean --rmsource $(specfile) ; \
711 echo "Error: RPM executable and/or source directory not found." ; \
712 echo "Package build abandoned." ; \
715 debian-package: debian/rules
716 dpkg-buildpackage -rfakeroot -us -uc
719 rm -rf $(top_stagedir)