2 # Automake file for Ethereal
4 # $Id: Makefile.am,v 1.222 2000/08/18 15:26:51 gram 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 EXTRA_PROGRAMS = ethereal_static
28 bin_PROGRAMS = ethereal editcap tethereal
30 man_MANS = ethereal.1 editcap.1 tethereal.1
34 # Any POSIX-compatible YACC should honor the -p flag
109 packet-osi-options.c \
136 packet-smb-browse.c \
137 packet-smb-common.c \
139 packet-smb-mailslot.c \
179 packet-bootparams.h \
187 packet-diameter-defs.h \
200 packet-isis-hello.h \
218 packet-osi-options.h \
233 packet-smb-common.h \
248 packet-x11-declarations.h \
249 packet-x11-register-info.h \
250 packet-x11-keysym.h \
257 ETHEREAL_COMMON_SOURCES = \
315 $(DISSECTOR_SOURCES) \
316 $(ETHEREAL_COMMON_SOURCES) \
328 ethereal_static_SOURCES = \
331 EXTRA_ethereal_SOURCES = \
348 # Optional objects that I know how to build. These will be
349 # linked into the ethereal executable.
350 # They will also be linked into the tethereal executable; if this
351 # list ever grows to include something that can't be linked with
352 # tethereal, or if tethereal needs something that ethereal doesn't,
353 # we should probably split this into stuff needed both
354 # by ethereal and tethereal and stuff needed only by one or the
356 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ \
357 @STRCASECMP_O@ @STRNCASECMP_O@ @MKSTEMP_O@ \
358 @INET_ATON_O@ @INET_PTON_O@ @INET_NTOP_O@
360 # Additional libs that I know how to build. These will be
361 # linked into the ethereal executable.
362 ethereal_additional_libs = wiretap/libwiretap.a gtk/libui.a
364 # This is the automake dependency variable for the executable
365 ethereal_DEPENDENCIES = \
366 $(ethereal_optional_objects) \
367 $(ethereal_additional_libs) \
368 plugins/gryphon/gryphon.la
370 ethereal_static_DEPENDENCIES = \
371 $(ethereal_optional_objects) \
372 $(ethereal_additional_libs)
374 # This automake variable adds to the link-line for the executable.
376 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
377 # they are included in @GTK_LIBS@, and doesn't have to be linked with
378 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
379 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
380 # applications are X applications).
382 $(ethereal_optional_objects) \
383 $(ethereal_additional_libs) \
386 "-dlopen" plugins/gryphon/gryphon.la @PCAP_LIBS@ @GTK_LIBS@
388 ethereal_static_LDADD = \
389 $(ethereal_optional_objects) \
390 $(ethereal_additional_libs) \
392 @PCAP_LIBS@ @GTK_LIBS@
394 ethereal_LDFLAGS = -export-dynamic
395 ethereal_static_LDFLAGS = -Wl,-static
397 tethereal_SOURCES = \
398 $(DISSECTOR_SOURCES) \
399 $(ETHEREAL_COMMON_SOURCES) \
402 # Additional libs that I know how to build. These will be
403 # linked into the tethereal executable.
404 tethereal_additional_libs = wiretap/libwiretap.a
406 # This is the automake dependency variable for the executable
407 tethereal_DEPENDENCIES = \
408 $(ethereal_optional_objects) \
409 $(tethereal_additional_libs) \
410 plugins/gryphon/gryphon.la
412 # This automake variable adds to the link-line for the executable
413 tethereal_LDADD = wiretap/libwiretap.a \
414 $(ethereal_optional_objects) \
415 $(tethereal_additional_libs) \
418 "-dlopen" plugins/gryphon/gryphon.la @GLIB_LIBS@ -lm \
419 @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
421 tethereal_LDFLAGS = -export-dynamic
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,
446 # For some unknown reason, having a big "for" loop in the Makefile
447 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
448 # they seem to pass only the first few names in the list to the shell,
451 # Therefore, we have a script to generate the "register.c" file.
453 # The first argument is the directory in which the source files live.
454 # All subsequent arguments are the files to scan.
456 register.c: packet.c $(DISSECTOR_SOURCES) $(srcdir)/make-reg-dotc
457 @echo Making register.c
458 @$(srcdir)/make-reg-dotc $(srcdir) packet.c $(DISSECTOR_SOURCES)
461 ./rdps $(srcdir)/print.ps ps.c
464 $(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
467 $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
469 randpkt: randpkt.o wiretap/libwiretap.a
470 $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
472 tvbtest: tvbtest.o tvbuff.o except.o
473 $(LINK) -o tvbtest tvbtest.o tvbuff.o except.o `glib-config --libs`
485 debian/README.debian \
495 doc/README.developer \
498 doc/README.regression \
502 doc/ethereal.pod.template \
504 doc/tethereal.pod.template \
510 image/ethereal48x48-trans.png \
511 image/ethereal48x48.png \
514 image/icon-excl.xpm \
515 image/icon-ethereal.xpm \
518 libpcap-0.4.HPUX.HPUXPAC.patch \
519 libpcap-0.4.HPUX.LBL.patch \
520 libpcap-0.5.HPUX.tcpdump.org.patch \
541 -chmod +s $(DESTDIR)$(bindir)/ethereal
542 -chmod +s $(DESTDIR)$(bindir)/tethereal
543 -chmod +s $(DESTDIR)$(bindir)/ethereal_static
549 # Currently register.c can be included in the distribution because
550 # we always build all protocol dissectors. We used to have to check
551 # whether or not to build the snmp dissector. If we again need to
552 # variably build something, making register.c non-portable, uncomment
553 # the dist-hook line below.
555 # Oh, yuk. We don't want to include "register.c" in the distribution, as
556 # its contents depend on the configuration, and therefore we want it
557 # to be built when the first "make" is done; however, Automake insists
558 # on putting *all* source into the distribution.
560 # We work around this by having a "dist-hook" rule that deletes
561 # "register.c", so that "dist" won't pick it up.
564 # @rm -f $(distdir)/register.c
566 SUBDIRS = wiretap gtk plugins packaging @ethereal_SUBDIRS@
568 ethereal.1: ethereal doc/ethereal.pod.template
570 $(MAKE) ../ethereal.1 )
572 tethereal.1: tethereal doc/tethereal.pod.template
574 $(MAKE) ../tethereal.1 )
576 editcap.1: doc/editcap.pod
578 $(MAKE) ../editcap.1 )
580 dfilter-scanner.c : dfilter-scanner.l
581 $(LEX) -Pdfilter_ -odfilter-scanner.c $(srcdir)/dfilter-scanner.l
583 packet-ncp2222.c : ncp2222.py
584 $(PYTHON) $(srcdir)/ncp2222.py > $@
586 libtool: $(LIBTOOL_DEPS)
587 $(SHELL) ./config.status --recheck
589 # We load top_stagedir with an explicit path so that libtool doesn't freak.
590 top_stagedir=`cd $(top_srcdir) && pwd`/packaging/svr4.stage
591 stagedir=$(top_stagedir)/$(PACKAGE).stage
595 svr4-package: $(bin_SCRIPTS) $(lib_LTLIBRARIES)
596 if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
597 rm -rf $(stagedir) ; \
598 $(MAKE) DESTDIR=$(stagedir) install-strip; \
599 $(srcdir)/packaging/svr4/mkpkg \
601 $(PACKAGE)-$(VERSION)-$(host_os)-$(host_cpu)-local \
605 echo "Error: SVR4 packaging tools not found." ; \
606 echo "Package build abandoned." ; \
609 solaris-package: svr4-package
611 specfile=$(top_srcdir)/packaging/rpm/ethereal.spec
614 if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
615 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
616 rpm -bb --clean --rmsource $(specfile) ; \
618 echo "Error: RPM executable and/or source directory not found." ; \
619 echo "Package build abandoned." ; \
623 if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
624 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
625 rpm -bs --clean --rmsource $(specfile) ; \
627 echo "Error: RPM executable and/or source directory not found." ; \
628 echo "Package build abandoned." ; \
631 debian-package: debian/rules
632 dpkg-buildpackage -rfakeroot -us -uc
635 rm -rf $(top_stagedir)