2 # Automake file for Ethereal
4 # $Id: Makefile.am,v 1.329 2001/05/30 18:52:36 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
138 packet-isis-hello.c \
175 packet-osi-options.c \
207 packet-smb-browse.c \
208 packet-smb-common.c \
210 packet-smb-mailslot.c \
220 packet-stat-notify.c \
257 packet-afs-macros.h \
258 packet-afs-register-info.h \
263 packet-bootparams.h \
268 packet-diameter-defs.h \
285 packet-isis-hello.h \
301 packet-osi-options.h \
315 packet-smb-browse.h \
316 packet-smb-common.h \
318 packet-smb-mailslot.h \
324 packet-stat-notify.h \
337 packet-x11-keysym.h \
344 ETHEREAL_COMMON_SRC = \
380 x11-register-info.h \
390 $(ETHEREAL_COMMON_SRC) \
407 ethereal_static_SOURCES = \
410 EXTRA_ethereal_SOURCES = \
421 # Optional objects that I know how to build. These will be
422 # linked into the ethereal executable.
423 # They will also be linked into the tethereal executable; if this
424 # list ever grows to include something that can't be linked with
425 # tethereal, or if tethereal needs something that ethereal doesn't,
426 # we should probably split this into stuff needed both
427 # by ethereal and tethereal and stuff needed only by one or the
429 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ \
430 @STRCASECMP_O@ @STRNCASECMP_O@ @MKSTEMP_O@
432 # Additional libs that I know how to build. These will be
433 # linked into the ethereal executable.
434 ethereal_additional_libs = \
435 wiretap/libwiretap.a \
438 epan/ftypes/libftypes.a \
439 epan/dfilter/libdfilter.a
441 # This is the automake dependency variable for the executable
442 ethereal_DEPENDENCIES = \
443 $(ethereal_optional_objects) \
444 $(ethereal_additional_libs) \
445 plugins/gryphon/gryphon.la \
448 ethereal_static_DEPENDENCIES = \
449 $(ethereal_optional_objects) \
450 $(ethereal_additional_libs)
452 # This automake variable adds to the link-line for the executable.
454 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
455 # they are included in @GTK_LIBS@, and doesn't have to be linked with
456 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
457 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
458 # applications are X applications).
460 $(ethereal_optional_objects) \
461 $(ethereal_additional_libs) \
462 @SNMP_LIBS@ @SSL_LIBS@ \
464 "-dlopen" plugins/gryphon/gryphon.la @PCAP_LIBS@ @GTK_LIBS@ \
465 "-dlopen" plugins/mgcp/mgcp.la @PCAP_LIBS@ @GTK_LIBS@
467 ethereal_static_LDADD = \
468 $(ethereal_optional_objects) \
469 $(ethereal_additional_libs) \
470 @SNMP_LIBS@ @SSL_LIBS@ \
471 @PCAP_LIBS@ @GTK_LIBS@
473 ethereal_LDFLAGS = -export-dynamic
474 ethereal_static_LDFLAGS = -Wl,-static
476 tethereal_SOURCES = \
478 $(ETHEREAL_COMMON_SRC) \
481 tethereal_static_SOURCES = \
484 # Additional libs that I know how to build. These will be
485 # linked into the tethereal executable.
486 tethereal_additional_libs = \
487 wiretap/libwiretap.a \
489 epan/ftypes/libftypes.a \
490 epan/dfilter/libdfilter.a
492 # This is the automake dependency variable for the executable
493 tethereal_DEPENDENCIES = \
494 $(ethereal_optional_objects) \
495 $(tethereal_additional_libs) \
496 plugins/gryphon/gryphon.la \
499 tethereal_static_DEPENDENCIES = \
500 $(ethereal_optional_objects) \
501 $(tethereal_additional_libs)
503 # This automake variable adds to the link-line for the executable
504 tethereal_LDADD = wiretap/libwiretap.a \
505 $(ethereal_optional_objects) \
506 $(tethereal_additional_libs) \
507 @SNMP_LIBS@ @SSL_LIBS@ \
509 "-dlopen" plugins/gryphon/gryphon.la @GLIB_LIBS@ -lm \
510 "-dlopen" plugins/mgcp/mgcp.la @GLIB_LIBS@ -lm \
511 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
513 tethereal_static_LDADD = wiretap/libwiretap.a \
514 $(ethereal_optional_objects) \
515 $(tethereal_additional_libs) \
516 @SNMP_LIBS@ @SSL_LIBS@ \
518 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
520 tethereal_LDFLAGS = -export-dynamic
521 tethereal_static_LDFLAGS = -Wl,-static
523 text2pcap_SOURCES = text2pcap.c text2pcap-scanner.l
524 text2pcap_DEPENDENCIES = text2pcap.h
526 editcap_SOURCES = editcap.c
528 # This is the automake dependency variable for the executable
529 editcap_DEPENDENCIES = wiretap/libwiretap.a
531 # This automake variable adds to the link-line for the executable
532 editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
535 # Build various header files for the X11 dissector.
537 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
538 $(PERL) process-x11-fields.pl <x11-fields
541 # Build "register.c", which contains a function "register_all_protocols()"
542 # that calls the register routines for all protocols.
544 # We do this by grepping through sources. If that turns out to be too slow,
545 # maybe we could just require every .o file to have an register routine
546 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
548 # Formatting conventions: The name of the proto_register_* routines must
549 # start in column zero, or must be preceded only by "void " starting in
550 # column zero, and must not be inside #if.
552 # We assume that all dissector routines are in "packet-XXX.c" files.
554 # For some unknown reason, having a big "for" loop in the Makefile
555 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
556 # they seem to pass only the first few names in the list to the shell,
559 # Therefore, we have a script to generate the "register.c" file.
561 # The first argument is the directory in which the source files live.
562 # All subsequent arguments are the files to scan.
564 register.c: $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
565 @echo Making register.c
566 @$(srcdir)/make-reg-dotc $(srcdir) $(DISSECTOR_SRC)
569 ./rdps $(srcdir)/print.ps ps.c
572 $(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
575 $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
577 randpkt: randpkt.o wiretap/libwiretap.a
578 $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
583 $(ETHEREAL_COMMON_SRC) \
586 dftest_additional_libs = \
588 epan/ftypes/libftypes.a \
589 epan/dfilter/libdfilter.a
591 dftest_DEPENDENCIES = \
592 $(ethereal_optional_objects) \
593 $(dftest_additional_libs) \
594 plugins/gryphon/gryphon.la \
597 # This automake variable adds to the link-line for the executable
599 $(ethereal_optional_objects) \
600 $(dftest_additional_libs) \
601 @SNMP_LIBS@ @SSL_LIBS@ \
603 "-dlopen" plugins/gryphon/gryphon.la @GLIB_LIBS@ -lm \
604 "-dlopen" plugins/mgcp/mgcp.la @GLIB_LIBS@ -lm \
605 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
607 dftest_LDFLAGS = -export-dynamic
621 debian/README.debian \
631 doc/README.developer \
634 doc/README.regression \
639 doc/ethereal.pod.template \
641 doc/tethereal.pod.template \
645 text2pcap-scanner.l \
649 image/Makefile.nmake \
650 image/editcap.rc.in \
651 image/elogo3d48x48.png \
652 image/ethereal48x48-trans.png \
653 image/ethereal48x48.png \
655 image/ethereal.rc.in \
656 image/icon-excl.xpm \
657 image/icon-ethereal.xpm \
658 image/tethereal.rc.in \
659 image/text2pcap.rc.in \
668 process-x11-fields.pl \
684 -chmod +s $(DESTDIR)$(bindir)/ethereal
685 -chmod +s $(DESTDIR)$(bindir)/tethereal
686 -chmod +s $(DESTDIR)$(bindir)/ethereal_static
692 # Currently register.c can be included in the distribution because
693 # we always build all protocol dissectors. We used to have to check
694 # whether or not to build the snmp dissector. If we again need to
695 # variably build something, making register.c non-portable, uncomment
696 # the dist-hook line below.
698 # Oh, yuk. We don't want to include "register.c" in the distribution, as
699 # its contents depend on the configuration, and therefore we want it
700 # to be built when the first "make" is done; however, Automake insists
701 # on putting *all* source into the distribution.
703 # We work around this by having a "dist-hook" rule that deletes
704 # "register.c", so that "dist" won't pick it up.
707 # @rm -f $(distdir)/register.c
709 SUBDIRS = tools wiretap epan plugins packaging @ethereal_SUBDIRS@
711 ethereal.1: ethereal doc/ethereal.pod.template
713 $(MAKE) ../ethereal.1 )
715 tethereal.1: tethereal doc/tethereal.pod.template
717 $(MAKE) ../tethereal.1 )
719 editcap.1: doc/editcap.pod
721 $(MAKE) ../editcap.1 )
723 text2pcap.1: doc/text2pcap.pod
725 $(MAKE) ../text2pcap.1 )
727 packet-ncp2222.c : ncp2222.py
728 $(PYTHON) $(srcdir)/ncp2222.py > $@
730 libtool: $(LIBTOOL_DEPS)
731 $(SHELL) ./config.status --recheck
733 # We load top_stagedir with an explicit path so that libtool doesn't freak.
734 top_stagedir=`cd $(top_srcdir) && pwd`/packaging/svr4.stage
735 stagedir=$(top_stagedir)/$(PACKAGE).stage
739 svr4-package: $(bin_SCRIPTS) $(lib_LTLIBRARIES)
740 if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
741 rm -rf $(stagedir) ; \
742 $(MAKE) DESTDIR=$(stagedir) install-strip; \
743 $(srcdir)/packaging/svr4/mkpkg \
745 $(PACKAGE)-$(VERSION)-$(host_os)-$(host_cpu)-local \
749 echo "Error: SVR4 packaging tools not found." ; \
750 echo "Package build abandoned." ; \
753 solaris-package: svr4-package
755 specfile=$(top_srcdir)/packaging/rpm/ethereal.spec
758 if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
759 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
760 rpm -bb --clean --rmsource $(specfile) ; \
762 echo "Error: RPM executable and/or source directory not found." ; \
763 echo "Package build abandoned." ; \
767 if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
768 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
769 rpm -bs --clean --rmsource $(specfile) ; \
771 echo "Error: RPM executable and/or source directory not found." ; \
772 echo "Package build abandoned." ; \
775 debian-package: debian/rules
776 dpkg-buildpackage -rfakeroot -us -uc
779 rm -rf $(top_stagedir)