65a08ffd8860180684ffa38daababd2ce5ab6555
[metze/wireshark/wip.git] / plugins / docsis / Makefile.am
1 # Makefile.am
2 # Automake file for DOCSIS plugin
3 #
4 # Wireshark - Network traffic analyzer
5 # By Gerald Combs <gerald@wireshark.org>
6 # Copyright 1998 Gerald Combs
7 #
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.
12 #
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.
17 #
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.
21 #
22
23 include $(top_srcdir)/Makefile.am.inc
24
25 AM_CPPFLAGS = -I$(top_srcdir)
26
27 include Makefile.common
28
29 if HAVE_WARNINGS_AS_ERRORS
30 AM_CFLAGS = -Werror
31 endif
32
33 plugindir = @plugindir@
34
35 plugin_LTLIBRARIES = docsis.la
36
37 docsis_la_SOURCES = \
38         plugin.c \
39         moduleinfo.h \
40         $(SRC_FILES)    \
41         $(HEADER_FILES)
42
43 docsis_la_LDFLAGS = -module -avoid-version
44 docsis_la_LIBADD = @PLUGIN_LIBS@
45
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,
48 # add them here.
49 LIBS =
50
51 #
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.
56 #
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.).
60 #
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
64 # inside #if.
65 #
66 # REGISTER_SRC_FILES is assumed to have all the files that need to be scanned.
67 #
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
71 # reason.
72 #
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.
78 #
79 plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg.py
80         @echo Making plugin.c
81         @$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
82                 plugin $(REGISTER_SRC_FILES)
83
84 #
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.
90 #
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.
95 #
96 # We work around this by having a "dist-hook" rule that deletes
97 # "plugin.c", so that "dist" won't pick it up.
98 #
99 #dist-hook:
100 #       @rm -f $(distdir)/plugin.c
101
102 CLEANFILES = \
103         docsis \
104         *~
105
106 MAINTAINERCLEANFILES = \
107         Makefile.in \
108         plugin.c
109
110 EXTRA_DIST = \
111         Makefile.common         \
112         Makefile.nmake          \
113         moduleinfo.nmake        \
114         plugin.rc.in            \
115         README                  \
116         CMakeLists.txt
117
118 checkapi:
119         $(PERL) $(top_srcdir)/tools/checkAPIs.pl -g abort -g termoutput -build \
120         -sourcedir=$(srcdir) \
121         $(CLEAN_SRC_FILES) $(CLEAN_HEADER_FILES)