diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-12-21 03:33:05 -0500 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-12-28 08:22:38 -0500 |
commit | cbafbf7f551c3a03fb9440932f1ca13056ca40a6 (patch) | |
tree | 185323683e7ad6596c7eba41f705e2bea1a053f6 /scripts/kconfig | |
parent | 558e78e3ce844c61ceffe32775dbefacf167b023 (diff) |
kconfig: split the lexer out of zconf.y
Compile zconf.lex.c independently of the other files.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts/kconfig')
-rw-r--r-- | scripts/kconfig/Makefile | 8 | ||||
-rw-r--r-- | scripts/kconfig/lkc.h | 3 | ||||
-rw-r--r-- | scripts/kconfig/zconf.l | 1 | ||||
-rw-r--r-- | scripts/kconfig/zconf.y | 2 |
4 files changed, 6 insertions, 8 deletions
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index d3bd68754750..65cdf8c36cb4 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile | |||
@@ -143,11 +143,9 @@ help: | |||
143 | 143 | ||
144 | # =========================================================================== | 144 | # =========================================================================== |
145 | # object files used by all kconfig flavours | 145 | # object files used by all kconfig flavours |
146 | common-objs := confdata.o expr.o symbol.o preprocess.o zconf.tab.o | 146 | common-objs := confdata.o expr.o symbol.o preprocess.o zconf.lex.o zconf.tab.o |
147 | 147 | ||
148 | targets += zconf.lex.c | 148 | $(obj)/zconf.lex.o: $(obj)/zconf.tab.h |
149 | |||
150 | # generated files seem to need this to find local include files | ||
151 | HOSTCFLAGS_zconf.lex.o := -I$(src) | 149 | HOSTCFLAGS_zconf.lex.o := -I$(src) |
152 | HOSTCFLAGS_zconf.tab.o := -I$(src) | 150 | HOSTCFLAGS_zconf.tab.o := -I$(src) |
153 | 151 | ||
@@ -202,8 +200,6 @@ HOSTCFLAGS_gconf.o = $(shell . $(obj)/.gconf-cfg && echo $$cflags) | |||
202 | 200 | ||
203 | $(obj)/gconf.o: $(obj)/.gconf-cfg | 201 | $(obj)/gconf.o: $(obj)/.gconf-cfg |
204 | 202 | ||
205 | $(obj)/zconf.tab.o: $(obj)/zconf.lex.c | ||
206 | |||
207 | # check if necessary packages are available, and configure build flags | 203 | # check if necessary packages are available, and configure build flags |
208 | define filechk_conf_cfg | 204 | define filechk_conf_cfg |
209 | $(CONFIG_SHELL) $< | 205 | $(CONFIG_SHELL) $< |
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index 160a9312e11a..531ff7c57d92 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h | |||
@@ -90,6 +90,9 @@ void *xrealloc(void *p, size_t size); | |||
90 | char *xstrdup(const char *s); | 90 | char *xstrdup(const char *s); |
91 | char *xstrndup(const char *s, size_t n); | 91 | char *xstrndup(const char *s, size_t n); |
92 | 92 | ||
93 | /* zconf.l */ | ||
94 | int yylex(void); | ||
95 | |||
93 | struct gstr { | 96 | struct gstr { |
94 | size_t len; | 97 | size_t len; |
95 | char *s; | 98 | char *s; |
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index 96f8b1dcf470..b2d0a3b0bce9 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <unistd.h> | 15 | #include <unistd.h> |
16 | 16 | ||
17 | #include "lkc.h" | 17 | #include "lkc.h" |
18 | #include "zconf.tab.h" | ||
18 | 19 | ||
19 | #define YY_DECL static int yylex1(void) | 20 | #define YY_DECL static int yylex1(void) |
20 | 21 | ||
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index a990f46f3825..69409abc7dc2 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y | |||
@@ -20,7 +20,6 @@ | |||
20 | 20 | ||
21 | int cdebug = PRINTD; | 21 | int cdebug = PRINTD; |
22 | 22 | ||
23 | int yylex(void); | ||
24 | static void yyerror(const char *err); | 23 | static void yyerror(const char *err); |
25 | static void zconfprint(const char *err, ...); | 24 | static void zconfprint(const char *err, ...); |
26 | static void zconf_error(const char *err, ...); | 25 | static void zconf_error(const char *err, ...); |
@@ -729,6 +728,5 @@ void zconfdump(FILE *out) | |||
729 | } | 728 | } |
730 | } | 729 | } |
731 | 730 | ||
732 | #include "zconf.lex.c" | ||
733 | #include "util.c" | 731 | #include "util.c" |
734 | #include "menu.c" | 732 | #include "menu.c" |