From Tyson Key:
[obnox/wireshark/wip.git] / epan / Makefile.am
1 # Makefile.am
2 # Automake file for the EPAN library
3 # (Ethereal Protocol ANalyzer Library)
4 #
5 # $Id$
6 #
7 # Wireshark - Network traffic analyzer
8 # By Gerald Combs <gerald@wireshark.org>
9 # Copyright 1998 Gerald Combs
10 #
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.
15 #
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.
20 #
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.
24
25 include ../Makefile.am.inc
26
27 if HAVE_LIBLUA
28 wslua_lib = wslua/libwslua.la
29 wslua_dir = wslua
30 wslua_dist_dir =
31 else            # HAVE_LIBLUA
32 wslua_lib =
33 wslua_dir =
34 wslua_dist_dir = wslua
35 endif           # HAVE_LIBLUA
36
37 if HAVE_LIBPY
38 wspython_lib = wspython/libwspython.la
39 wspython_dir = wspython
40 wspython_dist_dir =
41 py_dissectors_dir = -DPYTHON_DIR=\"@pythondir@\"
42 else
43 wspython_lib =
44 wspython_dir =
45 wspython_dist_dir = wspython
46 py_dissectors_dir = -DPYTHONDIR=
47 endif
48
49 SUBDIRS = crypt ftypes dfilter dissectors $(wslua_dir) $(wspython_dir)
50
51 DIST_SUBDIRS = $(SUBDIRS) $(wslua_dist_dir) $(wspython_dist_dir)
52
53 ACLOCAL_AMFLAGS = `../aclocal-flags`
54
55 noinst_LTLIBRARIES = libwireshark_generated.la libwireshark_asmopt.la
56 lib_LTLIBRARIES = libwireshark.la
57 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
58 libwireshark_la_LDFLAGS = -version-info 0:1:0 -export-symbols libwireshark.sym @LDFLAGS_SHAREDLIB@
59
60 include Makefile.common
61
62 INCLUDES = -I$(srcdir)/.. -I$(srcdir)/$(LEMON) -I$(builddir)/wslua \
63         @LUA_INCLUDES@ $(LIBGNUTLS_CFLAGS) $(LIBGCRYPT_CFLAGS) \
64         $(LIBSMI_CFLAGS) $(LIBGEOIP_CFLAGS) $(PY_CFLAGS)
65
66
67 if HAVE_WARNINGS_AS_ERRORS
68 AM_NON_GENERATED_CFLAGS = -Werror
69 endif
70
71 #Since code generated by lex may trigger gcc warnings, we are now generating two
72 #libraries.  A single library is generated with the lex code without the barrier
73 #"stop on warning". An other library is generated from the remaining source
74 #files with the "stop on warning" barrier.
75 libwireshark_la_SOURCES = \
76         $(LIBWIRESHARK_SRC)     \
77         $(LIBWIRESHARK_INCLUDES)
78 libwireshark_la_CFLAGS = $(AM_NON_GENERATED_CFLAGS) $(py_dissectors_dir)
79
80 libwireshark_generated_la_SOURCES = \
81         $(LIBWIRESHARK_GENERATED_SRC) \
82         $(LIBWIRESHARK_GENERATED_INCLUDES)
83
84 # code optionally implemented in assembler
85 # only C source available for platforms other than Win32
86 libwireshark_asmopt_la_SOURCES = \
87         asm_utils.c             \
88         asm_utils.h             \
89         asm_utils_win32_x86.asm
90
91 EXTRA_DIST = \
92         diam_dict.l             \
93         dtd_grammar.lemon       \
94         dtd_parse.l             \
95         dtd_parse.h             \
96         dtd_preparse.l          \
97         enterprise-numbers      \
98         libwireshark.def        \
99         libwireshark.vcproj     \
100         Makefile.common         \
101         Makefile.nmake          \
102         radius_dict.l           \
103         tvbtest.c               \
104         reassemble_test.c       \
105         uat_load.l              \
106         exntest.c               \
107         doxygen.cfg.in          \
108         CMakeLists.txt
109
110 CLEANFILES = \
111         libwireshark.a                  \
112         libwireshark.la                 \
113         libwireshark_generated.a        \
114         libwireshark_generated.la       \
115         libwireshark_asmopt.a           \
116         libwireshark_asmopt.la          \
117         libwireshark.sym                \
118         *~
119
120 DISTCLEANFILES = \
121         $(LIBWIRESHARK_DISTCLEAN_GENERATED_SRC) \
122         $(LIBWIRESHARK_DISTCLEAN_GENERATED_INCLUDES) \
123         dtd_grammar.out
124
125 MAINTAINERCLEANFILES = \
126         $(LIBWIRESHARK_NODISTCLEAN_GENERATED_SRC) \
127         $(LIBWIRESHARK_NODISTCLEAN_GENERATED_INCLUDES) \
128         Makefile.in             \
129         sminmpec.c
130
131 #
132 # Add the object files for missing routines, if any.
133 #
134 libwireshark_la_LIBADD = \
135         libwireshark_generated.la \
136         libwireshark_asmopt.la crypt/libairpdcap.la \
137         ftypes/libftypes.la dfilter/libdfilter.la dissectors/libdissectors.la \
138         dissectors/libdirtydissectors.la $(wslua_lib) $(wspython_lib) @SOCKET_LIBS@ @NSL_LIBS@ \
139         @C_ARES_LIBS@ @ADNS_LIBS@ @LIBGCRYPT_LIBS@ @LIBGNUTLS_LIBS@ \
140         @KRB5_LIBS@ @SSL_LIBS@ @LIBSMI_LDFLAGS@ @GEOIP_LIBS@ \
141         ${top_builddir}/wiretap/libwiretap.la @GLIB_LIBS@ \
142         ${top_builddir}/wsutil/libwsutil.la -lm
143
144 libwireshark_la_DEPENDENCIES = \
145         libwireshark_generated.la \
146         libwireshark_asmopt.la crypt/libairpdcap.la \
147         ftypes/libftypes.la dfilter/libdfilter.la dissectors/libdissectors.la \
148         dissectors/libdirtydissectors.la $(wslua_lib) $(wspython_lib) \
149         ${top_builddir}/wsutil/libwsutil.la \
150         ${top_builddir}/wiretap/libwiretap.la \
151         libwireshark.sym
152
153 #EXTRA_PROGRAMS = reassemble_test
154 #reassemble_test_LDADD = $(GLIB_LIBS)
155
156 reassemble_test: reassemble_test.o tvbuff.o except.o to_str.o strutil.o emem.o \
157                  reassemble.o charsets.o
158         $(LINK) $^ $(GLIB_LIBS) -lz
159
160 tvbtest: tvbtest.o tvbuff.o except.o to_str.o strutil.o emem.o charsets.o
161         $(LINK) $^ $(GLIB_LIBS) -lz
162
163 exntest: exntest.o except.o
164         $(LINK) $^ $(GLIB_LIBS)
165
166 RUNLEX=$(top_srcdir)/tools/runlex.sh
167
168 diam_dict_lex.h: diam_dict.c
169
170 dtd_parse_lex.h: dtd_parse.c
171
172 dtd_preparse_lex.h: dtd_preparse.c
173
174 radius_dict_lex.h: radius_dict.c
175
176 uat_load_lex.h: uat_load.c
177
178 LEMON=../tools/lemon
179
180 dtd_grammar.h: dtd_grammar.c
181
182 dtd_grammar.c: $(LEMON)/lemon$(EXEEXT) $(srcdir)/$(LEMON)/lempar.c $(srcdir)/dtd_grammar.lemon
183         $(LEMON)/lemon$(EXEEXT) t=$(srcdir)/$(LEMON)/lempar.c $(srcdir)/dtd_grammar.lemon
184
185 tvbtest.o exntest.o: exceptions.h
186
187 sminmpec.c: enterprise-numbers ../tools/make-sminmpec.pl
188         $(PERL) $(srcdir)/../tools/make-sminmpec.pl $(srcdir)/enterprise-numbers sminmpec.c
189
190 def_sym_filter_symbols =
191
192 if !HAVE_PLUGINS
193 # If we're not building plugins, these symbols don't get built.
194 # Keep them out of the symbol list.
195 def_sym_filter_symbols += /^register_all_wiretap_modules/ || /^register_all_plugin_tap_listeners/ || /^plugin_list/ {next;};
196 endif
197
198 if HAVE_LIBPY
199 # If we're not building python, these symbols don't get built.
200 # Keep them out of the symbol list.
201 def_sym_filter_symbols += /^py_create_dissector_handle/ || /^py_dissector_args/  {next;};
202 def_sym_filter_symbols += /^py_generic_dissector/ || /^py_pinfo/ || /^py_tree/ || /^py_tvbuff/ {next;};
203 def_sym_filter_symbols += /^hf_register_info_add/  || /^hf_register_info_create/  || /^hf_register_info_destroy/ {next;};
204 endif
205
206 if HAVE_PLUGINS
207
208 if ENABLE_STATIC
209 -include ../plugins/Custom.make
210 plugin_src = \
211         ../plugins/asn1/packet-asn1.c \
212         ../plugins/docsis/packet-bintrngreq.c \
213         ../plugins/docsis/packet-bpkmattr.c \
214         ../plugins/docsis/packet-bpkmreq.c \
215         ../plugins/docsis/packet-bpkmrsp.c \
216         ../plugins/docsis/packet-docsis.c \
217         ../plugins/docsis/packet-dsaack.c \
218         ../plugins/docsis/packet-dsareq.c \
219         ../plugins/docsis/packet-dsarsp.c \
220         ../plugins/docsis/packet-dscack.c \
221         ../plugins/docsis/packet-dscreq.c \
222         ../plugins/docsis/packet-dscrsp.c \
223         ../plugins/docsis/packet-dsdreq.c \
224         ../plugins/docsis/packet-dsdrsp.c \
225         ../plugins/docsis/packet-intrngreq.c \
226         ../plugins/docsis/packet-macmgmt.c \
227         ../plugins/docsis/packet-map.c \
228         ../plugins/docsis/packet-regack.c \
229         ../plugins/docsis/packet-regreq.c \
230         ../plugins/docsis/packet-regrsp.c \
231         ../plugins/docsis/packet-rngreq.c \
232         ../plugins/docsis/packet-rngrsp.c \
233         ../plugins/docsis/packet-tlv.c \
234         ../plugins/docsis/packet-type29ucd.c \
235         ../plugins/docsis/packet-uccreq.c \
236         ../plugins/docsis/packet-uccrsp.c \
237         ../plugins/docsis/packet-ucd.c \
238         ../plugins/giop/packet-cosnaming.c \
239         ../plugins/giop/packet-coseventcomm.c \
240         ../plugins/gryphon/packet-gryphon.c \
241         ../plugins/interlink/packet-interlink.c \
242         ../plugins/irda/packet-irda.c \
243         ../plugins/m2m/packet-m2m.c \
244         ../plugins/m2m/wimax_tlv.c \
245         ../plugins/mgcp/packet-mgcp.c \
246         ../plugins/rdm/packet-rdm.c \
247         ../plugins/sercosiii/packet-sercosiii.c \
248         ../plugins/wimax/crc.c \
249         ../plugins/wimax/crc_data.c \
250         ../plugins/wimax/mac_hd_generic_decoder.c \
251         ../plugins/wimax/mac_hd_type1_decoder.c \
252         ../plugins/wimax/mac_hd_type2_decoder.c \
253         ../plugins/wimax/mac_mgmt_msg_decoder.c \
254         ../plugins/wimax/msg_aas_beam.c \
255         ../plugins/wimax/msg_aas_fbck.c \
256         ../plugins/wimax/msg_arq.c \
257         ../plugins/wimax/msg_clk_cmp.c \
258         ../plugins/wimax/msg_dcd.c \
259         ../plugins/wimax/msg_dlmap.c \
260         ../plugins/wimax/msg_dreg.c \
261         ../plugins/wimax/msg_dsa.c \
262         ../plugins/wimax/msg_dsc.c \
263         ../plugins/wimax/msg_dsd.c \
264         ../plugins/wimax/msg_dsx_rvd.c \
265         ../plugins/wimax/msg_fpc.c \
266         ../plugins/wimax/msg_pkm.c \
267         ../plugins/wimax/msg_pmc.c \
268         ../plugins/wimax/msg_prc_lt_ctrl.c \
269         ../plugins/wimax/msg_reg_req.c \
270         ../plugins/wimax/msg_reg_rsp.c \
271         ../plugins/wimax/msg_rep.c \
272         ../plugins/wimax/msg_res_cmd.c \
273         ../plugins/wimax/msg_rng_req.c \
274         ../plugins/wimax/msg_rng_rsp.c \
275         ../plugins/wimax/msg_sbc.c \
276         ../plugins/wimax/msg_ucd.c \
277         ../plugins/wimax/msg_ulmap.c \
278         ../plugins/wimax/packet-wmx.c \
279         ../plugins/wimax/wimax_cdma_code_decoder.c \
280         ../plugins/wimax/wimax_compact_dlmap_ie_decoder.c \
281         ../plugins/wimax/wimax_compact_ulmap_ie_decoder.c \
282         ../plugins/wimax/wimax_fch_decoder.c \
283         ../plugins/wimax/wimax_ffb_decoder.c \
284         ../plugins/wimax/wimax_hack_decoder.c \
285         ../plugins/wimax/wimax_harq_map_decoder.c \
286         ../plugins/wimax/wimax_pdu_decoder.c \
287         ../plugins/wimax/wimax_phy_attributes_decoder.c \
288         ../plugins/wimax/wimax_tlv.c \
289         ../plugins/wimax/wimax_utils.c
290
291
292 else            # ENABLE_STATIC
293
294 plugin_src =
295
296 endif           # ENABLE_STATIC
297
298 else            # HAVE_PLUGINS
299 plugin_src =
300
301 endif           # HAVE_PLUGINS
302
303 doxygen:
304 if HAVE_DOXYGEN
305         $(DOXYGEN) doxygen.cfg
306 endif           # HAVE_DOXYGEN
307
308 # ABI compliance checker can be obtained from
309 # http://ispras.linux-foundation.org/index.php/ABI_compliance_checker
310 # Checked using version 1.21.12
311 dumpabi: all abi-descriptor.xml
312         rm -rf abi-check-headers abi_dumps .libs/*.abi.tar.gz
313         mkdir abi-check-headers; cp ../color.h ../config.h ../register.h abi-check-headers/; \
314         mkdir abi-check-headers/epan; cp *.h abi-check-headers/epan; \
315         mkdir abi-check-headers/crypt; cp crypt/*.h abi-check-headers/crypt; \
316         mkdir abi-check-headers/dfilter; cp dfilter/*.h ../tools/lemon/cppmagic.h abi-check-headers/dfilter; \
317         mkdir abi-check-headers/dissectors; cp dissectors/*.h abi-check-headers/dissectors; \
318         rm abi-check-headers/dissectors/x11-extension-implementation.h \
319         abi-check-headers/dissectors/packet-rtps2.h \
320         abi-check-headers/dissectors/x11-glx-render-enum.h \
321         abi-check-headers/dissectors/x11-register-info.h \
322         abi-check-headers/dissectors/packet-idmp.h; \
323         mkdir abi-check-headers/ftypes; cp ftypes/*.h abi-check-headers/ftypes; \
324         abi-compliance-checker -l libwireshark -v1 `ls  .libs/libwireshark.so.?.?.?|sed 's/.*\.so\.//'` \
325                 -relpath $(abs_srcdir) -dump-abi abi-descriptor.xml && \
326         cp -f abi_dumps/libwireshark/libwireshark_* .libs/; \
327         cd .libs; ln -sf libwireshark_*.abi.tar.gz libwireshark.abi.tar.gz
328
329 checkapi:
330         $(PERL) ../tools/checkAPIs.pl -g termoutput $(LIBWIRESHARK_SRC)