summaryrefslogtreecommitdiff
path: root/scripts/kconfig
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2018-12-21 17:33:05 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2018-12-28 22:22:38 +0900
commitcbafbf7f551c3a03fb9440932f1ca13056ca40a6 (patch)
tree185323683e7ad6596c7eba41f705e2bea1a053f6 /scripts/kconfig
parent558e78e3ce844c61ceffe32775dbefacf167b023 (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/Makefile8
-rw-r--r--scripts/kconfig/lkc.h3
-rw-r--r--scripts/kconfig/zconf.l1
-rw-r--r--scripts/kconfig/zconf.y2
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:
# ===========================================================================
# 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
-
-# generated files seem to need this to find local include files
+$(obj)/zconf.lex.o: $(obj)/zconf.tab.h
HOSTCFLAGS_zconf.lex.o := -I$(src)
HOSTCFLAGS_zconf.tab.o := -I$(src)
@@ -202,8 +200,6 @@ HOSTCFLAGS_gconf.o = $(shell . $(obj)/.gconf-cfg && echo $$cflags)
$(obj)/gconf.o: $(obj)/.gconf-cfg
-$(obj)/zconf.tab.o: $(obj)/zconf.lex.c
-
# check if necessary packages are available, and configure build flags
define filechk_conf_cfg
$(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);
char *xstrdup(const char *s);
char *xstrndup(const char *s, size_t n);
+/* zconf.l */
+int yylex(void);
+
struct gstr {
size_t len;
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 @@
#include <unistd.h>
#include "lkc.h"
+#include "zconf.tab.h"
#define YY_DECL static int yylex1(void)
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 @@
int cdebug = PRINTD;
-int yylex(void);
static void yyerror(const char *err);
static void zconfprint(const char *err, ...);
static void zconf_error(const char *err, ...);
@@ -729,6 +728,5 @@ void zconfdump(FILE *out)
}
}
-#include "zconf.lex.c"
#include "util.c"
#include "menu.c"