Makefile 32 KB

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