Makefile 33 KB

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