Makefile 32 KB

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