autotools: Don't use "user variables" to set build flags
[metze/wireshark/wip.git] / wiretap / Makefile.am
1 # Makefile.am
2 # Automake file for Wiretap
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 include Makefile.common
23 include $(top_srcdir)/Makefile.am.inc
24
25 ACLOCAL_AMFLAGS = `../aclocal-flags`
26
27 AM_CPPFLAGS += -DWS_BUILD_DLL
28
29 noinst_LTLIBRARIES = libwiretap_generated.la
30 lib_LTLIBRARIES = libwiretap.la
31 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
32 libwiretap_la_LDFLAGS = -version-info 0:0:0 @LDFLAGS_SHAREDLIB@
33
34 CLEANFILES = \
35         libwiretap.a            \
36         libwiretap.la           \
37         libwiretap_generated.a  \
38         libwiretap_generated.la \
39         *~
40
41 MAINTAINERCLEANFILES = \
42         $(GENERATED_FILES)      \
43         Makefile.in
44
45 #Since code generated by lex may trigger gcc warnings, we are now generating two
46 #libraries.  A single library is generated with the lex code without the barrier
47 #"stop on warning". An other library is generated from the remaining source
48 #files with the "stop on warning" barrier.
49 libwiretap_la_SOURCES = \
50         $(NONGENERATED_C_FILES) \
51         $(NONGENERATED_HEADER_FILES)
52
53 libwiretap_generated_la_SOURCES = \
54         $(GENERATED_C_FILES)
55 libwiretap_generated_la_CFLAGS = $(GENERATED_CFLAGS)
56
57 EXTRA_DIST = \
58         README.airmagnet        \
59         README.developer        \
60         Makefile.common         \
61         Makefile.nmake          \
62         $(GENERATOR_FILES)      \
63         $(GENERATED_FILES)
64
65 libwiretap_la_LIBADD = libwiretap_generated.la ${top_builddir}/wsutil/libwsutil.la $(GLIB_LIBS)
66 libwiretap_la_DEPENDENCIES = libwiretap_generated.la ${top_builddir}/wsutil/libwsutil.la
67
68 k12text_lex.h : k12text.c
69
70 ascend_scanner_lex.h : ascend_scanner.c
71
72 ascend_scanner.c: ascend.h
73
74 ascend.h: ascend.c
75
76 ascend.c: ascend.y
77         @if [ -z "$(YACC)" ]; then \
78                 echo "Neither bison nor byacc has been found"; \
79                 exit 1; \
80         fi
81         $(YACC) -d -p ascend -o ascend.c $(srcdir)/ascend.y
82
83 # ABI compliance checker can be obtained from
84 # http://ispras.linux-foundation.org/index.php/ABI_compliance_checker
85 # Checked using version 1.21.12
86 dumpabi-libwiretap: all abi-descriptor.xml
87         rm -rf abi-check-headers abi_dumps .libs/*.abi.tar.gz
88         mkdir abi-check-headers
89         cp *.h ../ws_symbol_export.h abi-check-headers/
90         abi-compliance-checker -log-path abi_logs/log.txt -l libwiretap -v1 `readlink .libs/libwiretap.so | sed 's/.*\.so\.//'` \
91                 -relpath $(abs_srcdir) -dump-abi abi-descriptor.xml || \
92                 cat logs/libwiretap/[0-9]*/log.txt
93         cp -f abi_dumps/libwiretap/libwiretap_* .libs/
94         cd .libs && ln -sf libwiretap_*.abi.tar.gz libwiretap.abi.tar.gz
95
96 maintainer-clean-local: clean-dumpabi-libwiretap
97
98 .PHONY: clean-dumpabi-libwiretap
99
100 clean-dumpabi-libwiretap:
101         rm -rf abi-check-headers abi_dumps .libs/*.abi.tar.gz abi_logs abi-descriptor.xml
102
103 checkapi:
104 ## 'abort' checking disabled for now pending resolution of existing use of g_assert & g_error
105 ##      $(PERL) $(top_srcdir)/tools/checkAPIs.pl -g abort -g termoutput \
106         $(PERL) $(top_srcdir)/tools/checkAPIs.pl -g termoutput -build \
107         -sourcedir=$(srcdir) \
108         $(NONGENERATED_C_FILES) $(GENERATOR_FILES)