Makefile.adk 5.5 KB

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