Remove Makefile.common files
[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 $(top_srcdir)/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 AM_CPPFLAGS = $(INCLUDEDIRS) -I$(builddir)/wslua $(WS_CPPFLAGS) \
41         $(GLIB_CFLAGS) $(LUA_CFLAGS) $(LIBGNUTLS_CFLAGS) \
42         $(LIBGCRYPT_CFLAGS) $(LIBSMI_CFLAGS) $(LIBGEOIP_CFLAGS) \
43         $(KRB5_CFLAGS)
44
45 noinst_LTLIBRARIES = libwireshark_generated.la libwireshark_asmopt.la
46 lib_LTLIBRARIES = libwireshark.la
47
48 LIBWIRESHARK_SRC = \
49         addr_and_mask.c         \
50         addr_resolv.c           \
51         address_types.c         \
52         afn.c                   \
53         aftypes.c               \
54         app_mem_usage.c         \
55         asn1.c                  \
56         capture_dissectors.c    \
57         charsets.c              \
58         circuit.c               \
59         color_filters.c         \
60         column.c                \
61         column-utils.c          \
62         conversation.c          \
63         conversation_table.c    \
64         crc10-tvb.c             \
65         crc16-tvb.c             \
66         crc32-tvb.c             \
67         crc6-tvb.c              \
68         crc8-tvb.c              \
69         decode_as.c             \
70         disabled_protos.c       \
71         dissector_filters.c     \
72         dvb_chartbl.c           \
73         dwarf.c                 \
74         epan.c                  \
75         ex-opt.c                \
76         except.c                \
77         expert.c                \
78         exported_pdu.c          \
79         plugin_if.c             \
80         filter_expressions.c    \
81         follow.c                \
82         frame_data.c            \
83         frame_data_sequence.c   \
84         funnel.c                \
85         g_int64_hash_routines.c \
86         geoip_db.c              \
87         golay.c                 \
88         guid-utils.c            \
89         iana_charsets.c         \
90         in_cksum.c              \
91         ipproto.c               \
92         ipv4.c                  \
93         next_tvb.c              \
94         oids.c                  \
95         osi-utils.c             \
96         oui.c                   \
97         packet-range.c          \
98         packet.c                \
99         prefs.c                 \
100         print.c                 \
101         print_stream.c          \
102         proto.c                 \
103         proto_data.c            \
104         range.c                 \
105         reassemble.c            \
106         reedsolomon.c           \
107         req_resp_hdrs.c         \
108         rtd_table.c             \
109         show_exception.c        \
110         sminmpec.c              \
111         srt_table.c             \
112         stat_tap_ui.c           \
113         stats_tree.c            \
114         strutil.c               \
115         stream.c                \
116         t35.c                   \
117         tap.c                   \
118         timestamp.c             \
119         timestats.c             \
120         tfs.c                   \
121         to_str.c                \
122         tvbparse.c              \
123         tvbuff_base64.c         \
124         tvbuff_composite.c      \
125         tvbuff_real.c           \
126         tvbuff_subset.c         \
127         tvbuff_zlib.c           \
128         tvbuff.c                \
129         uat.c                   \
130         value_string.c          \
131         xdlc.c
132
133 #
134 # We distribute Lemon and rdps.py with Wireshark, so we don't distribute the
135 # files they produce.
136 #
137 NODIST_LIBWIRESHARK_GENERATED_C_FILES = \
138         dtd_grammar.c                   \
139         ps.c
140
141 NODIST_LIBWIRESHARK_GENERATED_HEADER_FILES = \
142         dtd_grammar.h
143
144 #
145 # These don't get removed on "make distclean", as the tools we use to
146 # generate them aren't part of the Wireshark distribution, and aren't
147 # tools assumed to be present for any system capable of compiling
148 # from a tarball (e.g., make and a C compiler are assumed to be present,
149 # but Flex isn't).
150 #
151 LIBWIRESHARK_GENERATED_C_FILES = \
152         diam_dict.c             \
153         dtd_parse.c             \
154         dtd_preparse.c          \
155         radius_dict.c           \
156         uat_load.c
157
158 LIBWIRESHARK_GENERATED_HEADER_FILES = \
159         diam_dict_lex.h         \
160         dtd_parse_lex.h         \
161         dtd_preparse_lex.h      \
162         radius_dict_lex.h       \
163         uat_load_lex.h
164
165 LIBWIRESHARK_GENERATED_SRC = \
166         $(LIBWIRESHARK_GENERATED_C_FILES) \
167         $(NODIST_LIBWIRESHARK_GENERATED_C_FILES)
168
169 LIBWIRESHARK_ALL_SRC = \
170         $(LIBWIRESHARK_SRC)     \
171         $(LIBWIRESHARK_GENERATED_SRC)
172
173 LIBWIRESHARK_INCLUDES = \
174         addr_and_mask.h         \
175         addr_resolv.h           \
176         address.h               \
177         address_types.h         \
178         afn.h                   \
179         aftypes.h               \
180         app_mem_usage.h         \
181         arcnet_pids.h           \
182         arptypes.h              \
183         asn1.h                  \
184         ax25_pids.h             \
185         bridged_pids.h          \
186         capture_dissectors.h    \
187         charsets.h              \
188         chdlctypes.h            \
189         circuit.h               \
190         color_filters.h         \
191         column.h                \
192         column-info.h           \
193         column-utils.h          \
194         conversation.h          \
195         conversation_debug.h    \
196         conversation_table.h    \
197         conv_id.h               \
198         crc10-tvb.h             \
199         crc16-tvb.h             \
200         crc32-tvb.h             \
201         crc6-tvb.h              \
202         crc8-tvb.h              \
203         decode_as.h             \
204         diam_dict.h             \
205         disabled_protos.h       \
206         dissector_filters.h     \
207         dtd.h                   \
208         dtd_parse.h             \
209         dvb_chartbl.h           \
210         dwarf.h                 \
211         eap.h                   \
212         eapol_keydes_types.h    \
213         epan-int.h              \
214         epan.h                  \
215         epan_dissect.h          \
216         etypes.h                \
217         ex-opt.h                \
218         except.h                \
219         exceptions.h            \
220         expert.h                \
221         exported_pdu.h          \
222         plugin_if.h             \
223         filter_expressions.h    \
224         follow.h                \
225         frame_data.h            \
226         frame_data_sequence.h   \
227         funnel.h                \
228         g_int64_hash_routines.h \
229         garrayfix.h             \
230         geoip_db.h              \
231         golay.h                 \
232         guid-utils.h            \
233         iana_charsets.h         \
234         iax2_codec_type.h       \
235         in_cksum.h              \
236         ip_opts.h               \
237         ipproto.h               \
238         ipv4.h                  \
239         ipv6.h                  \
240         lapd_sapi.h             \
241         llcsaps.h               \
242         next_tvb.h              \
243         nlpid.h                 \
244         oids.h                  \
245         osi-utils.h             \
246         oui.h                   \
247         packet-range.h          \
248         packet.h                \
249         packet_info.h           \
250         params.h                \
251         ppptypes.h              \
252         print.h                 \
253         print_stream.h          \
254         prefs.h                 \
255         prefs-int.h             \
256         proto.h                 \
257         proto_data.h            \
258         ps.h                    \
259         ptvcursor.h             \
260         range.h                 \
261         reassemble.h            \
262         reedsolomon.h           \
263         req_resp_hdrs.h         \
264         rtd_table.h             \
265         rtp_pt.h                \
266         sctpppids.h             \
267         show_exception.h        \
268         slow_protocol_subtypes.h \
269         sminmpec.h              \
270         srt_table.h             \
271         stat_tap_ui.h           \
272         stat_groups.h           \
273         stats_tree.h            \
274         stats_tree_priv.h       \
275         stream.h                \
276         strutil.h               \
277         t35.h                   \
278         tap.h                   \
279         tap-voip.h              \
280         timestamp.h             \
281         timestats.h             \
282         tfs.h                   \
283         time_fmt.h              \
284         to_str.h                \
285         to_str-int.h            \
286         tvbparse.h              \
287         tvbuff.h                \
288         tvbuff-int.h            \
289         uat.h                   \
290         uat-int.h               \
291         value_string.h          \
292         x264_prt_id.h           \
293         xdlc.h
294
295 #Since code generated by lex may trigger gcc warnings, we are now generating two
296 #libraries. A single library is generated with the lex code without the barrier
297 #"stop on warning". An other library is generated from the remaining source
298 #files with the "stop on warning" barrier.
299 libwireshark_la_SOURCES = \
300         $(LIBWIRESHARK_SRC)             \
301         $(LIBWIRESHARK_INCLUDES)        \
302         ws_version_info.c
303
304 libwireshark_la_CPPFLAGS = $(AM_CPPFLAGS) -DWS_BUILD_DLL
305
306 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
307 libwireshark_la_LDFLAGS = -version-info 0:0:0 @LDFLAGS_SHAREDLIB@
308
309 #
310 # Add the object files for missing routines, if any.
311 #
312 libwireshark_la_LIBADD = \
313         libwireshark_generated.la               \
314         libwireshark_asmopt.la                  \
315         crypt/libairpdcap.la                    \
316         ftypes/libftypes.la                     \
317         dfilter/libdfilter.la                   \
318         dissectors/libdissectors.la             \
319         dissectors/libdirtydissectors.la        \
320         dissectors/libfiledissectors.la         \
321         nghttp2/libnghttp2.la                   \
322         wmem/libwmem.la                         \
323         $(wslua_lib)                            \
324         ${top_builddir}/wiretap/libwiretap.la   \
325         ${top_builddir}/wsutil/libwsutil.la     \
326         @C_ARES_LIBS@           \
327         @LIBGCRYPT_LIBS@        \
328         @LIBGNUTLS_LIBS@        \
329         @KRB5_LIBS@             \
330         @SSL_LIBS@              \
331         @LIBSMI_LDFLAGS@        \
332         @GEOIP_LIBS@            \
333         @GLIB_LIBS@
334
335 libwireshark_la_DEPENDENCIES = \
336         libwireshark_generated.la               \
337         compress/liblzxpress.la                 \
338         libwireshark_asmopt.la                  \
339         crypt/libairpdcap.la                    \
340         ftypes/libftypes.la                     \
341         dfilter/libdfilter.la                   \
342         dissectors/libdissectors.la             \
343         dissectors/libdirtydissectors.la        \
344         nghttp2/libnghttp2.la                   \
345         wmem/libwmem.la                         \
346         $(wslua_lib)                            \
347         ${top_builddir}/wsutil/libwsutil.la     \
348         ${top_builddir}/wiretap/libwiretap.la
349
350 libwireshark_generated_la_SOURCES = \
351         $(LIBWIRESHARK_GENERATED_C_FILES) \
352         $(LIBWIRESHARK_GENERATED_HEADER_FILES)
353
354 nodist_libwireshark_generated_la_SOURCES = \
355         $(NODIST_LIBWIRESHARK_GENERATED_C_FILES) \
356         $(NODIST_LIBWIRESHARK_GENERATED_HEADER_FILES)
357
358 libwireshark_generated_la_CFLAGS = $(GENERATED_CFLAGS)
359
360 # code optionally implemented in assembler
361 # only C source available for platforms other than Win32
362 libwireshark_asmopt_la_SOURCES = \
363         asm_utils.c             \
364         asm_utils.h             \
365         asm_utils_win32_x86.asm
366
367 EXTRA_DIST = \
368         .editorconfig           \
369         diam_dict.l             \
370         dtd_grammar.lemon       \
371         dtd_parse.l             \
372         dtd_parse.h             \
373         dtd_preparse.l          \
374         enterprise-numbers      \
375         radius_dict.l           \
376         uat_load.l              \
377         doxygen.cfg.in          \
378         CMakeLists.txt          \
379         print.ps
380
381 CLEANFILES = \
382         doxygen-epan.tag                \
383         libwireshark.a                  \
384         libwireshark.la                 \
385         libwireshark_generated.a        \
386         libwireshark_generated.la       \
387         libwireshark_asmopt.a           \
388         libwireshark_asmopt.la          \
389         *~
390
391 DISTCLEANFILES = \
392         $(NODIST_LIBWIRESHARK_GENERATED_C_FILES) \
393         $(NODIST_LIBWIRESHARK_GENERATED_HEADER_FILES) \
394         dtd_grammar.out \
395         ws_version_info.c
396
397 MAINTAINERCLEANFILES = \
398         $(LIBWIRESHARK_GENERATED_C_FILES) \
399         $(LIBWIRESHARK_GENERATED_HEADER_FILES) \
400         Makefile.in
401
402 BUILT_SOURCES = \
403         $(LIBWIRESHARK_GENERATED_HEADER_FILES) \
404         $(NODIST_LIBWIRESHARK_GENERATED_HEADER_FILES) \
405         ws_version_info.c
406
407 EXTRA_PROGRAMS = reassemble_test tvbtest oids_test exntest
408
409 reassemble_test_LDADD = \
410         libwireshark.la \
411         $(GLIB_LIBS) \
412         -lz
413
414 tvbtest_LDADD = \
415         libwireshark.la \
416         $(GLIB_LIBS) \
417         -lz
418
419 oids_test_LDADD = \
420         libwireshark.la \
421         $(GLIB_LIBS) \
422         -lz
423
424 exntest_SOURCES = exntest.c except.c
425
426 exntest_LDADD = $(GLIB_LIBS)
427
428 test-programs: $(EXTRA_PROGRAMS)
429         $(MAKE) -C wmem $@
430
431 diam_dict_lex.h: diam_dict.c
432
433 dtd_parse_lex.h: dtd_parse.c
434
435 dtd_preparse_lex.h: dtd_preparse.c
436
437 radius_dict_lex.h: radius_dict.c
438
439 uat_load_lex.h: uat_load.c
440
441 dtd_grammar.h: dtd_grammar.c
442 dtd_grammar.c : $(LEMON) $(lemon_srcdir)/lempar.c $(srcdir)/dtd_grammar.lemon
443         $(AM_V_LEMON)$(LEMON) T=$(lemon_srcdir)/lempar.c $(srcdir)/dtd_grammar.lemon
444
445 ws_version_info.c: $(top_srcdir)/ws_version_info.c
446         $(AM_V_LN_S)$(LN_S) $<
447
448 tvbtest.o exntest.o oids_test.o: exceptions.h
449
450 update-sminmpec:
451         $(PERL) $(srcdir)/../tools/make-sminmpec.pl
452
453 ps.c: print.ps $(top_srcdir)/tools/rdps.py
454         $(AM_V_python)$(PYTHON) $(top_srcdir)/tools/rdps.py $(srcdir)/print.ps ps.c
455
456 if HAVE_PLUGINS
457
458 if ENABLE_STATIC
459 -include ../plugins/Custom.make
460 plugin_src = \
461         ../plugins/asn1/packet-asn1.c \
462         ../plugins/docsis/packet-bintrngreq.c \
463         ../plugins/docsis/packet-bpkmattr.c \
464         ../plugins/docsis/packet-bpkmreq.c \
465         ../plugins/docsis/packet-bpkmrsp.c \
466         ../plugins/docsis/packet-docsis.c \
467         ../plugins/docsis/packet-dsaack.c \
468         ../plugins/docsis/packet-dsareq.c \
469         ../plugins/docsis/packet-dsarsp.c \
470         ../plugins/docsis/packet-dscack.c \
471         ../plugins/docsis/packet-dscreq.c \
472         ../plugins/docsis/packet-dscrsp.c \
473         ../plugins/docsis/packet-dsdreq.c \
474         ../plugins/docsis/packet-dsdrsp.c \
475         ../plugins/docsis/packet-intrngreq.c \
476         ../plugins/docsis/packet-macmgmt.c \
477         ../plugins/docsis/packet-map.c \
478         ../plugins/docsis/packet-regack.c \
479         ../plugins/docsis/packet-regreq.c \
480         ../plugins/docsis/packet-regrsp.c \
481         ../plugins/docsis/packet-rngreq.c \
482         ../plugins/docsis/packet-rngrsp.c \
483         ../plugins/docsis/packet-tlv.c \
484         ../plugins/docsis/packet-type29ucd.c \
485         ../plugins/docsis/packet-uccreq.c \
486         ../plugins/docsis/packet-uccrsp.c \
487         ../plugins/docsis/packet-ucd.c \
488         ../plugins/gryphon/packet-gryphon.c \
489         ../plugins/irda/packet-irda.c \
490         ../plugins/m2m/packet-m2m.c \
491         ../plugins/m2m/wimax_tlv.c \
492         ../plugins/wimax/crc.c \
493         ../plugins/wimax/crc_data.c \
494         ../plugins/wimax/mac_hd_generic_decoder.c \
495         ../plugins/wimax/mac_hd_type1_decoder.c \
496         ../plugins/wimax/mac_hd_type2_decoder.c \
497         ../plugins/wimax/mac_mgmt_msg_decoder.c \
498         ../plugins/wimax/msg_aas_beam.c \
499         ../plugins/wimax/msg_aas_fbck.c \
500         ../plugins/wimax/msg_arq.c \
501         ../plugins/wimax/msg_clk_cmp.c \
502         ../plugins/wimax/msg_dcd.c \
503         ../plugins/wimax/msg_dlmap.c \
504         ../plugins/wimax/msg_dreg.c \
505         ../plugins/wimax/msg_dsa.c \
506         ../plugins/wimax/msg_dsc.c \
507         ../plugins/wimax/msg_dsd.c \
508         ../plugins/wimax/msg_dsx_rvd.c \
509         ../plugins/wimax/msg_fpc.c \
510         ../plugins/wimax/msg_pkm.c \
511         ../plugins/wimax/msg_pmc.c \
512         ../plugins/wimax/msg_prc_lt_ctrl.c \
513         ../plugins/wimax/msg_reg_req.c \
514         ../plugins/wimax/msg_reg_rsp.c \
515         ../plugins/wimax/msg_rep.c \
516         ../plugins/wimax/msg_res_cmd.c \
517         ../plugins/wimax/msg_rng_req.c \
518         ../plugins/wimax/msg_rng_rsp.c \
519         ../plugins/wimax/msg_sbc.c \
520         ../plugins/wimax/msg_ucd.c \
521         ../plugins/wimax/msg_ulmap.c \
522         ../plugins/wimax/packet-wmx.c \
523         ../plugins/wimax/wimax_cdma_code_decoder.c \
524         ../plugins/wimax/wimax_compact_dlmap_ie_decoder.c \
525         ../plugins/wimax/wimax_compact_ulmap_ie_decoder.c \
526         ../plugins/wimax/wimax_fch_decoder.c \
527         ../plugins/wimax/wimax_ffb_decoder.c \
528         ../plugins/wimax/wimax_hack_decoder.c \
529         ../plugins/wimax/wimax_harq_map_decoder.c \
530         ../plugins/wimax/wimax_pdu_decoder.c \
531         ../plugins/wimax/wimax_phy_attributes_decoder.c \
532         ../plugins/wimax/wimax_tlv.c \
533         ../plugins/wimax/wimax_utils.c
534
535
536 else            # ENABLE_STATIC
537
538 plugin_src =
539
540 endif           # ENABLE_STATIC
541
542 else            # HAVE_PLUGINS
543 plugin_src =
544
545 endif           # HAVE_PLUGINS
546
547 doxygen:
548 if HAVE_DOXYGEN
549         $(AM_V_GEN)$(DOXYGEN) doxygen.cfg
550 endif           # HAVE_DOXYGEN
551
552 wsar_html: doxygen.cfg ../doxygen_global.cfg
553 if HAVE_DOXYGEN
554         (umask 022 ; $(DOXYGEN) doxygen.cfg)
555 endif
556
557 # ABI compliance checker can be obtained from
558 # http://ispras.linux-foundation.org/index.php/ABI_compliance_checker
559 # Checked using version 1.21.12
560 dumpabi-libwireshark: all abi-descriptor.xml
561         rm -rf abi-check-headers abi_dumps .libs/*.abi.tar.gz
562         mkdir abi-check-headers
563         cp ../config.h ../register.h abi-check-headers/
564         mkdir abi-check-headers/epan
565         cp *.h abi-check-headers/epan
566         mkdir abi-check-headers/crypt
567         cp crypt/*.h abi-check-headers/crypt
568         mkdir abi-check-headers/compress
569         cp compress/*.h abi-check-headers/compress
570         mkdir abi-check-headers/dfilter
571         cp dfilter/*.h ../tools/lemon/cppmagic.h abi-check-headers/dfilter
572         mkdir abi-check-headers/dissectors
573         cp dissectors/*.h abi-check-headers/dissectors
574         rm \
575                 abi-check-headers/dissectors/x11-extension-implementation.h \
576                 abi-check-headers/dissectors/x11-glx-render-enum.h \
577                 abi-check-headers/dissectors/x11-register-info.h \
578                 abi-check-headers/dissectors/packet-idmp.h
579         mkdir abi-check-headers/ftypes
580         cp ftypes/*.h abi-check-headers/ftypes
581         mkdir abi-check-headers/wmem
582         cp wmem/*.h abi-check-headers/wmem
583         abi-compliance-checker -log-path abi_logs/log.txt -l libwireshark -v1 `readlink .libs/libwireshark.so | sed 's/.*\.so\.//'` \
584                 -relpath $(abs_srcdir) -dump-abi abi-descriptor.xml || \
585                 cat abi_logs/log.txt logs/libwireshark/[0-9]*/log.txt
586         cp -f abi_dumps/libwireshark/libwireshark_* .libs/
587         cd .libs && ln -sf libwireshark_*.abi.tar.gz libwireshark.abi.tar.gz
588
589 maintainer-clean-local: clean-dumpabi-libwireshark
590
591 .PHONY: clean-dumpabi-libwireshark
592
593 clean-dumpabi-libwireshark:
594         rm -rf abi-check-headers abi_dumps .libs/*.abi.tar.gz abi_logs abi-descriptor.xml
595
596 checkapi:
597         $(AM_V_GEN)$(PERL) $(top_srcdir)/tools/checkAPIs.pl -g termoutput -build \
598         -sourcedir=$(srcdir) \
599         $(LIBWIRESHARK_SRC)