2 # Automake file for Ethereal
4 # $Id: Makefile.am,v 1.265 2000/12/29 01:06:24 sharpe 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
116 packet-osi-options.c \
145 packet-smb-browse.c \
146 packet-smb-common.c \
148 packet-smb-mailslot.c \
188 packet-afs-macros.h \
189 packet-afs-register-info.h \
194 packet-bootparams.h \
198 packet-diameter-defs.h \
214 packet-isis-hello.h \
228 packet-osi-options.h \
240 packet-smb-common.h \
257 packet-x11-declarations.h \
258 packet-x11-register-info.h \
259 packet-x11-keysym.h \
266 ETHEREAL_COMMON_SOURCES = \
303 $(DISSECTOR_SOURCES) \
304 $(ETHEREAL_COMMON_SOURCES) \
316 ethereal_static_SOURCES = \
319 EXTRA_ethereal_SOURCES = \
330 # Optional objects that I know how to build. These will be
331 # linked into the ethereal executable.
332 # They will also be linked into the tethereal executable; if this
333 # list ever grows to include something that can't be linked with
334 # tethereal, or if tethereal needs something that ethereal doesn't,
335 # we should probably split this into stuff needed both
336 # by ethereal and tethereal and stuff needed only by one or the
338 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ \
339 @STRCASECMP_O@ @STRNCASECMP_O@ @MKSTEMP_O@
341 # Additional libs that I know how to build. These will be
342 # linked into the ethereal executable.
343 ethereal_additional_libs = wiretap/libwiretap.a gtk/libui.a epan/libethereal.a
345 # This is the automake dependency variable for the executable
346 ethereal_DEPENDENCIES = \
347 $(ethereal_optional_objects) \
348 $(ethereal_additional_libs) \
349 plugins/gryphon/gryphon.la \
352 ethereal_static_DEPENDENCIES = \
353 $(ethereal_optional_objects) \
354 $(ethereal_additional_libs)
356 # This automake variable adds to the link-line for the executable.
358 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
359 # they are included in @GTK_LIBS@, and doesn't have to be linked with
360 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
361 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
362 # applications are X applications).
364 $(ethereal_optional_objects) \
365 $(ethereal_additional_libs) \
368 "-dlopen" plugins/gryphon/gryphon.la @PCAP_LIBS@ @GTK_LIBS@ \
369 "-dlopen" plugins/mgcp/mgcp.la @PCAP_LIBS@ @GTK_LIBS@
371 ethereal_static_LDADD = \
372 $(ethereal_optional_objects) \
373 $(ethereal_additional_libs) \
375 @PCAP_LIBS@ @GTK_LIBS@
377 ethereal_LDFLAGS = -export-dynamic
378 ethereal_static_LDFLAGS = -Wl,-static
380 tethereal_SOURCES = \
381 $(DISSECTOR_SOURCES) \
382 $(ETHEREAL_COMMON_SOURCES) \
385 tethereal_static_SOURCES = \
388 # Additional libs that I know how to build. These will be
389 # linked into the tethereal executable.
390 tethereal_additional_libs = wiretap/libwiretap.a epan/libethereal.a
392 # This is the automake dependency variable for the executable
393 tethereal_DEPENDENCIES = \
394 $(ethereal_optional_objects) \
395 $(tethereal_additional_libs) \
396 plugins/gryphon/gryphon.la \
399 tethereal_static_DEPENDENCIES = \
400 $(ethereal_optional_objects) \
401 $(tethereal_additional_libs)
403 # This automake variable adds to the link-line for the executable
404 tethereal_LDADD = wiretap/libwiretap.a \
405 $(ethereal_optional_objects) \
406 $(tethereal_additional_libs) \
409 "-dlopen" plugins/gryphon/gryphon.la @GLIB_LIBS@ -lm \
410 "-dlopen" plugins/mgcp/mgcp.la @GLIB_LIBS@ -lm \
411 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
413 tethereal_static_LDADD = wiretap/libwiretap.a \
414 $(ethereal_optional_objects) \
415 $(tethereal_additional_libs) \
418 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
420 tethereal_LDFLAGS = -export-dynamic
421 tethereal_static_LDFLAGS = -Wl,-static
423 editcap_SOURCES = editcap.c
425 # This is the automake dependency variable for the executable
426 editcap_DEPENDENCIES = wiretap/libwiretap.a
428 # This automake variable adds to the link-line for the executable
429 editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
432 # Build "register.c", which contains a function "register_all_protocols()"
433 # that calls the register routines for all protocols.
435 # We do this by grepping through sources. If that turns out to be too slow,
436 # maybe we could just require every .o file to have an register routine
437 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
439 # Formatting conventions: The name of the proto_register_* routines must
440 # start in column zero, or must be preceded only by "void " starting in
441 # column zero, and must not be inside #if.
443 # We assume that all dissector routines are in "packet-XXX.c" files.
445 # For some unknown reason, having a big "for" loop in the Makefile
446 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
447 # they seem to pass only the first few names in the list to the shell,
450 # Therefore, we have a script to generate the "register.c" file.
452 # The first argument is the directory in which the source files live.
453 # All subsequent arguments are the files to scan.
455 register.c: $(DISSECTOR_SOURCES) $(srcdir)/make-reg-dotc
456 @echo Making register.c
457 @$(srcdir)/make-reg-dotc $(srcdir) $(DISSECTOR_SOURCES)
460 ./rdps $(srcdir)/print.ps ps.c
463 $(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
466 $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
468 randpkt: randpkt.o wiretap/libwiretap.a
469 $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
481 debian/README.debian \
491 doc/README.developer \
494 doc/README.regression \
498 doc/ethereal.pod.template \
500 doc/tethereal.pod.template \
506 image/ethereal48x48-trans.png \
507 image/ethereal48x48.png \
510 image/icon-excl.xpm \
511 image/icon-ethereal.xpm \
514 libpcap-0.4.HPUX.HPUXPAC.patch \
515 libpcap-0.4.HPUX.LBL.patch \
516 libpcap-0.5.HPUX.tcpdump.org.patch \
537 -chmod +s $(DESTDIR)$(bindir)/ethereal
538 -chmod +s $(DESTDIR)$(bindir)/tethereal
539 -chmod +s $(DESTDIR)$(bindir)/ethereal_static
545 # Currently register.c can be included in the distribution because
546 # we always build all protocol dissectors. We used to have to check
547 # whether or not to build the snmp dissector. If we again need to
548 # variably build something, making register.c non-portable, uncomment
549 # the dist-hook line below.
551 # Oh, yuk. We don't want to include "register.c" in the distribution, as
552 # its contents depend on the configuration, and therefore we want it
553 # to be built when the first "make" is done; however, Automake insists
554 # on putting *all* source into the distribution.
556 # We work around this by having a "dist-hook" rule that deletes
557 # "register.c", so that "dist" won't pick it up.
560 # @rm -f $(distdir)/register.c
562 SUBDIRS = wiretap epan plugins packaging @ethereal_SUBDIRS@
564 ethereal.1: ethereal doc/ethereal.pod.template
566 $(MAKE) ../ethereal.1 )
568 tethereal.1: tethereal doc/tethereal.pod.template
570 $(MAKE) ../tethereal.1 )
572 editcap.1: doc/editcap.pod
574 $(MAKE) ../editcap.1 )
576 packet-ncp2222.c : ncp2222.py
577 $(PYTHON) $(srcdir)/ncp2222.py > $@
579 libtool: $(LIBTOOL_DEPS)
580 $(SHELL) ./config.status --recheck
582 # We load top_stagedir with an explicit path so that libtool doesn't freak.
583 top_stagedir=`cd $(top_srcdir) && pwd`/packaging/svr4.stage
584 stagedir=$(top_stagedir)/$(PACKAGE).stage
588 svr4-package: $(bin_SCRIPTS) $(lib_LTLIBRARIES)
589 if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
590 rm -rf $(stagedir) ; \
591 $(MAKE) DESTDIR=$(stagedir) install-strip; \
592 $(srcdir)/packaging/svr4/mkpkg \
594 $(PACKAGE)-$(VERSION)-$(host_os)-$(host_cpu)-local \
598 echo "Error: SVR4 packaging tools not found." ; \
599 echo "Package build abandoned." ; \
602 solaris-package: svr4-package
604 specfile=$(top_srcdir)/packaging/rpm/ethereal.spec
607 if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
608 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
609 rpm -bb --clean --rmsource $(specfile) ; \
611 echo "Error: RPM executable and/or source directory not found." ; \
612 echo "Package build abandoned." ; \
616 if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
617 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
618 rpm -bs --clean --rmsource $(specfile) ; \
620 echo "Error: RPM executable and/or source directory not found." ; \
621 echo "Package build abandoned." ; \
624 debian-package: debian/rules
625 dpkg-buildpackage -rfakeroot -us -uc
628 rm -rf $(top_stagedir)