• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# ===========================================================================
2# Kernel configuration targets
3# These targets are used from top-level makefile
4
5CUSTOM_DIR := $(shell pwd)
6KCONFIG_TOP = Config.in
7KCONFIG_PROJECT = ToyBox
8CUSTOM_NAME = $(CUSTOM_DIR)/../liteos_a_custom.config
9obj = ./kconfig
10PHONY += clean help oldconfig menuconfig config silentoldconfig \
11	randconfig allyesconfig allnoconfig allmodconfig defconfig
12
13menuconfig: $(obj)/mconf $(KCONFIG_TOP)
14	$< $(KCONFIG_TOP)
15
16config: $(obj)/conf $(KCONFIG_TOP)
17	$< $(KCONFIG_TOP)
18
19oldconfig: $(obj)/conf $(KCONFIG_TOP)
20	$< -o $(KCONFIG_TOP)
21
22silentoldconfig: $(obj)/conf $(KCONFIG_TOP)
23	yes | $< -o $(KCONFIG_TOP) > /dev/null
24
25randconfig: $(obj)/conf $(KCONFIG_TOP)
26	$< -r $(KCONFIG_TOP) > /dev/null
27
28allyesconfig: $(obj)/conf $(KCONFIG_TOP)
29	$< -y $(KCONFIG_TOP) > /dev/null
30
31allnoconfig: $(obj)/conf $(KCONFIG_TOP)
32	$< -n $(KCONFIG_TOP) > /dev/null
33
34customconfig: $(obj)/conf $(KCONFIG_TOP)
35	$< -D $(CUSTOM_NAME) $(KCONFIG_TOP) > /dev/null
36
37defconfig: $(obj)/conf $(KCONFIG_TOP)
38	$< -D /dev/null $(KCONFIG_TOP) > /dev/null
39
40macos_defconfig: $(obj)/conf $(KCONFIG_TOP)
41	KCONFIG_ALLCONFIG=$(obj)/macos_miniconfig $< -n $(KCONFIG_TOP) > /dev/null
42
43bsd_defconfig: $(obj)/conf $(KCONFIG_TOP)
44	KCONFIG_ALLCONFIG=$(obj)/freebsd_miniconfig $< -n $(KCONFIG_TOP) > /dev/null
45
46# Help text used by make help
47help::
48	@echo  '  config	  - Update current config utilising a line-oriented program'
49	@echo  '  menuconfig	  - Update current config utilising a menu based program'
50	@echo  '  oldconfig	  - Update current config utilising a provided .config as base'
51	@echo  '  silentoldconfig - Same as oldconfig, but quietly'
52	@echo  '  randconfig	  - New config with random answer to all options'
53	@echo  '  defconfig	  - New config with default answer to all options'
54	@echo  '                    This is the maximum sane configuration.'
55	@echo  '  allyesconfig	  - New config where all options are accepted with yes'
56	@echo  "                    This may not actually compile, it's a starting point"
57	@echo  '                    for further configuration (probably with menuconfig)'
58	@echo  '  allnoconfig	  - New config where all options are answered with no'
59	@echo  '                    (NOP binary, starting point for further configuration)'
60	@echo  '  macos_defconfig - Select commands known to build on macosx'
61	@echo  '  bsd_defconfig   - Select commands known to build on freebsd'
62
63# Cheesy build
64
65SHIPPED = kconfig/zconf.tab.c kconfig/lex.zconf.c kconfig/zconf.hash.c
66
67%.c: %.c_shipped
68	@ln -s $(notdir $<) $@
69
70gen_config.h: .config
71
72kconfig/mconf: $(SHIPPED)
73	$(HOSTCC) -o $@ kconfig/mconf.c kconfig/zconf.tab.c \
74		kconfig/lxdialog/*.c -lcurses -DCURSES_LOC="<ncurses.h>" \
75		-DKBUILD_NO_NLS=1 -DPROJECT_NAME=\"$(KCONFIG_PROJECT)\"
76
77kconfig/conf: $(SHIPPED)
78	$(HOSTCC) -o $@ kconfig/conf.c kconfig/zconf.tab.c -DKBUILD_NO_NLS=1 \
79		-DPROJECT_NAME=\"$(KCONFIG_PROJECT)\"
80
81clean::
82	@rm -f $(wildcard kconfig/*zconf*.c) kconfig/conf kconfig/mconf
83