Makefile.adk 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. ADK_TOPDIR:= $(shell pwd)
  4. GMAKE_FMK= ${MAKE} -f $(PWD)/mk/build.mk
  5. GMAKE_INV= ${GMAKE_FMK} --no-print-directory
  6. _UNLIMIT= __limit=$$(ulimit -dH 2>/dev/null); \
  7. test -n "$$__limit" && ulimit -Sd $$__limit; ulimit -n 1024;
  8. ifneq (${package},)
  9. subdir:= package/${package}
  10. _subdir_dep:= ${ADK_TOPDIR}/.config
  11. endif
  12. ifneq (${subdir},)
  13. ${MAKECMDGOALS}: _subdir
  14. _subdir: ${_subdir_dep}
  15. cd ${subdir} && ADK_TOPDIR=${ADK_TOPDIR} DEVELOPER=1 \
  16. $(MAKE) ADK_VERBOSE=1 ${MAKECMDGOALS}
  17. else
  18. all:
  19. @${_UNLIMIT} $(GMAKE_INV) world
  20. v:
  21. @(echo; echo "Build started on $$(LC_ALL=C LANGUAGE=C date)"; \
  22. set -x; ${_UNLIMIT} ${GMAKE_FMK} ADK_VERBOSE=1 all) 2>&1 | tee -a make.log
  23. help:
  24. @echo 'Configuration targets:'
  25. @echo ' config - Update current config utilising a line-oriented program'
  26. @echo ' menuconfig - Update current config utilising a menu based program'
  27. @echo ' (default when .config does not exist)'
  28. @echo ' oldconfig - Update current config utilising a provided .configs base'
  29. @echo ' defconfig - New config with defaults'
  30. @echo ' allmodconfig - New config selecting all symbols with m'
  31. @echo ' allyesconfig - New config selecting all symbols with y'
  32. @echo ' allnoconfig - New config where all options are answered with no'
  33. @echo ''
  34. @echo 'Help targets:'
  35. @echo ' help - Print this help text'
  36. @echo ' pkg-help - Print help about selectively compiling single packages'
  37. @echo ' dev-help - Print help for developers / package maintainers'
  38. @echo ''
  39. @echo 'Common targets:'
  40. @echo ' download - fetches all needed distfiles'
  41. @echo ' kernelconfig - view the target kernel configuration'
  42. @echo ''
  43. @echo 'Cleaning targets:'
  44. @echo ' clean - Remove firmware and build directories'
  45. @echo ' cleandir - Same as "clean", but also remove all built toolchains'
  46. @echo ' cleansystem - Same as "cleandir", but only remove active system'
  47. @echo ' cleankernel - Remove kernel dir, useful if you changed any kernel patches'
  48. @echo ' distclean - Same as "cleandir", but also remove downloaded'
  49. @echo ' distfiles and .config'
  50. @echo ''
  51. @echo 'Other generic targets:'
  52. @echo ' all - Build everything as specified in .config'
  53. @echo ' (default if .config exists)'
  54. @echo ' v - Same as "all" but with logging to make.log enabled'
  55. pkg-help:
  56. @echo 'Package specific targets (use with "package=<pkg-name>" parameter):'
  57. @echo ' fetch - Download the necessary distfile'
  58. @echo ' extract - Same as "fetch", but also extract the distfile'
  59. @echo ' patch - Same as "extract", but also patch the source'
  60. @echo ' build - Same as "patch", but also build the binaries'
  61. @echo ' fake - Same as "build", but also install the binaries'
  62. @echo ' package - Same as "fake", but also create the package'
  63. @echo ' clean - Deinstall and remove the build area'
  64. @echo ' distclean - Same as "clean", but also remove the distfiles'
  65. @echo ''
  66. @echo 'Short package rebuilding guide:'
  67. @echo ' run "make package=<pkgname> clean" to remove all generated binaries'
  68. @echo ' run "make package=<pkgname> package" to build everything and create the package(s)'
  69. @echo ''
  70. @echo 'This does not automatically resolve package dependencies!'
  71. dev-help:
  72. @echo 'Fast way of updating package patches:'
  73. @echo ' run "make package=<pkgname> clean" to start with a good base'
  74. @echo ' run "make package=<pkgname> patch" to fetch, unpack and patch the source'
  75. @echo ' edit the package sources at build_dir/w-<pkgname>-*/<pkgname>-<version>'
  76. @echo ' run "make package=<pkgname> update-patches" to regenerate patch files'
  77. @echo ''
  78. @echo 'All changed patches will be opened with your $$EDITOR,'
  79. @echo 'so you can add a description and verify the modifications.'
  80. @echo ''
  81. @echo 'Adding a new package:'
  82. @echo 'make PKG=foo VER=1.0 newpackage'
  83. @echo 'Adding a new simple library package:'
  84. @echo 'make PKG=foo VER=1.0 TYPE=lib newpackage'
  85. @echo 'Adding a new simple program package:'
  86. @echo 'make PKG=foo VER=1.0 TYPE=prog newpackage'
  87. clean:
  88. @${GMAKE_INV} clean
  89. config:
  90. @${GMAKE_INV} _config W=
  91. oldconfig:
  92. @${GMAKE_INV} _config W=--oldconfig
  93. download:
  94. @${GMAKE_INV} toolchain/download
  95. @${GMAKE_INV} dep
  96. @${GMAKE_INV} package/download
  97. cleankernel:
  98. -@${GMAKE_INV} cleankernel
  99. cleandir:
  100. -@${GMAKE_INV} cleandir
  101. cleansystem:
  102. -@${GMAKE_INV} cleansystem
  103. distclean:
  104. -${GMAKE_INV} distclean
  105. image:
  106. @${GMAKE_INV} image
  107. targethelp:
  108. @${GMAKE_INV} targethelp
  109. kernelconfig:
  110. @${GMAKE_INV} kernelconfig
  111. newpackage:
  112. @${GMAKE_INV} newpackage
  113. image_clean imageclean cleanimage:
  114. @${GMAKE_INV} image_clean
  115. menuconfig:
  116. @${GMAKE_INV} menuconfig
  117. defconfig:
  118. @${GMAKE_INV} defconfig
  119. allnoconfig:
  120. @${GMAKE_INV} KCONFIG_ALLCONFIG=all.config _config W=--allnoconfig
  121. allyesconfig:
  122. @${GMAKE_INV} KCONFIG_ALLCONFIG=all.config _config W=--allyesconfig
  123. allmodconfig:
  124. @${GMAKE_INV} KCONFIG_ALLCONFIG=all.config _config W=--allmodconfig
  125. package_index:
  126. @${GMAKE_INV} package_index
  127. buildall:
  128. @${GMAKE_INV} buildall
  129. check:
  130. @${GMAKE_INV} check
  131. check-gcc:
  132. @${GMAKE_INV} check-gcc
  133. check-g++:
  134. @${GMAKE_INV} check-g++
  135. menu:
  136. @${GMAKE_INV} menu
  137. dep:
  138. @${GMAKE_INV} dep
  139. world:
  140. @${GMAKE_INV} world
  141. endif
  142. # DO NOT DELETE