toybox/kconfig/Makefile
<<
>>
Prefs
   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
  42# Help text used by make help
  43help::
  44        @echo  '  config          - Update current config utilising a line-oriented program'
  45        @echo  '  menuconfig      - Update current config utilising a menu based program'
  46        @echo  '  oldconfig       - Update current config utilising a provided .config as base'
  47        @echo  '  silentoldconfig - Same as oldconfig, but quietly'
  48        @echo  '  randconfig      - New config with random answer to all options'
  49        @echo  '  defconfig       - New config with default answer to all options'
  50        @echo  '                    This is the maximum sane configuration.'
  51        @echo  '  allyesconfig    - New config where all options are accepted with yes'
  52        @echo  "                    This may not actually compile, it's a starting point"
  53        @echo  '                    for further configuration (probably with menuconfig)'
  54        @echo  '  allnoconfig     - New config where all options are answered with no'
  55        @echo  '                    (NOP binary, starting point for further configuration)'
  56        @echo  '  macos_defconfig - Select commands known to build on macosx'
  57        @echo  '  bsd_defconfig   - Select commands known to build on freebsd'
  58
  59# Cheesy build
  60
  61SHIPPED = kconfig/zconf.tab.c kconfig/lex.zconf.c kconfig/zconf.hash.c
  62
  63%.c: %.c_shipped
  64        @ln -s $(notdir $<) $@
  65
  66gen_config.h: .config
  67
  68kconfig/mconf: $(SHIPPED)
  69        $(HOSTCC) -o $@ kconfig/mconf.c kconfig/zconf.tab.c \
  70                kconfig/lxdialog/*.c -lcurses -DCURSES_LOC="<ncurses.h>" \
  71                -DKBUILD_NO_NLS=1 -DPROJECT_NAME=\"$(KCONFIG_PROJECT)\"
  72
  73kconfig/conf: $(SHIPPED)
  74        $(HOSTCC) -o $@ kconfig/conf.c kconfig/zconf.tab.c -DKBUILD_NO_NLS=1 \
  75                -DPROJECT_NAME=\"$(KCONFIG_PROJECT)\"
  76
  77clean::
  78        @rm -f $(wildcard kconfig/*zconf*.c) kconfig/conf kconfig/mconf
  79