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