2 # Automake file for Ethereal
4 # $Id: Makefile.am,v 1.319 2001/05/16 22:04:53 ashokn 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@ @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
135 packet-isis-hello.c \
170 packet-osi-options.c \
202 packet-smb-browse.c \
203 packet-smb-common.c \
205 packet-smb-mailslot.c \
215 packet-stat-notify.c \
252 packet-afs-macros.h \
253 packet-afs-register-info.h \
258 packet-bootparams.h \
263 packet-diameter-defs.h \
282 packet-isis-hello.h \
298 packet-osi-options.h \
313 packet-smb-browse.h \
314 packet-smb-common.h \
316 packet-smb-mailslot.h \
323 packet-stat-notify.h \
336 packet-x11-keysym.h \
343 ETHEREAL_COMMON_SRC = \
379 x11-register-info.h \
389 $(ETHEREAL_COMMON_SRC) \
406 ethereal_static_SOURCES = \
409 EXTRA_ethereal_SOURCES = \
420 # Optional objects that I know how to build. These will be
421 # linked into the ethereal executable.
422 # They will also be linked into the tethereal executable; if this
423 # list ever grows to include something that can't be linked with
424 # tethereal, or if tethereal needs something that ethereal doesn't,
425 # we should probably split this into stuff needed both
426 # by ethereal and tethereal and stuff needed only by one or the
428 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ \
429 @STRCASECMP_O@ @STRNCASECMP_O@ @MKSTEMP_O@
431 # Additional libs that I know how to build. These will be
432 # linked into the ethereal executable.
433 ethereal_additional_libs = \
434 wiretap/libwiretap.a \
437 epan/ftypes/libftypes.a \
438 epan/dfilter/libdfilter.a
440 # This is the automake dependency variable for the executable
441 ethereal_DEPENDENCIES = \
442 $(ethereal_optional_objects) \
443 $(ethereal_additional_libs) \
444 plugins/gryphon/gryphon.la \
447 ethereal_static_DEPENDENCIES = \
448 $(ethereal_optional_objects) \
449 $(ethereal_additional_libs)
451 # This automake variable adds to the link-line for the executable.
453 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
454 # they are included in @GTK_LIBS@, and doesn't have to be linked with
455 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
456 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
457 # applications are X applications).
459 $(ethereal_optional_objects) \
460 $(ethereal_additional_libs) \
461 @SNMP_LIBS@ @SSL_LIBS@ \
463 "-dlopen" plugins/gryphon/gryphon.la @PCAP_LIBS@ @GTK_LIBS@ \
464 "-dlopen" plugins/mgcp/mgcp.la @PCAP_LIBS@ @GTK_LIBS@
466 ethereal_static_LDADD = \
467 $(ethereal_optional_objects) \
468 $(ethereal_additional_libs) \
469 @SNMP_LIBS@ @SSL_LIBS@ \
470 @PCAP_LIBS@ @GTK_LIBS@
472 ethereal_LDFLAGS = -export-dynamic
473 ethereal_static_LDFLAGS = -Wl,-static
475 tethereal_SOURCES = \
477 $(ETHEREAL_COMMON_SRC) \
480 tethereal_static_SOURCES = \
483 # Additional libs that I know how to build. These will be
484 # linked into the tethereal executable.
485 tethereal_additional_libs = \
486 wiretap/libwiretap.a \
488 epan/ftypes/libftypes.a \
489 epan/dfilter/libdfilter.a
491 # This is the automake dependency variable for the executable
492 tethereal_DEPENDENCIES = \
493 $(ethereal_optional_objects) \
494 $(tethereal_additional_libs) \
495 plugins/gryphon/gryphon.la \
498 tethereal_static_DEPENDENCIES = \
499 $(ethereal_optional_objects) \
500 $(tethereal_additional_libs)
502 # This automake variable adds to the link-line for the executable
503 tethereal_LDADD = wiretap/libwiretap.a \
504 $(ethereal_optional_objects) \
505 $(tethereal_additional_libs) \
506 @SNMP_LIBS@ @SSL_LIBS@ \
508 "-dlopen" plugins/gryphon/gryphon.la @GLIB_LIBS@ -lm \
509 "-dlopen" plugins/mgcp/mgcp.la @GLIB_LIBS@ -lm \
510 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
512 tethereal_static_LDADD = wiretap/libwiretap.a \
513 $(ethereal_optional_objects) \
514 $(tethereal_additional_libs) \
515 @SNMP_LIBS@ @SSL_LIBS@ \
517 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
519 tethereal_LDFLAGS = -export-dynamic
520 tethereal_static_LDFLAGS = -Wl,-static
522 text2pcap_SOURCES = text2pcap.c text2pcap-scanner.l
523 text2pcap_DEPENDENCIES = text2pcap.h
525 editcap_SOURCES = editcap.c
527 # This is the automake dependency variable for the executable
528 editcap_DEPENDENCIES = wiretap/libwiretap.a
530 # This automake variable adds to the link-line for the executable
531 editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
534 # Build various header files for the X11 dissector.
536 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
537 $(PERL) process-x11-fields.pl <x11-fields
540 # Build "register.c", which contains a function "register_all_protocols()"
541 # that calls the register routines for all protocols.
543 # We do this by grepping through sources. If that turns out to be too slow,
544 # maybe we could just require every .o file to have an register routine
545 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
547 # Formatting conventions: The name of the proto_register_* routines must
548 # start in column zero, or must be preceded only by "void " starting in
549 # column zero, and must not be inside #if.
551 # We assume that all dissector routines are in "packet-XXX.c" files.
553 # For some unknown reason, having a big "for" loop in the Makefile
554 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
555 # they seem to pass only the first few names in the list to the shell,
558 # Therefore, we have a script to generate the "register.c" file.
560 # The first argument is the directory in which the source files live.
561 # All subsequent arguments are the files to scan.
563 register.c: $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
564 @echo Making register.c
565 @$(srcdir)/make-reg-dotc $(srcdir) $(DISSECTOR_SRC)
568 ./rdps $(srcdir)/print.ps ps.c
571 $(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
574 $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
576 randpkt: randpkt.o wiretap/libwiretap.a
577 $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
582 $(ETHEREAL_COMMON_SRC) \
585 dftest_additional_libs = \
587 epan/ftypes/libftypes.a \
588 epan/dfilter/libdfilter.a
590 dftest_DEPENDENCIES = \
591 $(ethereal_optional_objects) \
592 $(dftest_additional_libs) \
593 plugins/gryphon/gryphon.la \
596 # This automake variable adds to the link-line for the executable
598 $(ethereal_optional_objects) \
599 $(dftest_additional_libs) \
600 @SNMP_LIBS@ @SSL_LIBS@ \
602 "-dlopen" plugins/gryphon/gryphon.la @GLIB_LIBS@ -lm \
603 "-dlopen" plugins/mgcp/mgcp.la @GLIB_LIBS@ -lm \
604 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
606 dftest_LDFLAGS = -export-dynamic
620 debian/README.debian \
630 doc/README.developer \
633 doc/README.regression \
638 doc/ethereal.pod.template \
640 doc/tethereal.pod.template \
644 text2pcap-scanner.l \
648 image/Makefile.nmake \
649 image/editcap.rc.in \
650 image/elogo3d48x48.png \
651 image/ethereal48x48-trans.png \
652 image/ethereal48x48.png \
654 image/ethereal.rc.in \
655 image/icon-excl.xpm \
656 image/icon-ethereal.xpm \
657 image/tethereal.rc.in \
666 process-x11-fields.pl \
682 -chmod +s $(DESTDIR)$(bindir)/ethereal
683 -chmod +s $(DESTDIR)$(bindir)/tethereal
684 -chmod +s $(DESTDIR)$(bindir)/ethereal_static
690 # Currently register.c can be included in the distribution because
691 # we always build all protocol dissectors. We used to have to check
692 # whether or not to build the snmp dissector. If we again need to
693 # variably build something, making register.c non-portable, uncomment
694 # the dist-hook line below.
696 # Oh, yuk. We don't want to include "register.c" in the distribution, as
697 # its contents depend on the configuration, and therefore we want it
698 # to be built when the first "make" is done; however, Automake insists
699 # on putting *all* source into the distribution.
701 # We work around this by having a "dist-hook" rule that deletes
702 # "register.c", so that "dist" won't pick it up.
705 # @rm -f $(distdir)/register.c
707 SUBDIRS = tools wiretap epan plugins packaging @ethereal_SUBDIRS@
709 ethereal.1: ethereal doc/ethereal.pod.template
711 $(MAKE) ../ethereal.1 )
713 tethereal.1: tethereal doc/tethereal.pod.template
715 $(MAKE) ../tethereal.1 )
717 editcap.1: doc/editcap.pod
719 $(MAKE) ../editcap.1 )
721 text2pcap.1: doc/text2pcap.pod
723 $(MAKE) ../text2pcap.1 )
725 packet-ncp2222.c : ncp2222.py
726 $(PYTHON) $(srcdir)/ncp2222.py > $@
728 libtool: $(LIBTOOL_DEPS)
729 $(SHELL) ./config.status --recheck
731 # We load top_stagedir with an explicit path so that libtool doesn't freak.
732 top_stagedir=`cd $(top_srcdir) && pwd`/packaging/svr4.stage
733 stagedir=$(top_stagedir)/$(PACKAGE).stage
737 svr4-package: $(bin_SCRIPTS) $(lib_LTLIBRARIES)
738 if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
739 rm -rf $(stagedir) ; \
740 $(MAKE) DESTDIR=$(stagedir) install-strip; \
741 $(srcdir)/packaging/svr4/mkpkg \
743 $(PACKAGE)-$(VERSION)-$(host_os)-$(host_cpu)-local \
747 echo "Error: SVR4 packaging tools not found." ; \
748 echo "Package build abandoned." ; \
751 solaris-package: svr4-package
753 specfile=$(top_srcdir)/packaging/rpm/ethereal.spec
756 if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
757 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
758 rpm -bb --clean --rmsource $(specfile) ; \
760 echo "Error: RPM executable and/or source directory not found." ; \
761 echo "Package build abandoned." ; \
765 if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
766 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
767 rpm -bs --clean --rmsource $(specfile) ; \
769 echo "Error: RPM executable and/or source directory not found." ; \
770 echo "Package build abandoned." ; \
773 debian-package: debian/rules
774 dpkg-buildpackage -rfakeroot -us -uc
777 rm -rf $(top_stagedir)