1
0

Makefile.adk 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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 ${ADK_TOPDIR}/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 ADK_VERBOSE=1 \
  16. $(MAKE) ${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 ' savekconfig - save changes of "make kernelconfig" to an external'
  43. @echo ' configuration file (if configured)'
  44. @echo ''
  45. @echo 'Cleaning targets:'
  46. @echo ' clean - Remove firmware and build directories'
  47. @echo ' cleandir - Same as "clean", but also remove all built toolchains'
  48. @echo ' cleansystem - Same as "cleandir", but only remove active system'
  49. @echo ' cleankernel - Remove kernel dir, useful if you changed any kernel patches'
  50. @echo ' distclean - Same as "cleandir", but also remove downloaded'
  51. @echo ' distfiles and .config'
  52. @echo ''
  53. @echo 'Other generic targets:'
  54. @echo ' all - Build everything as specified in .config'
  55. @echo ' (default if .config exists)'
  56. @echo ' v - Same as "all" but with logging to make.log enabled'
  57. pkg-help:
  58. @echo 'Package specific targets (use with "package=<pkg-name>" parameter):'
  59. @echo ' fetch - Download the necessary distfile'
  60. @echo ' extract - Same as "fetch", but also extract the distfile'
  61. @echo ' patch - Same as "extract", but also patch the source'
  62. @echo ' build - Same as "patch", but also build the binaries'
  63. @echo ' fake - Same as "build", but also install the binaries'
  64. @echo ' package - Same as "fake", but also create the package'
  65. @echo ' clean - Deinstall and remove the build area'
  66. @echo ' distclean - Same as "clean", but also remove the distfiles'
  67. @echo ''
  68. @echo 'Short package rebuilding guide:'
  69. @echo ' run "make package=<pkgname> clean" to remove all generated binaries'
  70. @echo ' run "make package=<pkgname> package" to build everything and create the package(s)'
  71. @echo ''
  72. @echo 'This does not automatically resolve package dependencies!'
  73. dev-help:
  74. @echo 'Fast way of updating package patches:'
  75. @echo ' run "make package=<pkgname> clean" to start with a good base'
  76. @echo ' run "make package=<pkgname> patch" to fetch, unpack and patch the source'
  77. @echo ' edit the package sources at build_dir/w-<pkgname>-*/<pkgname>-<version>'
  78. @echo ' run "make package=<pkgname> update-patches" to regenerate patch files'
  79. @echo ''
  80. @echo 'All changed patches will be opened with your $$EDITOR,'
  81. @echo 'so you can add a description and verify the modifications.'
  82. @echo ''
  83. @echo 'Adding a new package:'
  84. @echo 'make PKG=foo VER=1.0 newpackage'
  85. @echo 'Adding a new simple library package:'
  86. @echo 'make PKG=foo VER=1.0 TYPE=lib newpackage'
  87. @echo 'Adding a new simple program package:'
  88. @echo 'make PKG=foo VER=1.0 TYPE=prog newpackage'
  89. clean:
  90. @${GMAKE_INV} clean
  91. config:
  92. @${GMAKE_INV} _config W=
  93. oldconfig:
  94. @${GMAKE_INV} _config W=--oldconfig
  95. download:
  96. @${GMAKE_INV} toolchain/download
  97. @${GMAKE_INV} dep
  98. @${GMAKE_INV} package/download
  99. cleankernel:
  100. -@${GMAKE_INV} cleankernel
  101. cleandir:
  102. -@${GMAKE_INV} cleandir
  103. cleansystem:
  104. -@${GMAKE_INV} cleansystem
  105. distclean:
  106. -${GMAKE_INV} distclean
  107. image:
  108. @${GMAKE_INV} image
  109. targethelp:
  110. @${GMAKE_INV} targethelp
  111. kernelconfig:
  112. @${GMAKE_INV} kernelconfig
  113. savekconfig:
  114. @${GMAKE_INV} savekconfig
  115. newpackage:
  116. @${GMAKE_INV} newpackage
  117. image_clean imageclean cleanimage:
  118. @${GMAKE_INV} image_clean
  119. menuconfig:
  120. @${GMAKE_INV} menuconfig
  121. defconfig:
  122. @${GMAKE_INV} defconfig
  123. allnoconfig:
  124. @${GMAKE_INV} KCONFIG_ALLCONFIG=all.config _config W=--allnoconfig
  125. allyesconfig:
  126. @${GMAKE_INV} KCONFIG_ALLCONFIG=all.config _config W=--allyesconfig
  127. allmodconfig:
  128. @${GMAKE_INV} KCONFIG_ALLCONFIG=all.config _config W=--allmodconfig
  129. package_index:
  130. @${GMAKE_INV} package_index
  131. buildall:
  132. @${GMAKE_INV} buildall
  133. check:
  134. @${GMAKE_INV} check
  135. check-gcc:
  136. @${GMAKE_INV} check-gcc
  137. check-g++:
  138. @${GMAKE_INV} check-g++
  139. menu:
  140. @${GMAKE_INV} menu
  141. dep:
  142. @${GMAKE_INV} dep
  143. world:
  144. @${GMAKE_INV} world
  145. info:
  146. @${GMAKE_INV} info
  147. endif
  148. # DO NOT DELETE