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