2 # Automake file for DOCSIS plugin
4 # Wireshark - Network traffic analyzer
5 # By Gerald Combs <gerald@wireshark.org>
6 # Copyright 1998 Gerald Combs
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License
10 # as published by the Free Software Foundation; either version 2
11 # of the License, or (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 include $(top_srcdir)/Makefile.am.inc
25 AM_CPPFLAGS = -I$(top_srcdir)
27 include Makefile.common
29 if HAVE_WARNINGS_AS_ERRORS
33 plugindir = @plugindir@
35 plugin_LTLIBRARIES = docsis.la
43 docsis_la_LDFLAGS = -module -avoid-version
44 docsis_la_LIBADD = @PLUGIN_LIBS@
46 # Libs must be cleared, or else libtool won't create a shared module.
47 # If your module needs to be linked against any particular libraries,
52 # Build plugin.c, which contains the plugin version[] string, a
53 # function plugin_register() that calls the register routines for all
54 # protocols, and a function plugin_reg_handoff() that calls the handoff
55 # registration routines for all protocols.
57 # We do this by scanning sources. If that turns out to be too slow,
58 # maybe we could just require every .o file to have an register routine
59 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
61 # Formatting conventions: The name of the proto_register_* routines an
62 # proto_reg_handoff_* routines must start in column zero, or must be
63 # preceded only by "void " starting in column zero, and must not be
66 # REGISTER_SRC_FILES is assumed to have all the files that need to be scanned.
68 # For some unknown reason, having a big "for" loop in the Makefile
69 # to scan all the files doesn't work with some "make"s; they seem to
70 # pass only the first few names in the list to the shell, for some
73 # Therefore, we use a script to generate the register.c file.
74 # The first argument is the directory in which the source files live.
75 # The second argument is "plugin", to indicate that we should build
76 # a plugin.c file for a plugin.
77 # All subsequent arguments are the files to scan.
79 plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg.py
81 @$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
82 plugin $(REGISTER_SRC_FILES)
85 # Currently plugin.c can be included in the distribution because
86 # we always build all protocol dissectors. We used to have to check
87 # whether or not to build the snmp dissector. If we again need to
88 # variably build something, making plugin.c non-portable, uncomment
89 # the dist-hook line below.
91 # Oh, yuk. We don't want to include "plugin.c" in the distribution, as
92 # its contents depend on the configuration, and therefore we want it
93 # to be built when the first "make" is done; however, Automake insists
94 # on putting *all* source into the distribution.
96 # We work around this by having a "dist-hook" rule that deletes
97 # "plugin.c", so that "dist" won't pick it up.
100 # @rm -f $(distdir)/plugin.c
106 MAINTAINERCLEANFILES = \
119 $(PERL) $(top_srcdir)/tools/checkAPIs.pl -g abort -g termoutput -build \
120 -sourcedir=$(srcdir) \
121 $(CLEAN_SRC_FILES) $(CLEAN_HEADER_FILES)