Makefile 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968
  1. # Makefile for buildroot
  2. #
  3. # Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
  4. # Copyright (C) 2006-2014 by the Buildroot developers <buildroot@uclibc.org>
  5. # Copyright (C) 2014-2015 by the Buildroot developers <buildroot@buildroot.org>
  6. #
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. # General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program; if not, write to the Free Software
  19. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. #
  21. #--------------------------------------------------------------
  22. # Just run 'make menuconfig', configure stuff, then run 'make'.
  23. # You shouldn't need to mess with anything beyond this point...
  24. #--------------------------------------------------------------
  25. # Trick for always running with a fixed umask
  26. UMASK = 0022
  27. ifneq ($(shell umask),$(UMASK))
  28. .PHONY: _all $(MAKECMDGOALS)
  29. $(MAKECMDGOALS): _all
  30. @:
  31. _all:
  32. @umask $(UMASK) && $(MAKE) --no-print-directory $(MAKECMDGOALS)
  33. else # umask
  34. # This is our default rule, so must come first
  35. all:
  36. # Set and export the version string
  37. export BR2_VERSION := 2016.02-git
  38. # Save running make version since it's clobbered by the make package
  39. RUNNING_MAKE_VERSION := $(MAKE_VERSION)
  40. # Check for minimal make version (note: this check will break at make 10.x)
  41. MIN_MAKE_VERSION = 3.81
  42. ifneq ($(firstword $(sort $(RUNNING_MAKE_VERSION) $(MIN_MAKE_VERSION))),$(MIN_MAKE_VERSION))
  43. $(error You have make '$(RUNNING_MAKE_VERSION)' installed. GNU make >= $(MIN_MAKE_VERSION) is required)
  44. endif
  45. export HOSTARCH := $(shell uname -m | \
  46. sed -e s/i.86/x86/ \
  47. -e s/sun4u/sparc64/ \
  48. -e s/arm.*/arm/ \
  49. -e s/sa110/arm/ \
  50. -e s/ppc64/powerpc64/ \
  51. -e s/ppc/powerpc/ \
  52. -e s/macppc/powerpc/\
  53. -e s/sh.*/sh/)
  54. # Parallel execution of this Makefile is disabled because it changes
  55. # the packages building order, that can be a problem for two reasons:
  56. # - If a package has an unspecified optional dependency and that
  57. # dependency is present when the package is built, it is used,
  58. # otherwise it isn't (but compilation happily proceeds) so the end
  59. # result will differ if the order is swapped due to parallel
  60. # building.
  61. # - Also changing the building order can be a problem if two packages
  62. # manipulate the same file in the target directory.
  63. #
  64. # Taking into account the above considerations, if you still want to execute
  65. # this top-level Makefile in parallel comment the ".NOTPARALLEL" line and
  66. # use the -j<jobs> option when building, e.g:
  67. # make -j$((`getconf _NPROCESSORS_ONLN`+1))
  68. .NOTPARALLEL:
  69. # absolute path
  70. TOPDIR := $(shell pwd)
  71. CONFIG_CONFIG_IN = Config.in
  72. CONFIG = support/kconfig
  73. DATE := $(shell date +%Y%m%d)
  74. # Compute the full local version string so packages can use it as-is
  75. # Need to export it, so it can be got from environment in children (eg. mconf)
  76. export BR2_VERSION_FULL := $(BR2_VERSION)$(shell $(TOPDIR)/support/scripts/setlocalversion)
  77. noconfig_targets := menuconfig nconfig gconfig xconfig config oldconfig randconfig \
  78. defconfig %_defconfig allyesconfig allnoconfig silentoldconfig release \
  79. randpackageconfig allyespackageconfig allnopackageconfig \
  80. print-version olddefconfig
  81. # Some global targets do not trigger a build, but are used to collect
  82. # metadata, or do various checks. When such targets are triggered,
  83. # some packages should not do their configuration sanity
  84. # checks. Provide them a BR_BUILDING variable set to 'y' when we're
  85. # actually building and they should do their sanity checks.
  86. #
  87. # We're building in two situations: when MAKECMDGOALS is empty
  88. # (default target is to build), or when MAKECMDGOALS contains
  89. # something else than one of the nobuild_targets.
  90. nobuild_targets := source source-check \
  91. legal-info external-deps _external-deps \
  92. clean distclean
  93. ifeq ($(MAKECMDGOALS),)
  94. BR_BUILDING = y
  95. else ifneq ($(filter-out $(nobuild_targets),$(MAKECMDGOALS)),)
  96. BR_BUILDING = y
  97. endif
  98. # Strip quotes and then whitespaces
  99. qstrip = $(strip $(subst ",,$(1)))
  100. #"))
  101. # Variables for use in Make constructs
  102. comma := ,
  103. empty :=
  104. space := $(empty) $(empty)
  105. ifneq ("$(origin O)", "command line")
  106. O := output
  107. CONFIG_DIR := $(TOPDIR)
  108. NEED_WRAPPER =
  109. else
  110. # other packages might also support Linux-style out of tree builds
  111. # with the O=<dir> syntax (E.G. BusyBox does). As make automatically
  112. # forwards command line variable definitions those packages get very
  113. # confused. Fix this by telling make to not do so
  114. MAKEOVERRIDES =
  115. # strangely enough O is still passed to submakes with MAKEOVERRIDES
  116. # (with make 3.81 atleast), the only thing that changes is the output
  117. # of the origin function (command line -> environment).
  118. # Unfortunately some packages don't look at origin (E.G. uClibc 0.9.31+)
  119. # To really make O go away, we have to override it.
  120. override O := $(O)
  121. CONFIG_DIR := $(O)
  122. # we need to pass O= everywhere we call back into the toplevel makefile
  123. EXTRAMAKEARGS = O=$(O)
  124. NEED_WRAPPER = y
  125. endif
  126. # bash prints the name of the directory on 'cd <dir>' if CDPATH is
  127. # set, so unset it here to not cause problems. Notice that the export
  128. # line doesn't affect the environment of $(shell ..) calls, so
  129. # explictly throw away any output from 'cd' here.
  130. export CDPATH :=
  131. BASE_DIR := $(shell mkdir -p $(O) && cd $(O) >/dev/null && pwd)
  132. $(if $(BASE_DIR),, $(error output directory "$(O)" does not exist))
  133. # Handling of BR2_EXTERNAL.
  134. #
  135. # The value of BR2_EXTERNAL is stored in .br-external in the output directory.
  136. # On subsequent invocations of make, it is read in. It can still be overridden
  137. # on the command line, therefore the file is re-created every time make is run.
  138. #
  139. # When BR2_EXTERNAL is set to an empty value (e.g. explicitly in command
  140. # line), the .br-external file is removed and we point to
  141. # support/dummy-external. This makes sure we can unconditionally include the
  142. # Config.in and external.mk from the BR2_EXTERNAL directory. In this case,
  143. # override is necessary so the user can clear BR2_EXTERNAL from the command
  144. # line, but the dummy path is still used internally.
  145. BR2_EXTERNAL_FILE = $(BASE_DIR)/.br-external
  146. -include $(BR2_EXTERNAL_FILE)
  147. ifeq ($(BR2_EXTERNAL),)
  148. override BR2_EXTERNAL = support/dummy-external
  149. $(shell rm -f $(BR2_EXTERNAL_FILE))
  150. else
  151. _BR2_EXTERNAL = $(shell cd $(BR2_EXTERNAL) >/dev/null 2>&1 && pwd)
  152. ifeq ($(_BR2_EXTERNAL),)
  153. $(error BR2_EXTERNAL='$(BR2_EXTERNAL)' does not exist, relative to $(TOPDIR))
  154. endif
  155. override BR2_EXTERNAL := $(_BR2_EXTERNAL)
  156. $(shell echo BR2_EXTERNAL ?= $(BR2_EXTERNAL) > $(BR2_EXTERNAL_FILE))
  157. endif
  158. # To make sure that the environment variable overrides the .config option,
  159. # set this before including .config.
  160. ifneq ($(BR2_DL_DIR),)
  161. DL_DIR := $(BR2_DL_DIR)
  162. endif
  163. ifneq ($(BR2_CCACHE_DIR),)
  164. BR_CACHE_DIR := $(BR2_CCACHE_DIR)
  165. endif
  166. # Need that early, before we scan packages
  167. # Avoids doing the $(or...) everytime
  168. BR_GRAPH_OUT := $(or $(BR2_GRAPH_OUT),pdf)
  169. BUILD_DIR := $(BASE_DIR)/build
  170. BINARIES_DIR := $(BASE_DIR)/images
  171. TARGET_DIR := $(BASE_DIR)/target
  172. # initial definition so that 'make clean' works for most users, even without
  173. # .config. HOST_DIR will be overwritten later when .config is included.
  174. HOST_DIR := $(BASE_DIR)/host
  175. GRAPHS_DIR := $(BASE_DIR)/graphs
  176. LEGAL_INFO_DIR = $(BASE_DIR)/legal-info
  177. REDIST_SOURCES_DIR_TARGET = $(LEGAL_INFO_DIR)/sources
  178. REDIST_SOURCES_DIR_HOST = $(LEGAL_INFO_DIR)/host-sources
  179. LICENSE_FILES_DIR_TARGET = $(LEGAL_INFO_DIR)/licenses
  180. LICENSE_FILES_DIR_HOST = $(LEGAL_INFO_DIR)/host-licenses
  181. LEGAL_MANIFEST_CSV_TARGET = $(LEGAL_INFO_DIR)/manifest.csv
  182. LEGAL_MANIFEST_CSV_HOST = $(LEGAL_INFO_DIR)/host-manifest.csv
  183. LEGAL_LICENSES_TXT_TARGET = $(LEGAL_INFO_DIR)/licenses.txt
  184. LEGAL_LICENSES_TXT_HOST = $(LEGAL_INFO_DIR)/host-licenses.txt
  185. LEGAL_WARNINGS = $(LEGAL_INFO_DIR)/.warnings
  186. LEGAL_REPORT = $(LEGAL_INFO_DIR)/README
  187. BR2_CONFIG = $(CONFIG_DIR)/.config
  188. # Pull in the user's configuration file
  189. ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
  190. -include $(BR2_CONFIG)
  191. endif
  192. # To put more focus on warnings, be less verbose as default
  193. # Use 'make V=1' to see the full commands
  194. ifeq ("$(origin V)", "command line")
  195. KBUILD_VERBOSE = $(V)
  196. endif
  197. ifndef KBUILD_VERBOSE
  198. KBUILD_VERBOSE = 0
  199. endif
  200. ifeq ($(KBUILD_VERBOSE),1)
  201. Q =
  202. ifndef VERBOSE
  203. VERBOSE = 1
  204. endif
  205. export VERBOSE
  206. else
  207. Q = @
  208. endif
  209. # we want bash as shell
  210. SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
  211. else if [ -x /bin/bash ]; then echo /bin/bash; \
  212. else echo sh; fi; fi)
  213. # kconfig uses CONFIG_SHELL
  214. CONFIG_SHELL := $(SHELL)
  215. export SHELL CONFIG_SHELL Q KBUILD_VERBOSE
  216. ifndef HOSTAR
  217. HOSTAR := ar
  218. endif
  219. ifndef HOSTAS
  220. HOSTAS := as
  221. endif
  222. ifndef HOSTCC
  223. HOSTCC := gcc
  224. HOSTCC := $(shell which $(HOSTCC) || type -p $(HOSTCC) || echo gcc)
  225. endif
  226. HOSTCC_NOCCACHE := $(HOSTCC)
  227. ifndef HOSTCXX
  228. HOSTCXX := g++
  229. HOSTCXX := $(shell which $(HOSTCXX) || type -p $(HOSTCXX) || echo g++)
  230. endif
  231. HOSTCXX_NOCCACHE := $(HOSTCXX)
  232. ifndef HOSTCPP
  233. HOSTCPP := cpp
  234. endif
  235. ifndef HOSTLD
  236. HOSTLD := ld
  237. endif
  238. ifndef HOSTLN
  239. HOSTLN := ln
  240. endif
  241. ifndef HOSTNM
  242. HOSTNM := nm
  243. endif
  244. ifndef HOSTOBJCOPY
  245. HOSTOBJCOPY := objcopy
  246. endif
  247. ifndef HOSTRANLIB
  248. HOSTRANLIB := ranlib
  249. endif
  250. HOSTAR := $(shell which $(HOSTAR) || type -p $(HOSTAR) || echo ar)
  251. HOSTAS := $(shell which $(HOSTAS) || type -p $(HOSTAS) || echo as)
  252. HOSTCPP := $(shell which $(HOSTCPP) || type -p $(HOSTCPP) || echo cpp)
  253. HOSTLD := $(shell which $(HOSTLD) || type -p $(HOSTLD) || echo ld)
  254. HOSTLN := $(shell which $(HOSTLN) || type -p $(HOSTLN) || echo ln)
  255. HOSTNM := $(shell which $(HOSTNM) || type -p $(HOSTNM) || echo nm)
  256. HOSTOBJCOPY := $(shell which $(HOSTOBJCOPY) || type -p $(HOSTOBJCOPY) || echo objcopy)
  257. HOSTRANLIB := $(shell which $(HOSTRANLIB) || type -p $(HOSTRANLIB) || echo ranlib)
  258. export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTLD
  259. export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE
  260. HOSTCC_VERSION := $(shell $(HOSTCC_NOCCACHE) --version | \
  261. sed -n -r 's/^.* ([0-9]*)\.([0-9]*)\.([0-9]*)[ ]*.*/\1 \2/p')
  262. # For gcc >= 5.x, we only need the major version.
  263. ifneq ($(firstword $(HOSTCC_VERSION)),4)
  264. HOSTCC_VERSION := $(firstword $(HOSTCC_VERSION))
  265. endif
  266. # Make sure pkg-config doesn't look outside the buildroot tree
  267. HOST_PKG_CONFIG_PATH := $(PKG_CONFIG_PATH)
  268. unexport PKG_CONFIG_PATH
  269. unexport PKG_CONFIG_SYSROOT_DIR
  270. unexport PKG_CONFIG_LIBDIR
  271. # Having DESTDIR set in the environment confuses the installation
  272. # steps of some packages.
  273. unexport DESTDIR
  274. # Causes breakage with packages that needs host-ruby
  275. unexport RUBYOPT
  276. include package/pkg-utils.mk
  277. include package/doc-asciidoc.mk
  278. ifeq ($(BR2_HAVE_DOT_CONFIG),y)
  279. ################################################################################
  280. #
  281. # Hide troublesome environment variables from sub processes
  282. #
  283. ################################################################################
  284. unexport CROSS_COMPILE
  285. unexport ARCH
  286. unexport CC
  287. unexport CXX
  288. unexport CPP
  289. unexport RANLIB
  290. unexport CFLAGS
  291. unexport CXXFLAGS
  292. unexport GREP_OPTIONS
  293. unexport TAR_OPTIONS
  294. unexport CONFIG_SITE
  295. unexport QMAKESPEC
  296. unexport TERMINFO
  297. unexport MACHINE
  298. unexport O
  299. GNU_HOST_NAME := $(shell support/gnuconfig/config.guess)
  300. PACKAGES :=
  301. PACKAGES_ALL :=
  302. # silent mode requested?
  303. QUIET := $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),-q)
  304. # Strip off the annoying quoting
  305. ARCH := $(call qstrip,$(BR2_ARCH))
  306. KERNEL_ARCH := $(shell echo "$(ARCH)" | sed -e "s/-.*//" \
  307. -e s/i.86/i386/ -e s/sun4u/sparc64/ \
  308. -e s/arcle/arc/ \
  309. -e s/arceb/arc/ \
  310. -e s/arm.*/arm/ -e s/sa110/arm/ \
  311. -e s/aarch64.*/arm64/ \
  312. -e s/bfin/blackfin/ \
  313. -e s/parisc64/parisc/ \
  314. -e s/powerpc64.*/powerpc/ \
  315. -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
  316. -e s/sh.*/sh/ \
  317. -e s/microblazeel/microblaze/)
  318. ZCAT := $(call qstrip,$(BR2_ZCAT))
  319. BZCAT := $(call qstrip,$(BR2_BZCAT))
  320. XZCAT := $(call qstrip,$(BR2_XZCAT))
  321. TAR_OPTIONS = $(call qstrip,$(BR2_TAR_OPTIONS)) -xf
  322. # packages compiled for the host go here
  323. HOST_DIR := $(call qstrip,$(BR2_HOST_DIR))
  324. # Quotes are needed for spaces and all in the original PATH content.
  325. BR_PATH = "$(HOST_DIR)/bin:$(HOST_DIR)/sbin:$(HOST_DIR)/usr/bin:$(HOST_DIR)/usr/sbin:$(PATH)"
  326. # Location of a file giving a big fat warning that output/target
  327. # should not be used as the root filesystem.
  328. TARGET_DIR_WARNING_FILE = $(TARGET_DIR)/THIS_IS_NOT_YOUR_ROOT_FILESYSTEM
  329. ifeq ($(BR2_CCACHE),y)
  330. CCACHE := $(HOST_DIR)/usr/bin/ccache
  331. BR_CACHE_DIR ?= $(call qstrip,$(BR2_CCACHE_DIR))
  332. export BR_CACHE_DIR
  333. HOSTCC := $(CCACHE) $(HOSTCC)
  334. HOSTCXX := $(CCACHE) $(HOSTCXX)
  335. else
  336. export BR_NO_CCACHE
  337. endif
  338. # Scripts in support/ or post-build scripts may need to reference
  339. # these locations, so export them so it is easier to use
  340. export BR2_CONFIG
  341. export TARGET_DIR
  342. export STAGING_DIR
  343. export HOST_DIR
  344. export BINARIES_DIR
  345. export BASE_DIR
  346. ################################################################################
  347. #
  348. # You should probably leave this stuff alone unless you know
  349. # what you are doing.
  350. #
  351. ################################################################################
  352. all: world
  353. # Include legacy before the other things, because package .mk files
  354. # may rely on it.
  355. ifneq ($(BR2_DEPRECATED),y)
  356. include Makefile.legacy
  357. endif
  358. include package/Makefile.in
  359. include support/dependencies/dependencies.mk
  360. include toolchain/*.mk
  361. include toolchain/*/*.mk
  362. # Include the package override file if one has been provided in the
  363. # configuration.
  364. PACKAGE_OVERRIDE_FILE = $(call qstrip,$(BR2_PACKAGE_OVERRIDE_FILE))
  365. ifneq ($(PACKAGE_OVERRIDE_FILE),)
  366. -include $(PACKAGE_OVERRIDE_FILE)
  367. endif
  368. include $(sort $(wildcard package/*/*.mk))
  369. include boot/common.mk
  370. include linux/linux.mk
  371. include fs/common.mk
  372. include $(BR2_EXTERNAL)/external.mk
  373. dirs: $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
  374. $(HOST_DIR) $(BINARIES_DIR)
  375. $(BUILD_DIR)/buildroot-config/auto.conf: $(BR2_CONFIG)
  376. $(MAKE1) $(EXTRAMAKEARGS) HOSTCC="$(HOSTCC_NOCCACHE)" HOSTCXX="$(HOSTCXX_NOCCACHE)" silentoldconfig
  377. prepare: $(BUILD_DIR)/buildroot-config/auto.conf
  378. world: target-post-image
  379. .PHONY: all world toolchain dirs clean distclean source outputmakefile \
  380. legal-info legal-info-prepare legal-info-clean printvars help \
  381. list-defconfigs target-finalize target-post-image source-check
  382. ################################################################################
  383. #
  384. # staging and target directories do NOT list these as
  385. # dependencies anywhere else
  386. #
  387. ################################################################################
  388. $(BUILD_DIR) $(TARGET_DIR) $(HOST_DIR) $(BINARIES_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST):
  389. @mkdir -p $@
  390. # We make a symlink lib32->lib or lib64->lib as appropriate
  391. # MIPS64/n32 requires lib32 even though it's a 64-bit arch.
  392. ifeq ($(BR2_ARCH_IS_64)$(BR2_MIPS_NABI32),y)
  393. LIB_SYMLINK = lib64
  394. else
  395. LIB_SYMLINK = lib32
  396. endif
  397. # Populating the staging with the base directories is handled by the skeleton package
  398. $(STAGING_DIR):
  399. @mkdir -p $(STAGING_DIR)
  400. @ln -snf $(STAGING_DIR) $(BASE_DIR)/staging
  401. RSYNC_VCS_EXCLUSIONS = \
  402. --exclude .svn --exclude .git --exclude .hg --exclude .bzr \
  403. --exclude CVS
  404. STRIP_FIND_CMD = find $(TARGET_DIR)
  405. ifneq (,$(call qstrip,$(BR2_STRIP_EXCLUDE_DIRS)))
  406. STRIP_FIND_CMD += \( $(call finddirclauses,$(TARGET_DIR),$(call qstrip,$(BR2_STRIP_EXCLUDE_DIRS))) \) -prune -o
  407. endif
  408. STRIP_FIND_CMD += -type f \( -perm /111 -o -name '*.so*' \)
  409. # file exclusions:
  410. # - libpthread.so: a non-stripped libpthread shared library is needed for
  411. # proper debugging of pthread programs using gdb.
  412. # - ld.so: a non-stripped dynamic linker library is needed for valgrind
  413. # - kernel modules (*.ko): do not function properly when stripped like normal
  414. # applications and libraries. Normally kernel modules are already excluded
  415. # by the executable permission check above, so the explicit exclusion is only
  416. # done for kernel modules with incorrect permissions.
  417. STRIP_FIND_CMD += -not \( $(call findfileclauses,libpthread*.so* ld-*.so* *.ko $(call qstrip,$(BR2_STRIP_EXCLUDE_FILES))) \) -print0
  418. ifeq ($(BR2_ECLIPSE_REGISTER),y)
  419. define TOOLCHAIN_ECLIPSE_REGISTER
  420. ./support/scripts/eclipse-register-toolchain `readlink -f $(O)` \
  421. $(notdir $(TARGET_CROSS)) $(BR2_ARCH)
  422. endef
  423. TARGET_FINALIZE_HOOKS += TOOLCHAIN_ECLIPSE_REGISTER
  424. endif
  425. # Generate locale data. Basically, we call the localedef program
  426. # (built by the host-localedef package) for each locale. The input
  427. # data comes preferably from the toolchain, or if the toolchain does
  428. # not have them (Linaro toolchains), we use the ones available on the
  429. # host machine.
  430. ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
  431. GLIBC_GENERATE_LOCALES = $(call qstrip,$(BR2_GENERATE_LOCALE))
  432. ifneq ($(GLIBC_GENERATE_LOCALES),)
  433. PACKAGES += host-localedef
  434. define GENERATE_GLIBC_LOCALES
  435. $(Q)mkdir -p $(TARGET_DIR)/usr/lib/locale/
  436. $(Q)for locale in $(GLIBC_GENERATE_LOCALES) ; do \
  437. inputfile=`echo $${locale} | cut -f1 -d'.'` ; \
  438. charmap=`echo $${locale} | cut -f2 -d'.' -s` ; \
  439. if test -z "$${charmap}" ; then \
  440. charmap="UTF-8" ; \
  441. fi ; \
  442. echo "Generating locale $${inputfile}.$${charmap}" ; \
  443. I18NPATH=$(STAGING_DIR)/usr/share/i18n:/usr/share/i18n \
  444. $(HOST_DIR)/usr/bin/localedef \
  445. --prefix=$(TARGET_DIR) \
  446. --$(call LOWERCASE,$(BR2_ENDIAN))-endian \
  447. -i $${inputfile} -f $${charmap} \
  448. $${locale} ; \
  449. done
  450. endef
  451. TARGET_FINALIZE_HOOKS += GENERATE_GLIBC_LOCALES
  452. endif
  453. endif
  454. ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
  455. LOCALE_WHITELIST = $(BUILD_DIR)/locales.nopurge
  456. LOCALE_NOPURGE = $(call qstrip,$(BR2_ENABLE_LOCALE_WHITELIST))
  457. # This piece of junk does the following:
  458. # First collect the whitelist in a file.
  459. # Then go over all the locale dirs and for each subdir, check if it exists
  460. # in the whitelist file. If it doesn't, kill it.
  461. # Finally, specifically for X11, regenerate locale.dir from the whitelist.
  462. define PURGE_LOCALES
  463. rm -f $(LOCALE_WHITELIST)
  464. for i in $(LOCALE_NOPURGE) locale-archive; do echo $$i >> $(LOCALE_WHITELIST); done
  465. for dir in $(wildcard $(addprefix $(TARGET_DIR),/usr/share/locale /usr/share/X11/locale /usr/lib/locale)); \
  466. do \
  467. for langdir in $$dir/*; \
  468. do \
  469. grep -qx $${langdir##*/} $(LOCALE_WHITELIST) || rm -rf $$langdir; \
  470. done; \
  471. done
  472. if [ -d $(TARGET_DIR)/usr/share/X11/locale ]; \
  473. then \
  474. for lang in $(LOCALE_NOPURGE); \
  475. do \
  476. if [ -f $(TARGET_DIR)/usr/share/X11/locale/$$lang/XLC_LOCALE ]; \
  477. then \
  478. echo "$$lang/XLC_LOCALE: $$lang"; \
  479. fi \
  480. done > $(TARGET_DIR)/usr/share/X11/locale/locale.dir; \
  481. fi
  482. endef
  483. TARGET_FINALIZE_HOOKS += PURGE_LOCALES
  484. endif
  485. $(TARGETS_ROOTFS): target-finalize
  486. target-finalize: $(PACKAGES)
  487. @$(call MESSAGE,"Finalizing target directory")
  488. $(foreach hook,$(TARGET_FINALIZE_HOOKS),$($(hook))$(sep))
  489. rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/share/aclocal \
  490. $(TARGET_DIR)/usr/lib/pkgconfig $(TARGET_DIR)/usr/share/pkgconfig \
  491. $(TARGET_DIR)/usr/lib/cmake $(TARGET_DIR)/usr/share/cmake
  492. find $(TARGET_DIR)/usr/{lib,share}/ -name '*.cmake' -print0 | xargs -0 rm -f
  493. find $(TARGET_DIR)/lib $(TARGET_DIR)/usr/lib $(TARGET_DIR)/usr/libexec \
  494. \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
  495. ifneq ($(BR2_PACKAGE_GDB),y)
  496. rm -rf $(TARGET_DIR)/usr/share/gdb
  497. endif
  498. ifneq ($(BR2_PACKAGE_BASH),y)
  499. rm -rf $(TARGET_DIR)/usr/share/bash-completion
  500. endif
  501. ifneq ($(BR2_PACKAGE_ZSH),y)
  502. rm -rf $(TARGET_DIR)/usr/share/zsh
  503. endif
  504. rm -rf $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/man
  505. rm -rf $(TARGET_DIR)/usr/info $(TARGET_DIR)/usr/share/info
  506. rm -rf $(TARGET_DIR)/usr/doc $(TARGET_DIR)/usr/share/doc
  507. rm -rf $(TARGET_DIR)/usr/share/gtk-doc
  508. -rmdir $(TARGET_DIR)/usr/share 2>/dev/null
  509. $(STRIP_FIND_CMD) | xargs -0 $(STRIPCMD) 2>/dev/null || true
  510. if test -d $(TARGET_DIR)/lib/modules; then \
  511. find $(TARGET_DIR)/lib/modules -type f -name '*.ko' -print0 | \
  512. xargs -0 -r $(KSTRIPCMD); fi
  513. # See http://sourceware.org/gdb/wiki/FAQ, "GDB does not see any threads
  514. # besides the one in which crash occurred; or SIGTRAP kills my program when
  515. # I set a breakpoint"
  516. ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
  517. find $(TARGET_DIR)/lib -type f -name 'libpthread*.so*' | \
  518. xargs -r $(STRIPCMD) $(STRIP_STRIP_DEBUG)
  519. endif
  520. # Valgrind needs ld.so with enough information, so only strip
  521. # debugging symbols.
  522. find $(TARGET_DIR)/lib -type f -name 'ld-*.so*' | \
  523. xargs -r $(STRIPCMD) $(STRIP_STRIP_DEBUG)
  524. test -f $(TARGET_DIR)/etc/ld.so.conf && \
  525. { echo "ERROR: we shouldn't have a /etc/ld.so.conf file"; exit 1; } || true
  526. test -d $(TARGET_DIR)/etc/ld.so.conf.d && \
  527. { echo "ERROR: we shouldn't have a /etc/ld.so.conf.d directory"; exit 1; } || true
  528. mkdir -p $(TARGET_DIR)/etc
  529. ( \
  530. echo "NAME=Buildroot"; \
  531. echo "VERSION=$(BR2_VERSION_FULL)"; \
  532. echo "ID=buildroot"; \
  533. echo "VERSION_ID=$(BR2_VERSION)"; \
  534. echo "PRETTY_NAME=\"Buildroot $(BR2_VERSION)\"" \
  535. ) > $(TARGET_DIR)/etc/os-release
  536. @$(foreach d, $(call qstrip,$(BR2_ROOTFS_OVERLAY)), \
  537. $(call MESSAGE,"Copying overlay $(d)"); \
  538. rsync -a --ignore-times $(RSYNC_VCS_EXCLUSIONS) \
  539. --chmod=u=rwX,go=rX --exclude .empty --exclude '*~' \
  540. $(d)/ $(TARGET_DIR)$(sep))
  541. @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
  542. $(call MESSAGE,"Executing post-build script $(s)"); \
  543. $(EXTRA_ENV) $(s) $(TARGET_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep))
  544. target-post-image: $(TARGETS_ROOTFS) target-finalize
  545. @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_IMAGE_SCRIPT)), \
  546. $(call MESSAGE,"Executing post-image script $(s)"); \
  547. $(EXTRA_ENV) $(s) $(BINARIES_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep))
  548. source: $(foreach p,$(PACKAGES),$(p)-all-source)
  549. _external-deps: $(foreach p,$(PACKAGES),$(p)-all-external-deps)
  550. external-deps:
  551. @$(MAKE1) -Bs $(EXTRAMAKEARGS) _external-deps | sort -u
  552. # check if download URLs are outdated
  553. source-check: $(foreach p,$(PACKAGES),$(p)-all-source-check)
  554. legal-info-clean:
  555. @rm -fr $(LEGAL_INFO_DIR)
  556. legal-info-prepare: $(LEGAL_INFO_DIR)
  557. @$(call MESSAGE,"Collecting legal info")
  558. @$(call legal-license-file,buildroot,COPYING,COPYING,HOST)
  559. @$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,SOURCE SITE,TARGET)
  560. @$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,SOURCE SITE,HOST)
  561. @$(call legal-manifest,buildroot,$(BR2_VERSION_FULL),GPLv2+,COPYING,not saved,not saved,HOST)
  562. @$(call legal-warning,the Buildroot source code has not been saved)
  563. @cp $(BR2_CONFIG) $(LEGAL_INFO_DIR)/buildroot.config
  564. legal-info: dirs legal-info-clean legal-info-prepare $(foreach p,$(PACKAGES),$(p)-all-legal-info) \
  565. $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST)
  566. @cat support/legal-info/README.header >>$(LEGAL_REPORT)
  567. @if [ -r $(LEGAL_WARNINGS) ]; then \
  568. cat support/legal-info/README.warnings-header \
  569. $(LEGAL_WARNINGS) >>$(LEGAL_REPORT); \
  570. cat $(LEGAL_WARNINGS); fi
  571. @echo "Legal info produced in $(LEGAL_INFO_DIR)"
  572. @rm -f $(LEGAL_WARNINGS)
  573. show-targets:
  574. @echo $(PACKAGES) $(TARGETS_ROOTFS)
  575. graph-build: $(O)/build/build-time.log
  576. @install -d $(GRAPHS_DIR)
  577. $(foreach o,name build duration,./support/scripts/graph-build-time \
  578. --type=histogram --order=$(o) --input=$(<) \
  579. --output=$(GRAPHS_DIR)/build.hist-$(o).$(BR_GRAPH_OUT) \
  580. $(if $(BR2_GRAPH_ALT),--alternate-colors)$(sep))
  581. $(foreach t,packages steps,./support/scripts/graph-build-time \
  582. --type=pie-$(t) --input=$(<) \
  583. --output=$(GRAPHS_DIR)/build.pie-$(t).$(BR_GRAPH_OUT) \
  584. $(if $(BR2_GRAPH_ALT),--alternate-colors)$(sep))
  585. graph-depends-requirements:
  586. @dot -? >/dev/null 2>&1 || \
  587. { echo "ERROR: The 'dot' program from Graphviz is needed for graph-depends" >&2; exit 1; }
  588. graph-depends: graph-depends-requirements
  589. @$(INSTALL) -d $(GRAPHS_DIR)
  590. @cd "$(CONFIG_DIR)"; \
  591. $(TOPDIR)/support/scripts/graph-depends $(BR2_GRAPH_DEPS_OPTS) \
  592. |tee $(GRAPHS_DIR)/$(@).dot \
  593. |dot $(BR2_GRAPH_DOT_OPTS) -T$(BR_GRAPH_OUT) -o $(GRAPHS_DIR)/$(@).$(BR_GRAPH_OUT)
  594. graph-size:
  595. $(Q)mkdir -p $(GRAPHS_DIR)
  596. $(Q)$(TOPDIR)/support/scripts/size-stats --builddir $(BASE_DIR) \
  597. --graph $(GRAPHS_DIR)/graph-size.$(BR_GRAPH_OUT) \
  598. --file-size-csv $(GRAPHS_DIR)/file-size-stats.csv \
  599. --package-size-csv $(GRAPHS_DIR)/package-size-stats.csv
  600. else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
  601. all: menuconfig
  602. endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
  603. # configuration
  604. # ---------------------------------------------------------------------------
  605. HOSTCFLAGS = $(CFLAGS_FOR_BUILD)
  606. export HOSTCFLAGS
  607. $(BUILD_DIR)/buildroot-config/%onf:
  608. mkdir -p $(@D)/lxdialog
  609. PKG_CONFIG_PATH="$(HOST_PKG_CONFIG_PATH)" $(MAKE) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" \
  610. obj=$(@D) -C $(CONFIG) -f Makefile.br $(@F)
  611. DEFCONFIG = $(call qstrip,$(BR2_DEFCONFIG))
  612. # We don't want to fully expand BR2_DEFCONFIG here, so Kconfig will
  613. # recognize that if it's still at its default $(CONFIG_DIR)/defconfig
  614. COMMON_CONFIG_ENV = \
  615. BR2_DEFCONFIG='$(call qstrip,$(value BR2_DEFCONFIG))' \
  616. KCONFIG_AUTOCONFIG=$(BUILD_DIR)/buildroot-config/auto.conf \
  617. KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \
  618. KCONFIG_TRISTATE=$(BUILD_DIR)/buildroot-config/tristate.config \
  619. BR2_CONFIG=$(BR2_CONFIG) \
  620. BR2_EXTERNAL=$(BR2_EXTERNAL) \
  621. HOST_GCC_VERSION="$(HOSTCC_VERSION)" \
  622. SKIP_LEGACY=
  623. xconfig: $(BUILD_DIR)/buildroot-config/qconf outputmakefile
  624. @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
  625. gconfig: $(BUILD_DIR)/buildroot-config/gconf outputmakefile
  626. @$(COMMON_CONFIG_ENV) srctree=$(TOPDIR) $< $(CONFIG_CONFIG_IN)
  627. menuconfig: $(BUILD_DIR)/buildroot-config/mconf outputmakefile
  628. @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
  629. nconfig: $(BUILD_DIR)/buildroot-config/nconf outputmakefile
  630. @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
  631. config: $(BUILD_DIR)/buildroot-config/conf outputmakefile
  632. @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
  633. # For the config targets that automatically select options, we pass
  634. # SKIP_LEGACY=y to disable the legacy options. However, in that case
  635. # no values are set for the legacy options so a subsequent oldconfig
  636. # will query them. Therefore, run an additional olddefconfig.
  637. oldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
  638. @$(COMMON_CONFIG_ENV) $< --oldconfig $(CONFIG_CONFIG_IN)
  639. randconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
  640. @$(COMMON_CONFIG_ENV) SKIP_LEGACY=y $< --randconfig $(CONFIG_CONFIG_IN)
  641. @$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
  642. allyesconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
  643. @$(COMMON_CONFIG_ENV) SKIP_LEGACY=y $< --allyesconfig $(CONFIG_CONFIG_IN)
  644. @$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
  645. allnoconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
  646. @$(COMMON_CONFIG_ENV) SKIP_LEGACY=y $< --allnoconfig $(CONFIG_CONFIG_IN)
  647. @$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
  648. randpackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
  649. @grep -v BR2_PACKAGE_ $(BR2_CONFIG) > $(CONFIG_DIR)/.config.nopkg
  650. @$(COMMON_CONFIG_ENV) SKIP_LEGACY=y \
  651. KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
  652. $< --randconfig $(CONFIG_CONFIG_IN)
  653. @rm -f $(CONFIG_DIR)/.config.nopkg
  654. @$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
  655. allyespackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
  656. @grep -v BR2_PACKAGE_ $(BR2_CONFIG) > $(CONFIG_DIR)/.config.nopkg
  657. @$(COMMON_CONFIG_ENV) SKIP_LEGACY=y \
  658. KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
  659. $< --allyesconfig $(CONFIG_CONFIG_IN)
  660. @rm -f $(CONFIG_DIR)/.config.nopkg
  661. @$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
  662. allnopackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
  663. @grep -v BR2_PACKAGE_ $(BR2_CONFIG) > $(CONFIG_DIR)/.config.nopkg
  664. @$(COMMON_CONFIG_ENV) SKIP_LEGACY=y \
  665. KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
  666. $< --allnoconfig $(CONFIG_CONFIG_IN)
  667. @rm -f $(CONFIG_DIR)/.config.nopkg
  668. @$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
  669. silentoldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
  670. $(COMMON_CONFIG_ENV) $< --silentoldconfig $(CONFIG_CONFIG_IN)
  671. olddefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
  672. $(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN)
  673. defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
  674. @$(COMMON_CONFIG_ENV) $< --defconfig$(if $(DEFCONFIG),=$(DEFCONFIG)) $(CONFIG_CONFIG_IN)
  675. # Override the BR2_DEFCONFIG from COMMON_CONFIG_ENV with the new defconfig
  676. %_defconfig: $(BUILD_DIR)/buildroot-config/conf $(TOPDIR)/configs/%_defconfig outputmakefile
  677. @$(COMMON_CONFIG_ENV) BR2_DEFCONFIG=$(TOPDIR)/configs/$@ \
  678. $< --defconfig=$(TOPDIR)/configs/$@ $(CONFIG_CONFIG_IN)
  679. %_defconfig: $(BUILD_DIR)/buildroot-config/conf $(BR2_EXTERNAL)/configs/%_defconfig outputmakefile
  680. @$(COMMON_CONFIG_ENV) BR2_DEFCONFIG=$(BR2_EXTERNAL)/configs/$@ \
  681. $< --defconfig=$(BR2_EXTERNAL)/configs/$@ $(CONFIG_CONFIG_IN)
  682. savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
  683. @$(COMMON_CONFIG_ENV) $< \
  684. --savedefconfig=$(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) \
  685. $(CONFIG_CONFIG_IN)
  686. @$(SED) '/BR2_DEFCONFIG=/d' $(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig)
  687. .PHONY: defconfig savedefconfig
  688. ################################################################################
  689. #
  690. # Cleanup and misc junk
  691. #
  692. ################################################################################
  693. # outputmakefile generates a Makefile in the output directory, if using a
  694. # separate output directory. This allows convenient use of make in the
  695. # output directory.
  696. outputmakefile:
  697. ifeq ($(NEED_WRAPPER),y)
  698. $(Q)$(TOPDIR)/support/scripts/mkmakefile $(TOPDIR) $(O)
  699. endif
  700. # printvars prints all the variables currently defined in our
  701. # Makefiles. Alternatively, if a non-empty VARS variable is passed,
  702. # only the variables matching the make pattern passed in VARS are
  703. # displayed.
  704. printvars:
  705. @$(foreach V, \
  706. $(sort $(if $(VARS),$(filter $(VARS),$(.VARIABLES)),$(.VARIABLES))), \
  707. $(if $(filter-out environment% default automatic, \
  708. $(origin $V)), \
  709. $(info $V=$($V) ($(value $V)))))
  710. clean:
  711. rm -rf $(TARGET_DIR) $(BINARIES_DIR) $(HOST_DIR) \
  712. $(BUILD_DIR) $(BASE_DIR)/staging \
  713. $(LEGAL_INFO_DIR) $(GRAPHS_DIR)
  714. distclean: clean
  715. ifeq ($(DL_DIR),$(TOPDIR)/dl)
  716. rm -rf $(DL_DIR)
  717. endif
  718. ifeq ($(O),output)
  719. rm -rf $(O)
  720. endif
  721. rm -rf $(BR2_CONFIG) $(CONFIG_DIR)/.config.old $(CONFIG_DIR)/..config.tmp \
  722. $(CONFIG_DIR)/.auto.deps $(BR2_EXTERNAL_FILE)
  723. help:
  724. @echo 'Cleaning:'
  725. @echo ' clean - delete all files created by build'
  726. @echo ' distclean - delete all non-source files (including .config)'
  727. @echo
  728. @echo 'Build:'
  729. @echo ' all - make world'
  730. @echo ' toolchain - build toolchain'
  731. @echo
  732. @echo 'Configuration:'
  733. @echo ' menuconfig - interactive curses-based configurator'
  734. @echo ' nconfig - interactive ncurses-based configurator'
  735. @echo ' xconfig - interactive Qt-based configurator'
  736. @echo ' gconfig - interactive GTK-based configurator'
  737. @echo ' oldconfig - resolve any unresolved symbols in .config'
  738. @echo ' silentoldconfig - Same as oldconfig, but quietly, additionally update deps'
  739. @echo ' olddefconfig - Same as silentoldconfig but sets new symbols to their default value'
  740. @echo ' randconfig - New config with random answer to all options'
  741. @echo ' defconfig - New config with default answer to all options'
  742. @echo ' BR2_DEFCONFIG, if set, is used as input'
  743. @echo ' savedefconfig - Save current config to BR2_DEFCONFIG (minimal config)'
  744. @echo ' allyesconfig - New config where all options are accepted with yes'
  745. @echo ' allnoconfig - New config where all options are answered with no'
  746. @echo ' randpackageconfig - New config with random answer to package options'
  747. @echo ' allyespackageconfig - New config where pkg options are accepted with yes'
  748. @echo ' allnopackageconfig - New config where package options are answered with no'
  749. @echo
  750. @echo 'Package-specific:'
  751. @echo ' <pkg> - Build and install <pkg> and all its dependencies'
  752. @echo ' <pkg>-source - Only download the source files for <pkg>'
  753. @echo ' <pkg>-extract - Extract <pkg> sources'
  754. @echo ' <pkg>-patch - Apply patches to <pkg>'
  755. @echo ' <pkg>-depends - Build <pkg>'\''s dependencies'
  756. @echo ' <pkg>-configure - Build <pkg> up to the configure step'
  757. @echo ' <pkg>-build - Build <pkg> up to the build step'
  758. @echo ' <pkg>-graph-depends - Generate a graph of <pkg>'\''s dependencies'
  759. @echo ' <pkg>-dirclean - Remove <pkg> build directory'
  760. @echo ' <pkg>-reconfigure - Restart the build from the configure step'
  761. @echo ' <pkg>-rebuild - Restart the build from the build step'
  762. ifeq ($(BR2_PACKAGE_BUSYBOX),y)
  763. @echo ' busybox-menuconfig - Run BusyBox menuconfig'
  764. endif
  765. ifeq ($(BR2_LINUX_KERNEL),y)
  766. @echo ' linux-menuconfig - Run Linux kernel menuconfig'
  767. @echo ' linux-savedefconfig - Run Linux kernel savedefconfig'
  768. @echo ' linux-update-defconfig - Save the Linux configuration to the path specified'
  769. @echo ' by BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE'
  770. endif
  771. ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
  772. @echo ' uclibc-menuconfig - Run uClibc menuconfig'
  773. endif
  774. ifeq ($(BR2_TARGET_BAREBOX),y)
  775. @echo ' barebox-menuconfig - Run barebox menuconfig'
  776. @echo ' barebox-savedefconfig - Run barebox savedefconfig'
  777. endif
  778. @echo
  779. @echo 'Documentation:'
  780. @echo ' manual - build manual in all formats'
  781. @echo ' manual-html - build manual in HTML'
  782. @echo ' manual-split-html - build manual in split HTML'
  783. @echo ' manual-pdf - build manual in PDF'
  784. @echo ' manual-text - build manual in text'
  785. @echo ' manual-epub - build manual in ePub'
  786. @echo ' graph-build - generate graphs of the build times'
  787. @echo ' graph-depends - generate graph of the dependency tree'
  788. @echo ' graph-size - generate stats of the filesystem size'
  789. @echo ' list-defconfigs - list all defconfigs (pre-configured minimal systems)'
  790. @echo
  791. @echo 'Miscellaneous:'
  792. @echo ' source - download all sources needed for offline-build'
  793. @echo ' source-check - check selected packages for valid download URLs'
  794. @echo ' external-deps - list external packages used'
  795. @echo ' legal-info - generate info about license compliance'
  796. @echo
  797. @echo ' make V=0|1 - 0 => quiet build (default), 1 => verbose build'
  798. @echo ' make O=dir - Locate all output files in "dir", including .config'
  799. @echo
  800. @echo 'For further details, see README, generate the Buildroot manual, or consult'
  801. @echo 'it on-line at http://buildroot.org/docs.html'
  802. @echo
  803. list-defconfigs:
  804. @echo 'Built-in configs:'
  805. @$(foreach b, $(sort $(notdir $(wildcard $(TOPDIR)/configs/*_defconfig))), \
  806. printf " %-35s - Build for %s\\n" $(b) $(b:_defconfig=);)
  807. ifneq ($(wildcard $(BR2_EXTERNAL)/configs/*_defconfig),)
  808. @echo
  809. @echo 'User-provided configs:'
  810. @$(foreach b, $(sort $(notdir $(wildcard $(BR2_EXTERNAL)/configs/*_defconfig))), \
  811. printf " %-35s - Build for %s\\n" $(b) $(b:_defconfig=);)
  812. endif
  813. @echo
  814. release: OUT = buildroot-$(BR2_VERSION)
  815. # Create release tarballs. We need to fiddle a bit to add the generated
  816. # documentation to the git output
  817. release:
  818. git archive --format=tar --prefix=$(OUT)/ HEAD > $(OUT).tar
  819. $(MAKE) O=$(OUT) manual-html manual-text manual-pdf
  820. $(MAKE) O=$(OUT) manual-clean
  821. tar rf $(OUT).tar $(OUT)
  822. gzip -9 -c < $(OUT).tar > $(OUT).tar.gz
  823. bzip2 -9 -c < $(OUT).tar > $(OUT).tar.bz2
  824. rm -rf $(OUT) $(OUT).tar
  825. print-version:
  826. @echo $(BR2_VERSION_FULL)
  827. include docs/manual/manual.mk
  828. -include $(BR2_EXTERNAL)/docs/*/*.mk
  829. .PHONY: $(noconfig_targets)
  830. endif #umask