Skip to content

Commit a77a05d

Browse files
committed
kconfig: split menu.c out of parser.y
Compile menu.c as an independent compilation unit. Signed-off-by: Masahiro Yamada <[email protected]>
1 parent 0871874 commit a77a05d

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

scripts/kconfig/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ help:
143143

144144
# ===========================================================================
145145
# object files used by all kconfig flavours
146-
common-objs := confdata.o expr.o lexer.lex.o parser.tab.o preprocess.o \
147-
symbol.o util.o
146+
common-objs := confdata.o expr.o lexer.lex.o menu.o parser.tab.o \
147+
preprocess.o symbol.o util.o
148148

149149
$(obj)/lexer.lex.o: $(obj)/parser.tab.h
150150
HOSTCFLAGS_lexer.lex.o := -I $(srctree)/$(src)

scripts/kconfig/internal.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only */
2+
#ifndef INTERNAL_H
3+
#define INTERNAL_H
4+
5+
struct menu;
6+
7+
extern struct menu *current_menu, *current_entry;
8+
9+
#endif /* INTERNAL_H */

scripts/kconfig/menu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <string.h>
1010

1111
#include "lkc.h"
12+
#include "internal.h"
1213

1314
static const char nohelp_text[] = "There is no help available for this option.";
1415

scripts/kconfig/parser.y

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <stdbool.h>
1313

1414
#include "lkc.h"
15+
#include "internal.h"
1516

1617
#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
1718

@@ -28,7 +29,7 @@ static bool zconf_endtoken(const char *tokenname,
2829

2930
struct symbol *symbol_hash[SYMBOL_HASHSIZE];
3031

31-
static struct menu *current_menu, *current_entry;
32+
struct menu *current_menu, *current_entry;
3233

3334
%}
3435

@@ -713,5 +714,3 @@ void zconfdump(FILE *out)
713714
}
714715
}
715716
}
716-
717-
#include "menu.c"

0 commit comments

Comments
 (0)