Makefile 3.0 KB

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