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