5 # Ethereal - Network traffic analyzer
6 # By Gerald Combs <gerald@zing.org>
7 # Copyright 2004 Gerald Combs
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU General Public License
12 # as published by the Free Software Foundation; either version 2
13 # of the License, or (at your option) any later version.
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write to the Free Software
22 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 noinst_LTLIBRARIES = libdissectors.la
31 INCLUDES = -I$(srcdir)/../.. -I$(srcdir)/..
33 include Makefile.common
35 libdissectors_la_SOURCES = \
37 $(DISSECTOR_SUPPORT_SRC)
42 packet-ncp2222.c : $(srcdir)/ncp2222.py
46 # Build various header files for the X11 dissector.
48 PROC_X11_FIELDS := $(srcdir)/process-x11-fields.pl
49 X11_FIELDS := $(srcdir)/x11-fields
51 x11-declarations.h x11-register-info.h: $(PROC_X11_FIELDS) $(X11_FIELDS)
52 $(PERL) $(PROC_X11_FIELDS) < $(X11_FIELDS)
55 # Build "register.c", which contains a function "register_all_protocols()"
56 # that calls the register routines for all protocols.
58 # We do this by grepping through sources. If that turns out to be too slow,
59 # maybe we could just require every .o file to have an register routine
60 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
62 # Formatting conventions: The name of the proto_register_* routines must
63 # start in column zero, or must be preceded only by "void " starting in
64 # column zero, and must not be inside #if.
66 # We assume that all dissector routines are in "packet-XXX.c" files.
68 # For some unknown reason, having a big "for" loop in the Makefile
69 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
70 # they seem to pass only the first few names in the list to the shell,
73 # Therefore, we have a script to generate the "register.c" file.
75 # The first argument is the name of the file to write.
76 # The second argument is the directory in which the source files live.
77 # All subsequent arguments are the files to scan.
79 register.c: $(plugin_src) $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc $(srcdir)/make-reg-dotc.py
80 @if test -n $(PYTHON); then \
81 echo Making register.c with python ; \
82 $(PYTHON) $(srcdir)/make-reg-dotc.py $(srcdir) $(DISSECTOR_SRC) ; \
84 echo Making register.c with shell script ; \
85 $(srcdir)/make-reg-dotc register.c $(srcdir) \
86 $(plugin_src) $(DISSECTOR_SRC) ; \
90 # Currently register.c can be included in the distribution because
91 # we always build all protocol dissectors. We used to have to check
92 # whether or not to build the snmp dissector. If we again need to
93 # variably build something, making register.c non-portable, uncomment
94 # the dist-hook line below.
96 # Oh, yuk. We don't want to include "register.c" in the distribution, as
97 # its contents depend on the configuration, and therefore we want it
98 # to be built when the first "make" is done; however, Automake insists
99 # on putting *all* source into the distribution.
101 # We work around this by having a "dist-hook" rule that deletes
102 # "register.c", so that "dist" won't pick it up.
105 # @rm -f $(distdir)/register.c
108 MAINTAINERCLEANFILES = \
116 x11-register-info.h \