kconfig: split menu.c out of parser.y

Compile menu.c as an independent compilation unit.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
This commit is contained in:
Masahiro Yamada 2021-04-14 00:08:17 +09:00
parent 08718745d8
commit a77a05dc9c
4 changed files with 14 additions and 5 deletions

View File

@ -143,8 +143,8 @@ help:
# ===========================================================================
# object files used by all kconfig flavours
common-objs := confdata.o expr.o lexer.lex.o parser.tab.o preprocess.o \
symbol.o util.o
common-objs := confdata.o expr.o lexer.lex.o menu.o parser.tab.o \
preprocess.o symbol.o util.o
$(obj)/lexer.lex.o: $(obj)/parser.tab.h
HOSTCFLAGS_lexer.lex.o := -I $(srctree)/$(src)

View File

@ -0,0 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef INTERNAL_H
#define INTERNAL_H
struct menu;
extern struct menu *current_menu, *current_entry;
#endif /* INTERNAL_H */

View File

@ -9,6 +9,7 @@
#include <string.h>
#include "lkc.h"
#include "internal.h"
static const char nohelp_text[] = "There is no help available for this option.";

View File

@ -12,6 +12,7 @@
#include <stdbool.h>
#include "lkc.h"
#include "internal.h"
#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
@ -28,7 +29,7 @@ static bool zconf_endtoken(const char *tokenname,
struct symbol *symbol_hash[SYMBOL_HASHSIZE];
static struct menu *current_menu, *current_entry;
struct menu *current_menu, *current_entry;
%}
@ -713,5 +714,3 @@ void zconfdump(FILE *out)
}
}
}
#include "menu.c"