From robionekenobi via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9375 :
[metze/wireshark/wip.git] / epan / Makefile.am
1 # Makefile.am
2 # Automake file for the libwireshark library
3 # (EPAN is a historical name; it stands for Ethereal Protocol ANalyzer
4 # Library)
5 #
6 # $Id$
7 #
8 # Wireshark - Network traffic analyzer
9 # By Gerald Combs <gerald@wireshark.org>
10 # Copyright 1998 Gerald Combs
11 #
12 # This program is free software; you can redistribute it and/or
13 # modify it under the terms of the GNU General Public License
14 # as published by the Free Software Foundation; either version 2
15 # of the License, or (at your option) any later version.
16 #
17 # This program is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 # GNU General Public License for more details.
21 #
22 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, write to the Free Software
24 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25
26 include ../Makefile.am.inc
27
28 if HAVE_LIBLUA
29 wslua_lib = wslua/libwslua.la
30 wslua_dir = wslua
31 wslua_dist_dir =
32 else            # HAVE_LIBLUA
33 wslua_lib =
34 wslua_dir =
35 wslua_dist_dir = wslua
36 endif           # HAVE_LIBLUA
37
38 if HAVE_LIBPY
39 wspython_lib = wspython/libwspython.la
40 wspython_dir = wspython
41 wspython_dist_dir =
42 py_dissectors_dir = -DPYTHON_DIR=\"@pythondir@\"
43 else
44 wspython_lib =
45 wspython_dir =
46 wspython_dist_dir = wspython
47 py_dissectors_dir = -DPYTHONDIR=
48 endif
49
50 SUBDIRS = crypt ftypes dfilter dissectors wmem $(wslua_dir) $(wspython_dir)
51
52 DIST_SUBDIRS = $(SUBDIRS) $(wslua_dist_dir) $(wspython_dist_dir)
53
54 ACLOCAL_AMFLAGS = `../aclocal-flags`
55
56 noinst_LTLIBRARIES = libwireshark_generated.la libwireshark_asmopt.la
57 lib_LTLIBRARIES = libwireshark.la
58 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
59 libwireshark_la_LDFLAGS = -version-info 0:0:0 @LDFLAGS_SHAREDLIB@
60
61 include Makefile.common
62
63 AM_CPPFLAGS = -I$(srcdir)/.. -I$(srcdir)/$(LEMON) -I$(builddir)/wslua \
64         @LUA_INCLUDES@ $(LIBGNUTLS_CFLAGS) $(LIBGCRYPT_CFLAGS) \
65         $(LIBSMI_CFLAGS) $(LIBGEOIP_CFLAGS) $(PY_CFLAGS) \
66         -DTOP_SRCDIR=\"$(abs_top_srcdir)\"
67
68 AM_NON_GENERATED_CFLAGS =-DWS_BUILD_DLL
69
70 if HAVE_WARNINGS_AS_ERRORS
71 AM_NON_GENERATED_CFLAGS += -Werror
72 endif
73
74 #Since code generated by lex may trigger gcc warnings, we are now generating two
75 #libraries.  A single library is generated with the lex code without the barrier
76 #"stop on warning". An other library is generated from the remaining source
77 #files with the "stop on warning" barrier.
78 libwireshark_la_SOURCES = \
79         $(LIBWIRESHARK_SRC)     \
80         $(LIBWIRESHARK_INCLUDES)
81 libwireshark_la_CFLAGS = $(AM_NON_GENERATED_CFLAGS) $(py_dissectors_dir)
82
83 libwireshark_generated_la_SOURCES = \
84         $(LIBWIRESHARK_GENERATED_C_FILES) \
85         $(LIBWIRESHARK_GENERATED_HEADER_FILES)
86
87 nodist_libwireshark_generated_la_SOURCES = \
88         $(NODIST_LIBWIRESHARK_GENERATED_C_FILES) \
89         $(NODIST_LIBWIRESHARK_GENERATED_HEADER_FILES)
90
91 # code optionally implemented in assembler
92 # only C source available for platforms other than Win32
93 libwireshark_asmopt_la_SOURCES = \
94         asm_utils.c             \
95         asm_utils.h             \
96         asm_utils_win32_x86.asm
97
98 EXTRA_DIST = \
99         diam_dict.l             \
100         dtd_grammar.lemon       \
101         dtd_parse.l             \
102         dtd_parse.h             \
103         dtd_preparse.l          \
104         enterprise-numbers      \
105         libwireshark.vcproj     \
106         Makefile.common         \
107         Makefile.nmake          \
108         radius_dict.l           \
109         tvbtest.c               \
110         reassemble_test.c       \
111         uat_load.l              \
112         exntest.c               \
113         oids_test.c             \
114         doxygen.cfg.in          \
115         CMakeLists.txt
116
117 CLEANFILES = \
118         doxygen-epan.tag                \
119         libwireshark.a                  \
120         libwireshark.la                 \
121         libwireshark_generated.a        \
122         libwireshark_generated.la       \
123         libwireshark_asmopt.a           \
124         libwireshark_asmopt.la          \
125         *~
126
127 DISTCLEANFILES = \
128         $(NODIST_LIBWIRESHARK_GENERATED_C_FILES) \
129         $(NODIST_LIBWIRESHARK_GENERATED_HEADER_FILES) \
130         dtd_grammar.out
131
132 MAINTAINERCLEANFILES = \
133         $(LIBWIRESHARK_GENERATED_C_FILES) \
134         $(LIBWIRESHARK_GENERATED_HEADER_FILES) \
135         Makefile.in             \
136         sminmpec.c
137
138 #
139 # Add the object files for missing routines, if any.
140 #
141 libwireshark_la_LIBADD = \
142         libwireshark_generated.la \
143         libwireshark_asmopt.la crypt/libairpdcap.la \
144         ftypes/libftypes.la dfilter/libdfilter.la dissectors/libdissectors.la \
145         dissectors/libdirtydissectors.la dissectors/libfiledissectors.la \
146         wmem/libwmem.la $(wslua_lib) $(wspython_lib) @SOCKET_LIBS@ @NSL_LIBS@ \
147         @C_ARES_LIBS@ @ADNS_LIBS@ @LIBGCRYPT_LIBS@ @LIBGNUTLS_LIBS@ \
148         @KRB5_LIBS@ @SSL_LIBS@ @LIBSMI_LDFLAGS@ @GEOIP_LIBS@ \
149         ${top_builddir}/wiretap/libwiretap.la @GLIB_LIBS@ \
150         ${top_builddir}/wsutil/libwsutil.la -lm
151
152 libwireshark_la_DEPENDENCIES = \
153         libwireshark_generated.la \
154         libwireshark_asmopt.la crypt/libairpdcap.la \
155         ftypes/libftypes.la dfilter/libdfilter.la dissectors/libdissectors.la \
156         dissectors/libdirtydissectors.la wmem/libwmem.la $(wslua_lib) $(wspython_lib) \
157         ${top_builddir}/wsutil/libwsutil.la \
158         ${top_builddir}/wiretap/libwiretap.la
159
160 EXTRA_PROGRAMS = reassemble_test tvbtest oids_test
161 reassemble_test_LDADD = \
162         libwireshark.la \
163         $(GLIB_LIBS) \
164         -lz
165
166 tvbtest_LDADD = \
167         libwireshark.la \
168         $(GLIB_LIBS) \
169         -lz
170
171 oids_test_LDADD = \
172         libwireshark.la \
173         $(GLIB_LIBS) \
174         -lz
175
176 exntest: exntest.o except.o
177         $(LINK) $^ $(GLIB_LIBS)
178
179 RUNLEX=$(top_srcdir)/tools/runlex.sh
180
181 diam_dict_lex.h: diam_dict.c
182
183 dtd_parse_lex.h: dtd_parse.c
184
185 dtd_parse.lo: dtd_grammar.h
186
187 dtd_preparse_lex.h: dtd_preparse.c
188
189 radius_dict_lex.h: radius_dict.c
190
191 uat_load_lex.h: uat_load.c
192
193 LEMON=../tools/lemon
194
195 dtd_grammar.h: dtd_grammar.c
196 dtd_grammar.c : $(LEMON)/lemon$(EXEEXT) $(srcdir)/$(LEMON)/lempar.c $(srcdir)/dtd_grammar.lemon
197         $(AM_V_LEMON)$(LEMON)/lemon$(EXEEXT) t=$(srcdir)/$(LEMON)/lempar.c $(srcdir)/dtd_grammar.lemon
198
199 tvbtest.o exntest.o oids_test.o: exceptions.h
200
201 sminmpec.c: enterprise-numbers ../tools/make-sminmpec.pl
202         $(PERL) $(srcdir)/../tools/make-sminmpec.pl $(srcdir)/enterprise-numbers sminmpec.c
203
204 ps.c: print.ps $(top_srcdir)/tools/rdps.py
205         $(PYTHON) $(top_srcdir)/tools/rdps.py $(srcdir)/print.ps ps.c
206
207 if HAVE_PLUGINS
208
209 if ENABLE_STATIC
210 -include ../plugins/Custom.make
211 plugin_src = \
212         ../plugins/asn1/packet-asn1.c \
213         ../plugins/docsis/packet-bintrngreq.c \
214         ../plugins/docsis/packet-bpkmattr.c \
215         ../plugins/docsis/packet-bpkmreq.c \
216         ../plugins/docsis/packet-bpkmrsp.c \
217         ../plugins/docsis/packet-docsis.c \
218         ../plugins/docsis/packet-dsaack.c \
219         ../plugins/docsis/packet-dsareq.c \
220         ../plugins/docsis/packet-dsarsp.c \
221         ../plugins/docsis/packet-dscack.c \
222         ../plugins/docsis/packet-dscreq.c \
223         ../plugins/docsis/packet-dscrsp.c \
224         ../plugins/docsis/packet-dsdreq.c \
225         ../plugins/docsis/packet-dsdrsp.c \
226         ../plugins/docsis/packet-intrngreq.c \
227         ../plugins/docsis/packet-macmgmt.c \
228         ../plugins/docsis/packet-map.c \
229         ../plugins/docsis/packet-regack.c \
230         ../plugins/docsis/packet-regreq.c \
231         ../plugins/docsis/packet-regrsp.c \
232         ../plugins/docsis/packet-rngreq.c \
233         ../plugins/docsis/packet-rngrsp.c \
234         ../plugins/docsis/packet-tlv.c \
235         ../plugins/docsis/packet-type29ucd.c \
236         ../plugins/docsis/packet-uccreq.c \
237         ../plugins/docsis/packet-uccrsp.c \
238         ../plugins/docsis/packet-ucd.c \
239         ../plugins/giop/packet-cosnaming.c \
240         ../plugins/giop/packet-coseventcomm.c \
241         ../plugins/gryphon/packet-gryphon.c \
242         ../plugins/interlink/packet-interlink.c \
243         ../plugins/irda/packet-irda.c \
244         ../plugins/m2m/packet-m2m.c \
245         ../plugins/m2m/wimax_tlv.c \
246         ../plugins/mgcp/packet-mgcp.c \
247         ../plugins/rdm/packet-rdm.c \
248         ../plugins/sercosiii/packet-sercosiii.c \
249         ../plugins/wimax/crc.c \
250         ../plugins/wimax/crc_data.c \
251         ../plugins/wimax/mac_hd_generic_decoder.c \
252         ../plugins/wimax/mac_hd_type1_decoder.c \
253         ../plugins/wimax/mac_hd_type2_decoder.c \
254         ../plugins/wimax/mac_mgmt_msg_decoder.c \
255         ../plugins/wimax/msg_aas_beam.c \
256         ../plugins/wimax/msg_aas_fbck.c \
257         ../plugins/wimax/msg_arq.c \
258         ../plugins/wimax/msg_clk_cmp.c \
259         ../plugins/wimax/msg_dcd.c \
260         ../plugins/wimax/msg_dlmap.c \
261         ../plugins/wimax/msg_dreg.c \
262         ../plugins/wimax/msg_dsa.c \
263         ../plugins/wimax/msg_dsc.c \
264         ../plugins/wimax/msg_dsd.c \
265         ../plugins/wimax/msg_dsx_rvd.c \
266         ../plugins/wimax/msg_fpc.c \
267         ../plugins/wimax/msg_pkm.c \
268         ../plugins/wimax/msg_pmc.c \
269         ../plugins/wimax/msg_prc_lt_ctrl.c \
270         ../plugins/wimax/msg_reg_req.c \
271         ../plugins/wimax/msg_reg_rsp.c \
272         ../plugins/wimax/msg_rep.c \
273         ../plugins/wimax/msg_res_cmd.c \
274         ../plugins/wimax/msg_rng_req.c \
275         ../plugins/wimax/msg_rng_rsp.c \
276         ../plugins/wimax/msg_sbc.c \
277         ../plugins/wimax/msg_ucd.c \
278         ../plugins/wimax/msg_ulmap.c \
279         ../plugins/wimax/packet-wmx.c \
280         ../plugins/wimax/wimax_cdma_code_decoder.c \
281         ../plugins/wimax/wimax_compact_dlmap_ie_decoder.c \
282         ../plugins/wimax/wimax_compact_ulmap_ie_decoder.c \
283         ../plugins/wimax/wimax_fch_decoder.c \
284         ../plugins/wimax/wimax_ffb_decoder.c \
285         ../plugins/wimax/wimax_hack_decoder.c \
286         ../plugins/wimax/wimax_harq_map_decoder.c \
287         ../plugins/wimax/wimax_pdu_decoder.c \
288         ../plugins/wimax/wimax_phy_attributes_decoder.c \
289         ../plugins/wimax/wimax_tlv.c \
290         ../plugins/wimax/wimax_utils.c
291
292
293 else            # ENABLE_STATIC
294
295 plugin_src =
296
297 endif           # ENABLE_STATIC
298
299 else            # HAVE_PLUGINS
300 plugin_src =
301
302 endif           # HAVE_PLUGINS
303
304 doxygen:
305 if HAVE_DOXYGEN
306         $(AM_V_GEN)$(DOXYGEN) doxygen.cfg
307 endif           # HAVE_DOXYGEN
308
309 wsar_html: doxygen.cfg ../doxygen_global.cfg
310 if HAVE_DOXYGEN
311         (umask 022 ; $(DOXYGEN) doxygen.cfg)
312 endif
313
314 # ABI compliance checker can be obtained from
315 # http://ispras.linux-foundation.org/index.php/ABI_compliance_checker
316 # Checked using version 1.21.12
317 dumpabi-libwireshark: all abi-descriptor.xml
318         rm -rf abi-check-headers abi_dumps .libs/*.abi.tar.gz
319         mkdir abi-check-headers
320         cp ../color.h ../config.h ../register.h abi-check-headers/
321         mkdir abi-check-headers/epan
322         cp *.h abi-check-headers/epan
323         mkdir abi-check-headers/crypt
324         cp crypt/*.h abi-check-headers/crypt
325         mkdir abi-check-headers/dfilter
326         cp dfilter/*.h ../tools/lemon/cppmagic.h abi-check-headers/dfilter
327         mkdir abi-check-headers/dissectors
328         cp dissectors/*.h abi-check-headers/dissectors
329         rm \
330                 abi-check-headers/dissectors/x11-extension-implementation.h \
331                 abi-check-headers/dissectors/x11-glx-render-enum.h \
332                 abi-check-headers/dissectors/x11-register-info.h \
333                 abi-check-headers/dissectors/packet-idmp.h
334         mkdir abi-check-headers/ftypes
335         cp ftypes/*.h abi-check-headers/ftypes
336         mkdir abi-check-headers/wmem
337         cp wmem/*.h abi-check-headers/wmem
338         abi-compliance-checker -l libwireshark -v1 `readlink .libs/libwireshark.so | sed 's/.*\.so\.//'` \
339                 -relpath $(abs_srcdir) -dump-abi abi-descriptor.xml || \
340                 cat logs/libwireshark/[0-9]*/log.txt
341         cp -f abi_dumps/libwireshark/libwireshark_* .libs/
342         cd .libs && ln -sf libwireshark_*.abi.tar.gz libwireshark.abi.tar.gz
343
344 checkapi:
345         $(AM_V_GEN)$(PERL) ../tools/checkAPIs.pl -g termoutput -build $(LIBWIRESHARK_SRC)