Makefile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. ifndef PJ
  2. ifeq ($(shell if [ -L menuconfig.config ]; then echo y; fi), y)
  3. PJ=$(shell ls -la menuconfig.config|awk '{print $$10}')
  4. endif
  5. endif
  6. all: release
  7. release:
  8. ifdef PJ
  9. @if [ ! -e $(PJ) ]; then echo 'Error: $(PJ) is not exist! Please restore it or rebuild kconfig system..'; exit 1; fi
  10. endif
  11. @$(MAKE) -f Makefile.pj buildimg PJ=$(PJ) 2>&1 | /usr/bin/tee log/buildlog-`/bin/date +%Y%m%d_%H%M`.log
  12. debug:
  13. ifdef PJ
  14. @if [ ! -e $(PJ) ]; then echo 'Error: $(PJ) is not exist! Please restore it or rebuild kconfig system..'; exit 1; fi
  15. endif
  16. @$(MAKE) -f Makefile.pj buildimg PJ=$(PJ) 2>&1 | /usr/bin/tee log/buildlog-`/bin/date +%Y%m%d_%H%M`.log
  17. mconfig:
  18. ifndef PJ
  19. @$(MAKE) -f Makefile.pj mconfig
  20. endif
  21. boardconfig:
  22. ifndef PJ
  23. @$(MAKE) -f Makefile.pj boardconfig
  24. endif
  25. menuconfig:
  26. ifndef PJ
  27. @$(MAKE) -f Makefile.pj menuconfig
  28. endif
  29. info:
  30. ifdef PJ
  31. @if [ ! -e $(PJ) ]; then echo 'Error: $(PJ) is not exist! Please restore it or rebuild kconfig system..'; exit 1; fi
  32. endif
  33. @$(MAKE) -f Makefile.pj info PJ=$(PJ)
  34. clean:
  35. ifdef PJ
  36. @if [ ! -e $(PJ) ]; then echo 'Error: $(PJ) is not exist! Please restore it or rebuild kconfig system..'; exit 1; fi
  37. endif
  38. @$(MAKE) -f Makefile.pj clean PJ=$(PJ)
  39. help:
  40. @echo 'Cleaning targets:'
  41. @echo ' clean - remove most generated files but keep the config'
  42. @echo ' '
  43. @echo 'kconfig targets:'
  44. @echo ' mconfig - update current customer config'
  45. @echo ' boardconfig - update current board config based on selected customer '
  46. @echo ' menuconfig - update current project-related config based on selected customer and board'
  47. @echo ' '
  48. @echo 'PJ targets:'
  49. @echo ' rebuild_kconfig - restore the kconfig files'
  50. @echo ' xcfg [Xn=cfg_name] - generate x.cfg from kconfig system'
  51. @echo ' '
  52. @echo 'Building targets:'
  53. @echo ' all - build release system'
  54. @echo ' release - build release system'
  55. @echo ' debug - build debug system'
  56. @echo ' info - print out the building configs'
  57. @echo ' '
  58. @echo 'Execute "make" or "make all" to build release system image'
  59. rebuild_kconfig:
  60. @if [ -L menuconfig.config ]; then \
  61. rm -f menuconfig.config; \
  62. if [ -e .mconfig.config -a -e .boardconfig.config -a -e .menuconfig.config ]; then \
  63. mv .mconfig.config mconfig.config; \
  64. mv .boardconfig.config boardconfig.config; \
  65. mv .menuconfig.config menuconfig.config; \
  66. else \
  67. echo 'Sorry, unable to restore thoes files'; \
  68. echo ' mconfig.config, boardconfig.config, menuconfig.config'; \
  69. echo 'please update them from SVN!'; \
  70. fi; \
  71. fi
  72. xcfg: rebuild_kconfig
  73. ifdef Xn
  74. @./tools/xcfg.pl -o $(Xn) mconfig.config boardconfig.config menuconfig.config
  75. else
  76. @./tools/xcfg.pl -o x.cfg mconfig.config boardconfig.config menuconfig.config
  77. endif