Makefile 34 KB

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