discover: Reimplement native-parser as a Bison parser
[petitboot] / discover / native / Makefile.am
1 #  This program is free software; you can redistribute it and/or modify
2 #  it under the terms of the GNU General Public License as published by
3 #  the Free Software Foundation; version 2 of the License.
4 #
5 #  This program is distributed in the hope that it will be useful,
6 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
7 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
8 #  GNU General Public License for more details.
9 #
10 #  You should have received a copy of the GNU General Public License
11 #  along with this program; if not, write to the Free Software
12 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
13 #
14
15 noinst_PROGRAMS += discover/native/native-parser.ro
16
17 discover_native_native_parser_ro_SOURCES = \
18         discover/native/native.h \
19         discover/native/native.c \
20         discover/native/native-lexer.l \
21         discover/native/native-parser.y
22
23 BUILT_SOURCES += \
24         discover/native/native-parser.c \
25         discover/native/native-parser.h \
26         discover/native/native-lexer.h \
27         discover/native/native-lexer.c
28
29 CLEANFILES += \
30         discover/native/native-parser.c \
31         discover/native/native-parser.h \
32         discover/native/native-lexer.c \
33         discover/native/native-lexer.h
34
35 discover_native_native_parser_ro_CPPFLAGS = \
36         $(AM_CPPFLAGS) \
37         -I$(top_srcdir)/discover/native \
38         -I$(top_builddir)/discover/native
39
40 discover_native_native_parser_ro_LINK = \
41         $(LD) -r -o $@
42
43 # ylwrap doesn't handle flex header files well; use our own rule here.
44 discover/native/native-lexer.h discover/native/native-lexer.c: \
45                 $(top_srcdir)/discover/native/native-lexer.l
46         $(AM_V_LEX)$(LEXCOMPILE) --header-file=discover/native/native-lexer.h \
47                                        -o discover/native/native-lexer.c $^
48
49 # We need to loosen our warnings for the generated lexer code.
50 discover/native/%native-lexer.o discover/native/native-lexer.o: \
51                 AM_CFLAGS += -Wno-unused-parameter -Wno-missing-prototypes \
52                                -Wno-missing-declarations -Wno-sign-compare
53
54 $(discover_native_native_parser_ro_OBJECTS): discover/native/native-parser.h