Makefile 34 KB

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