From David Arnold:
[metze/wireshark/wip.git] / epan / dfilter / Makefile.am
1 # Makefile.am
2 #
3 # $Id$
4 #
5 # Wireshark - Network traffic analyzer
6 # By Gerald Combs <gerald@wireshark.org>
7 # Copyright 2001 Gerald Combs
8 #
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License
11 # as published by the Free Software Foundation; either version 2
12 # of the License, or (at your option) any later version.
13 #
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
22 #
23
24 include ../../Makefile.am.inc
25
26 if HAVE_WARNINGS_AS_ERRORS
27 AM_NON_GENERATED_CFLAGS = -Werror
28 endif
29
30 include Makefile.common
31
32 noinst_LTLIBRARIES = libdfilter_generated.la libdfilter.la
33
34 CLEANFILES = \
35         libdfilter.a            \
36         libdfilter.la           \
37         libdfilter_generated.a  \
38         libdfilter_generated.la \
39         *~
40
41 DISTCLEANFILES = \
42         grammar.out     \
43         $(NODIST_GENERATED_FILES)
44
45 MAINTAINERCLEANFILES = \
46         $(GENERATED_FILES)      \
47         $(NODIST_GENERATED_FILES)       \
48         Makefile.in
49
50 AM_CPPFLAGS = -I$(srcdir)/../.. -I$(srcdir)/.. -I$(srcdir)/$(LEMON)
51
52 #Since code generated by lex may trigger gcc warnings, we are now generating two
53 #libraries.  A single library is generated with the lex code without the barrier
54 #"stop on warning". An other library is generated from the remaining source
55 #files with the "stop on warning" barrier.
56 libdfilter_la_SOURCES = $(NONGENERATED_C_FILES) $(NONGENERATED_HEADER_FILES)
57 libdfilter_la_CFLAGS = $(AM_NON_GENERATED_CFLAGS)
58
59 libdfilter_generated_la_SOURCES = \
60         $(GENERATED_C_FILES)    \
61         $(GENERATED_HEADER_FILES)
62
63 nodist_libdfilter_generated_la_SOURCES = \
64         $(NODIST_GENERATED_C_FILES)     \
65         $(NODIST_GENERATED_HEADER_FILES)
66
67 libdfilter_la_LIBADD = libdfilter_generated.la
68 libdfilter_la_DEPENDENCIES = libdfilter_generated.la
69
70 EXTRA_DIST = \
71         $(GENERATOR_FILES)      \
72         Makefile.common         \
73         Makefile.nmake
74
75 RUNLEX=$(top_srcdir)/tools/runlex.sh
76
77 scanner_lex.h : scanner.c
78 scanner.lo: grammar.h
79
80 LEMON=../../tools/lemon
81
82 grammar.h : grammar.c
83 grammar.c : $(LEMON)/lemon$(EXEEXT) $(srcdir)/$(LEMON)/lempar.c $(srcdir)/grammar.lemon
84         $(AM_V_LEMON)$(LEMON)/lemon$(EXEEXT) t=$(srcdir)/$(LEMON)/lempar.c $(srcdir)/grammar.lemon || \
85                 (rm -f grammar.c grammar.h ; false)
86
87 checkapi:
88         $(PERL) ../../tools/checkAPIs.pl -g termoutput -build \
89                 $(GENERATOR_FILES)      \
90                 $(NONGENERATED_C_FILES)