提交 cbafbf7f 编写于 作者: M Masahiro Yamada

kconfig: split the lexer out of zconf.y

Compile zconf.lex.c independently of the other files.
Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
上级 558e78e3
...@@ -143,11 +143,9 @@ help: ...@@ -143,11 +143,9 @@ help:
# =========================================================================== # ===========================================================================
# object files used by all kconfig flavours # object files used by all kconfig flavours
common-objs := confdata.o expr.o symbol.o preprocess.o zconf.tab.o common-objs := confdata.o expr.o symbol.o preprocess.o zconf.lex.o zconf.tab.o
targets += zconf.lex.c $(obj)/zconf.lex.o: $(obj)/zconf.tab.h
# generated files seem to need this to find local include files
HOSTCFLAGS_zconf.lex.o := -I$(src) HOSTCFLAGS_zconf.lex.o := -I$(src)
HOSTCFLAGS_zconf.tab.o := -I$(src) HOSTCFLAGS_zconf.tab.o := -I$(src)
...@@ -202,8 +200,6 @@ HOSTCFLAGS_gconf.o = $(shell . $(obj)/.gconf-cfg && echo $$cflags) ...@@ -202,8 +200,6 @@ HOSTCFLAGS_gconf.o = $(shell . $(obj)/.gconf-cfg && echo $$cflags)
$(obj)/gconf.o: $(obj)/.gconf-cfg $(obj)/gconf.o: $(obj)/.gconf-cfg
$(obj)/zconf.tab.o: $(obj)/zconf.lex.c
# check if necessary packages are available, and configure build flags # check if necessary packages are available, and configure build flags
define filechk_conf_cfg define filechk_conf_cfg
$(CONFIG_SHELL) $< $(CONFIG_SHELL) $<
......
...@@ -90,6 +90,9 @@ void *xrealloc(void *p, size_t size); ...@@ -90,6 +90,9 @@ void *xrealloc(void *p, size_t size);
char *xstrdup(const char *s); char *xstrdup(const char *s);
char *xstrndup(const char *s, size_t n); char *xstrndup(const char *s, size_t n);
/* zconf.l */
int yylex(void);
struct gstr { struct gstr {
size_t len; size_t len;
char *s; char *s;
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <unistd.h> #include <unistd.h>
#include "lkc.h" #include "lkc.h"
#include "zconf.tab.h"
#define YY_DECL static int yylex1(void) #define YY_DECL static int yylex1(void)
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
int cdebug = PRINTD; int cdebug = PRINTD;
int yylex(void);
static void yyerror(const char *err); static void yyerror(const char *err);
static void zconfprint(const char *err, ...); static void zconfprint(const char *err, ...);
static void zconf_error(const char *err, ...); static void zconf_error(const char *err, ...);
...@@ -729,6 +728,5 @@ void zconfdump(FILE *out) ...@@ -729,6 +728,5 @@ void zconfdump(FILE *out)
} }
} }
#include "zconf.lex.c"
#include "util.c" #include "util.c"
#include "menu.c" #include "menu.c"
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册