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