Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
JiauZhang committed Jan 1, 2025
1 parent 5bbe08f commit ab9a057
Show file tree
Hide file tree
Showing 5 changed files with 947 additions and 57 deletions.
1 change: 1 addition & 0 deletions .gitpicker.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
{
"root": "scripts/kconfig",
"file": [
"conf.c",
"confdata.c",
"expr.c",
"expr.h",
Expand Down
13 changes: 9 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ include_directories(
add_definitions(-DYYDEBUG=1)

add_library(
mconf
conf-objs
SHARED
confdata.c expr.c api.c mnconf-common.c
menu.c preprocess.c symbol.c util.c
Expand All @@ -40,10 +40,15 @@ add_library(
${BISON_PARSER_OUTPUTS}
${FLEX_LEXER_OUTPUTS}
)
add_executable(menuconfig main.cpp)
target_link_libraries(
menuconfig mconf
conf-objs
${FLEX_LIBRARIES} ${BISON_LIBRARIES} ${CURSES_LIBRARY}
)

install(TARGETS menuconfig mconf)
add_executable(menuconfig main.cpp)
target_link_libraries(menuconfig conf-objs)

add_executable(menuconfig-conf conf.c)
target_link_libraries(menuconfig-conf conf-objs)

install(TARGETS menuconfig menuconfig-conf conf-objs)
85 changes: 41 additions & 44 deletions Kconfig
Original file line number Diff line number Diff line change
@@ -1,54 +1,51 @@
# SPDX-License-Identifier: GPL-2.0

config MODULES
bool "Enable loadable module support"
modules
config A
bool "A"
default y

choice
prompt "boolean choice"
default BOOL_CHOICE1

config BOOL_CHOICE0
bool "choice 0"

config BOOL_CHOICE1
bool "choice 1"

endchoice

choice
prompt "optional boolean choice"
default OPT_BOOL_CHOICE1

config OPT_BOOL_CHOICE0
bool "choice 0"

config OPT_BOOL_CHOICE1
bool "choice 1"

endchoice
config A0
bool "A0"
depends on A
default y
help
This depends on A, so should be a submenu of A.

config A0_0
bool "A1_0"
depends on A0
help
Submenus are created recursively.
This should be a submenu of A0.

config A1
bool "A1"
depends on A
default y
help
This should line up with A0.

choice
prompt "tristate choice"
default TRI_CHOICE1
prompt "choice"
depends on A1
help
Choice should become a submenu as well.

config TRI_CHOICE0
tristate "choice 0"
config A1_0
bool "A1_0"

config TRI_CHOICE1
tristate "choice 1"
config A1_1
bool "A1_1"

endchoice

choice
prompt "optional tristate choice"
default OPT_TRI_CHOICE1

config OPT_TRI_CHOICE0
tristate "choice 0"

config OPT_TRI_CHOICE1
tristate "choice 1"

endchoice
config B
bool "B"
help
This is independent of A.

config C
bool "C"
depends on A
help
This depends on A, but not a consecutive item, so can/should not
be a submenu.
Loading

0 comments on commit ab9a057

Please sign in to comment.