Add .rc files to the sources to have them included in the build
[metze/wireshark/wip.git] / plugins / mate / Makefile.am
1 # Makefile.am
2 # Automake file for MATE Wireshark 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 #
30 # XXX - how to make this apply only to clean files?
31 #
32 #if HAVE_WARNINGS_AS_ERRORS
33 #AM_CFLAGS = -Werror
34 #endif
35
36 plugindir = @plugindir@
37
38 plugin_LTLIBRARIES = mate.la
39
40 mate_la_SOURCES = \
41         plugin.c        \
42         moduleinfo.h    \
43         $(SRC_FILES)    \
44         $(HEADER_FILES)
45
46 nodist_mate_la_SOURCES = \
47         $(NODIST_SRC_FILES) \
48         $(NODIST_HEADER_FILES)
49
50 mate_la_LDFLAGS = -module -avoid-version
51 mate_la_LIBADD = @PLUGIN_LIBS@
52
53 # Libs must be cleared, or else libtool won't create a shared module.
54 # If your module needs to be linked against any particular libraries,
55 # add them here.
56 LIBS =
57
58 #
59 # Build plugin.c, which contains the plugin version[] string, a
60 # function plugin_register() that calls the register routines for all
61 # protocols, and a function plugin_reg_handoff() that calls the handoff
62 # registration routines for all protocols.
63 #
64 # We do this by scanning sources.  If that turns out to be too slow,
65 # maybe we could just require every .o file to have an register routine
66 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
67 #
68 # Formatting conventions:  The name of the proto_register_* routines an
69 # proto_reg_handoff_* routines must start in column zero, or must be
70 # preceded only by "void " starting in column zero, and must not be
71 # inside #if.
72 #
73 # REGISTER_SRC_FILES is assumed to have all the files that need to be scanned.
74 #
75 # For some unknown reason, having a big "for" loop in the Makefile
76 # to scan all the files doesn't work with some "make"s; they seem to
77 # pass only the first few names in the list to the shell, for some
78 # reason.
79 #
80 # Therefore, we have a script to generate the plugin.c file.
81 # The shell script runs slowly, as multiple greps and seds are run
82 # for each input file; this is especially slow on Windows.  Therefore,
83 # if Python is present (as indicated by PYTHON being defined), we run
84 # a faster Python script to do that work instead.
85 #
86 # The first argument is the directory in which the source files live.
87 # The second argument is "plugin", to indicate that we should build
88 # a plugin.c file for a plugin.
89 # All subsequent arguments are the files to scan.
90 #
91 plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg \
92     $(top_srcdir)/tools/make-dissector-reg.py
93         @if test -n "$(PYTHON)"; then \
94                 echo Making plugin.c with python ; \
95                 $(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
96                     plugin $(REGISTER_SRC_FILES) ; \
97         else \
98                 echo Making plugin.c with shell script ; \
99                 $(top_srcdir)/tools/make-dissector-reg $(srcdir) \
100                     $(plugin_src) plugin $(REGISTER_SRC_FILES) ; \
101         fi
102
103 #
104 # Currently plugin.c can be included in the distribution because
105 # we always build all protocol dissectors. We used to have to check
106 # whether or not to build the snmp dissector. If we again need to
107 # variably build something, making plugin.c non-portable, uncomment
108 # the dist-hook line below.
109 #
110 # Oh, yuk.  We don't want to include "plugin.c" in the distribution, as
111 # its contents depend on the configuration, and therefore we want it
112 # to be built when the first "make" is done; however, Automake insists
113 # on putting *all* source into the distribution.
114 #
115 # We work around this by having a "dist-hook" rule that deletes
116 # "plugin.c", so that "dist" won't pick it up.
117 #
118 #dist-hook:
119 #       @rm -f $(distdir)/plugin.c
120
121 CLEANFILES = \
122         mate \
123         *~
124
125 DISTCLEANFILES = \
126         mate_grammar.out \
127         $(NODIST_SRC_FILES) \
128         $(NODIST_HEADER_FILES)
129
130 MAINTAINERCLEANFILES = \
131         Makefile.in \
132         $(GENERATED_SRC_FILES) \
133         $(GENERATED_HEADER_FILES) \
134         plugin.c
135
136 EXTRA_DIST = \
137         mate_grammar.lemon      \
138         mate_parser.l           \
139         Makefile.common         \
140         Makefile.nmake          \
141         moduleinfo.nmake        \
142         plugin.rc.in            \
143         CMakeLists.txt
144
145 RUNLEX = $(top_srcdir)/tools/runlex.sh
146
147 LEMON = $(top_builddir)/tools/lemon
148
149 mate_parser_lex.h : mate_parser.c
150
151 mate_parser.lo : mate_grammar.h
152
153 mate_grammar.h : mate_grammar.c
154 mate_grammar.c : mate_grammar.lemon mate.h mate_util.h $(LEMON)/lemon$(EXEEXT)
155         $(AM_V_LEMON)$(LEMON)/lemon$(EXEEXT) t=$(srcdir)/$(LEMON)/lempar.c $(srcdir)/mate_grammar.lemon || \
156                 (rm -f grammar.c grammar.h ; false)
157
158 checkapi:
159         $(PERL) $(top_srcdir)/tools/checkAPIs.pl -g abort -g termoutput -build \
160         -sourcedir=$(srcdir) \
161         $(CLEAN_SRC_FILES) $(CLEAN_HEADER_FILES)