2 # Automake file for Ethereal
4 # $Id: Makefile.am,v 1.332 2001/06/06 01:30:28 guy Exp $
6 # Ethereal - Network traffic analyzer
7 # By Gerald Combs <gerald@ethereal.com>
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@ @text2pcap_bin@
65 man1_MANS = @ethereal_man@ @editcap_man@ @tethereal_man@ @text2pcap_man@
68 EXTRA_PROGRAMS = ethereal ethereal_static tethereal tethereal_static editcap dftest text2pcap
139 packet-isis-hello.c \
176 packet-osi-options.c \
208 packet-smb-browse.c \
209 packet-smb-common.c \
211 packet-smb-mailslot.c \
221 packet-stat-notify.c \
258 packet-afs-macros.h \
259 packet-afs-register-info.h \
264 packet-bootparams.h \
269 packet-diameter-defs.h \
287 packet-isis-hello.h \
303 packet-osi-options.h \
317 packet-smb-browse.h \
318 packet-smb-common.h \
320 packet-smb-mailslot.h \
326 packet-stat-notify.h \
339 packet-x11-keysym.h \
346 ETHEREAL_COMMON_SRC = \
382 x11-register-info.h \
392 $(ETHEREAL_COMMON_SRC) \
410 ethereal_static_SOURCES = \
413 EXTRA_ethereal_SOURCES = \
426 # Optional objects that I know how to build. These will be
427 # linked into the ethereal executable.
428 # They will also be linked into the tethereal executable; if this
429 # list ever grows to include something that can't be linked with
430 # tethereal, or if tethereal needs something that ethereal doesn't,
431 # we should probably split this into stuff needed both
432 # by ethereal and tethereal and stuff needed only by one or the
434 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ \
435 @STRCASECMP_O@ @STRNCASECMP_O@ @MKSTEMP_O@ @STRPTIME_O@
437 # Additional libs that I know how to build. These will be
438 # linked into the ethereal executable.
439 ethereal_additional_libs = \
440 wiretap/libwiretap.a \
443 epan/ftypes/libftypes.a \
444 epan/dfilter/libdfilter.a
446 # This is the automake dependency variable for the executable
447 ethereal_DEPENDENCIES = \
448 $(ethereal_optional_objects) \
449 $(ethereal_additional_libs) \
450 plugins/gryphon/gryphon.la \
453 ethereal_static_DEPENDENCIES = \
454 $(ethereal_optional_objects) \
455 $(ethereal_additional_libs)
457 # This automake variable adds to the link-line for the executable.
459 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
460 # they are included in @GTK_LIBS@, and doesn't have to be linked with
461 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
462 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
463 # applications are X applications).
465 $(ethereal_optional_objects) \
466 $(ethereal_additional_libs) \
467 @SNMP_LIBS@ @SSL_LIBS@ \
469 "-dlopen" plugins/gryphon/gryphon.la @PCAP_LIBS@ @GTK_LIBS@ \
470 "-dlopen" plugins/mgcp/mgcp.la @PCAP_LIBS@ @GTK_LIBS@
472 ethereal_static_LDADD = \
473 $(ethereal_optional_objects) \
474 $(ethereal_additional_libs) \
475 @SNMP_LIBS@ @SSL_LIBS@ \
476 @PCAP_LIBS@ @GTK_LIBS@
478 ethereal_LDFLAGS = -export-dynamic
479 ethereal_static_LDFLAGS = -Wl,-static
481 tethereal_SOURCES = \
483 $(ETHEREAL_COMMON_SRC) \
486 tethereal_static_SOURCES = \
489 # Additional libs that I know how to build. These will be
490 # linked into the tethereal executable.
491 tethereal_additional_libs = \
492 wiretap/libwiretap.a \
494 epan/ftypes/libftypes.a \
495 epan/dfilter/libdfilter.a
497 # This is the automake dependency variable for the executable
498 tethereal_DEPENDENCIES = \
499 $(ethereal_optional_objects) \
500 $(tethereal_additional_libs) \
501 plugins/gryphon/gryphon.la \
504 tethereal_static_DEPENDENCIES = \
505 $(ethereal_optional_objects) \
506 $(tethereal_additional_libs)
508 # This automake variable adds to the link-line for the executable
509 tethereal_LDADD = wiretap/libwiretap.a \
510 $(ethereal_optional_objects) \
511 $(tethereal_additional_libs) \
512 @SNMP_LIBS@ @SSL_LIBS@ \
514 "-dlopen" plugins/gryphon/gryphon.la @GLIB_LIBS@ -lm \
515 "-dlopen" plugins/mgcp/mgcp.la @GLIB_LIBS@ -lm \
516 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
518 tethereal_static_LDADD = wiretap/libwiretap.a \
519 $(ethereal_optional_objects) \
520 $(tethereal_additional_libs) \
521 @SNMP_LIBS@ @SSL_LIBS@ \
523 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
525 tethereal_LDFLAGS = -export-dynamic
526 tethereal_static_LDFLAGS = -Wl,-static
528 text2pcap_SOURCES = text2pcap.c text2pcap-scanner.l
529 text2pcap_DEPENDENCIES = text2pcap.h
531 editcap_SOURCES = editcap.c
533 # This is the automake dependency variable for the executable
534 editcap_DEPENDENCIES = wiretap/libwiretap.a
536 # This automake variable adds to the link-line for the executable
537 editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
540 # Build various header files for the X11 dissector.
542 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
543 $(PERL) process-x11-fields.pl <x11-fields
546 # Build "register.c", which contains a function "register_all_protocols()"
547 # that calls the register routines for all protocols.
549 # We do this by grepping through sources. If that turns out to be too slow,
550 # maybe we could just require every .o file to have an register routine
551 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
553 # Formatting conventions: The name of the proto_register_* routines must
554 # start in column zero, or must be preceded only by "void " starting in
555 # column zero, and must not be inside #if.
557 # We assume that all dissector routines are in "packet-XXX.c" files.
559 # For some unknown reason, having a big "for" loop in the Makefile
560 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
561 # they seem to pass only the first few names in the list to the shell,
564 # Therefore, we have a script to generate the "register.c" file.
566 # The first argument is the directory in which the source files live.
567 # All subsequent arguments are the files to scan.
569 register.c: $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
570 @echo Making register.c
571 @$(srcdir)/make-reg-dotc $(srcdir) $(DISSECTOR_SRC)
574 ./rdps $(srcdir)/print.ps ps.c
577 $(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
580 $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
582 randpkt: randpkt.o wiretap/libwiretap.a
583 $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
588 $(ETHEREAL_COMMON_SRC) \
591 dftest_additional_libs = \
593 epan/ftypes/libftypes.a \
594 epan/dfilter/libdfilter.a
596 dftest_DEPENDENCIES = \
597 $(ethereal_optional_objects) \
598 $(dftest_additional_libs) \
599 plugins/gryphon/gryphon.la \
602 # This automake variable adds to the link-line for the executable
604 $(ethereal_optional_objects) \
605 $(dftest_additional_libs) \
606 @SNMP_LIBS@ @SSL_LIBS@ \
608 "-dlopen" plugins/gryphon/gryphon.la @GLIB_LIBS@ -lm \
609 "-dlopen" plugins/mgcp/mgcp.la @GLIB_LIBS@ -lm \
610 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
612 dftest_LDFLAGS = -export-dynamic
626 debian/README.debian \
636 doc/README.developer \
639 doc/README.regression \
644 doc/ethereal.pod.template \
646 doc/tethereal.pod.template \
650 text2pcap-scanner.l \
654 image/Makefile.nmake \
655 image/editcap.rc.in \
656 image/elogo3d48x48.png \
657 image/ethereal48x48-trans.png \
658 image/ethereal48x48.png \
660 image/ethereal.rc.in \
661 image/icon-excl.xpm \
662 image/icon-ethereal.xpm \
663 image/tethereal.rc.in \
664 image/text2pcap.rc.in \
673 process-x11-fields.pl \
689 -chmod +s $(DESTDIR)$(bindir)/ethereal
690 -chmod +s $(DESTDIR)$(bindir)/tethereal
691 -chmod +s $(DESTDIR)$(bindir)/ethereal_static
697 # Currently register.c can be included in the distribution because
698 # we always build all protocol dissectors. We used to have to check
699 # whether or not to build the snmp dissector. If we again need to
700 # variably build something, making register.c non-portable, uncomment
701 # the dist-hook line below.
703 # Oh, yuk. We don't want to include "register.c" in the distribution, as
704 # its contents depend on the configuration, and therefore we want it
705 # to be built when the first "make" is done; however, Automake insists
706 # on putting *all* source into the distribution.
708 # We work around this by having a "dist-hook" rule that deletes
709 # "register.c", so that "dist" won't pick it up.
712 # @rm -f $(distdir)/register.c
714 SUBDIRS = tools wiretap epan plugins packaging @ethereal_SUBDIRS@
716 ethereal.1: ethereal doc/ethereal.pod.template
718 $(MAKE) ../ethereal.1 )
720 tethereal.1: tethereal doc/tethereal.pod.template
722 $(MAKE) ../tethereal.1 )
724 editcap.1: doc/editcap.pod
726 $(MAKE) ../editcap.1 )
728 text2pcap.1: doc/text2pcap.pod
730 $(MAKE) ../text2pcap.1 )
732 packet-ncp2222.c : ncp2222.py
733 $(PYTHON) $(srcdir)/ncp2222.py > $@
735 libtool: $(LIBTOOL_DEPS)
736 $(SHELL) ./config.status --recheck
738 # We load top_stagedir with an explicit path so that libtool doesn't freak.
739 top_stagedir=`cd $(top_srcdir) && pwd`/packaging/svr4.stage
740 stagedir=$(top_stagedir)/$(PACKAGE).stage
744 svr4-package: $(bin_SCRIPTS) $(lib_LTLIBRARIES)
745 if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
746 rm -rf $(stagedir) ; \
747 $(MAKE) DESTDIR=$(stagedir) install-strip; \
748 $(srcdir)/packaging/svr4/mkpkg \
750 $(PACKAGE)-$(VERSION)-$(host_os)-$(host_cpu)-local \
754 echo "Error: SVR4 packaging tools not found." ; \
755 echo "Package build abandoned." ; \
758 solaris-package: svr4-package
760 specfile=$(top_srcdir)/packaging/rpm/ethereal.spec
763 if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
764 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
765 rpm -bb --clean --rmsource $(specfile) ; \
767 echo "Error: RPM executable and/or source directory not found." ; \
768 echo "Package build abandoned." ; \
772 if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
773 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
774 rpm -bs --clean --rmsource $(specfile) ; \
776 echo "Error: RPM executable and/or source directory not found." ; \
777 echo "Package build abandoned." ; \
780 debian-package: debian/rules
781 dpkg-buildpackage -rfakeroot -us -uc
784 rm -rf $(top_stagedir)