core: get rid of our dummy br2-external tree
[buildroot-gz.git] / Makefile
blobf5d7536dd28e88b1f83e26fa6124bc61968da671
1 # Makefile for buildroot
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-2016 by the Buildroot developers <buildroot@buildroot.org>
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.
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.
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
22 #--------------------------------------------------------------
23 # Just run 'make menuconfig', configure stuff, then run 'make'.
24 # You shouldn't need to mess with anything beyond this point...
25 #--------------------------------------------------------------
27 # we want bash as shell
28 SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
29 else if [ -x /bin/bash ]; then echo /bin/bash; \
30 else echo sh; fi; fi)
32 # Trick for always running with a fixed umask
33 UMASK = 0022
34 ifneq ($(shell umask),$(UMASK))
35 .PHONY: _all $(MAKECMDGOALS)
37 $(MAKECMDGOALS): _all
40 _all:
41 @umask $(UMASK) && $(MAKE) --no-print-directory $(MAKECMDGOALS)
43 else # umask
45 # This is our default rule, so must come first
46 all:
48 # Set and export the version string
49 export BR2_VERSION := 2016.11-git
51 # Save running make version since it's clobbered by the make package
52 RUNNING_MAKE_VERSION := $(MAKE_VERSION)
54 # Check for minimal make version (note: this check will break at make 10.x)
55 MIN_MAKE_VERSION = 3.81
56 ifneq ($(firstword $(sort $(RUNNING_MAKE_VERSION) $(MIN_MAKE_VERSION))),$(MIN_MAKE_VERSION))
57 $(error You have make '$(RUNNING_MAKE_VERSION)' installed. GNU make >= $(MIN_MAKE_VERSION) is required)
58 endif
60 # Parallel execution of this Makefile is disabled because it changes
61 # the packages building order, that can be a problem for two reasons:
62 # - If a package has an unspecified optional dependency and that
63 # dependency is present when the package is built, it is used,
64 # otherwise it isn't (but compilation happily proceeds) so the end
65 # result will differ if the order is swapped due to parallel
66 # building.
67 # - Also changing the building order can be a problem if two packages
68 # manipulate the same file in the target directory.
70 # Taking into account the above considerations, if you still want to execute
71 # this top-level Makefile in parallel comment the ".NOTPARALLEL" line and
72 # use the -j<jobs> option when building, e.g:
73 # make -j$((`getconf _NPROCESSORS_ONLN`+1))
74 .NOTPARALLEL:
76 # absolute path
77 TOPDIR := $(CURDIR)
78 CONFIG_CONFIG_IN = Config.in
79 CONFIG = support/kconfig
80 DATE := $(shell date +%Y%m%d)
82 # Compute the full local version string so packages can use it as-is
83 # Need to export it, so it can be got from environment in children (eg. mconf)
84 export BR2_VERSION_FULL := $(BR2_VERSION)$(shell $(TOPDIR)/support/scripts/setlocalversion)
86 noconfig_targets := menuconfig nconfig gconfig xconfig config oldconfig randconfig \
87 defconfig %_defconfig allyesconfig allnoconfig silentoldconfig release \
88 randpackageconfig allyespackageconfig allnopackageconfig \
89 print-version olddefconfig distclean
91 # Some global targets do not trigger a build, but are used to collect
92 # metadata, or do various checks. When such targets are triggered,
93 # some packages should not do their configuration sanity
94 # checks. Provide them a BR_BUILDING variable set to 'y' when we're
95 # actually building and they should do their sanity checks.
97 # We're building in two situations: when MAKECMDGOALS is empty
98 # (default target is to build), or when MAKECMDGOALS contains
99 # something else than one of the nobuild_targets.
100 nobuild_targets := source source-check \
101 legal-info external-deps _external-deps \
102 clean distclean help
103 ifeq ($(MAKECMDGOALS),)
104 BR_BUILDING = y
105 else ifneq ($(filter-out $(nobuild_targets),$(MAKECMDGOALS)),)
106 BR_BUILDING = y
107 endif
109 # Include some helper macros and variables
110 include support/misc/utils.mk
112 ifneq ("$(origin O)", "command line")
113 O := output
114 CONFIG_DIR := $(TOPDIR)
115 NEED_WRAPPER =
116 else
117 # other packages might also support Linux-style out of tree builds
118 # with the O=<dir> syntax (E.G. BusyBox does). As make automatically
119 # forwards command line variable definitions those packages get very
120 # confused. Fix this by telling make to not do so
121 MAKEOVERRIDES =
122 # strangely enough O is still passed to submakes with MAKEOVERRIDES
123 # (with make 3.81 atleast), the only thing that changes is the output
124 # of the origin function (command line -> environment).
125 # Unfortunately some packages don't look at origin (E.G. uClibc 0.9.31+)
126 # To really make O go away, we have to override it.
127 override O := $(O)
128 CONFIG_DIR := $(O)
129 # we need to pass O= everywhere we call back into the toplevel makefile
130 EXTRAMAKEARGS = O=$(O)
131 NEED_WRAPPER = y
132 endif
134 # bash prints the name of the directory on 'cd <dir>' if CDPATH is
135 # set, so unset it here to not cause problems. Notice that the export
136 # line doesn't affect the environment of $(shell ..) calls, so
137 # explictly throw away any output from 'cd' here.
138 export CDPATH :=
139 BASE_DIR := $(shell mkdir -p $(O) && cd $(O) >/dev/null && pwd)
140 $(if $(BASE_DIR),, $(error output directory "$(O)" does not exist))
143 # Handling of BR2_EXTERNAL.
145 # The value of BR2_EXTERNAL is stored in .br-external in the output directory.
146 # On subsequent invocations of make, it is read in. It can still be overridden
147 # on the command line, therefore the file is re-created every time make is run.
149 # When BR2_EXTERNAL is set to an empty value (e.g. explicitly in command
150 # line), the .br-external file is removed.
152 BR2_EXTERNAL_FILE = $(BASE_DIR)/.br-external
153 -include $(BR2_EXTERNAL_FILE)
154 ifeq ($(BR2_EXTERNAL),)
155 $(shell rm -f $(BR2_EXTERNAL_FILE))
156 else
157 _BR2_EXTERNAL = $(shell cd $(BR2_EXTERNAL) >/dev/null 2>&1 && pwd)
158 ifeq ($(_BR2_EXTERNAL),)
159 $(error BR2_EXTERNAL='$(BR2_EXTERNAL)' does not exist, relative to $(TOPDIR))
160 endif
161 override BR2_EXTERNAL := $(_BR2_EXTERNAL)
162 $(shell echo BR2_EXTERNAL ?= $(BR2_EXTERNAL) > $(BR2_EXTERNAL_FILE))
163 BR2_EXTERNAL_MK = $(BR2_EXTERNAL)/external.mk
164 endif
166 # To make sure that the environment variable overrides the .config option,
167 # set this before including .config.
168 ifneq ($(BR2_DL_DIR),)
169 DL_DIR := $(BR2_DL_DIR)
170 endif
171 ifneq ($(BR2_CCACHE_DIR),)
172 BR_CACHE_DIR := $(BR2_CCACHE_DIR)
173 endif
175 # Need that early, before we scan packages
176 # Avoids doing the $(or...) everytime
177 BR_GRAPH_OUT := $(or $(BR2_GRAPH_OUT),pdf)
179 BUILD_DIR := $(BASE_DIR)/build
180 BINARIES_DIR := $(BASE_DIR)/images
181 TARGET_DIR := $(BASE_DIR)/target
182 # initial definition so that 'make clean' works for most users, even without
183 # .config. HOST_DIR will be overwritten later when .config is included.
184 HOST_DIR := $(BASE_DIR)/host
185 GRAPHS_DIR := $(BASE_DIR)/graphs
187 LEGAL_INFO_DIR = $(BASE_DIR)/legal-info
188 REDIST_SOURCES_DIR_TARGET = $(LEGAL_INFO_DIR)/sources
189 REDIST_SOURCES_DIR_HOST = $(LEGAL_INFO_DIR)/host-sources
190 LICENSE_FILES_DIR_TARGET = $(LEGAL_INFO_DIR)/licenses
191 LICENSE_FILES_DIR_HOST = $(LEGAL_INFO_DIR)/host-licenses
192 LEGAL_MANIFEST_CSV_TARGET = $(LEGAL_INFO_DIR)/manifest.csv
193 LEGAL_MANIFEST_CSV_HOST = $(LEGAL_INFO_DIR)/host-manifest.csv
194 LEGAL_WARNINGS = $(LEGAL_INFO_DIR)/.warnings
195 LEGAL_REPORT = $(LEGAL_INFO_DIR)/README
197 ################################################################################
199 # staging and target directories do NOT list these as
200 # dependencies anywhere else
202 ################################################################################
203 $(BUILD_DIR) $(TARGET_DIR) $(HOST_DIR) $(BINARIES_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST):
204 @mkdir -p $@
206 BR2_CONFIG = $(CONFIG_DIR)/.config
208 # Pull in the user's configuration file
209 ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
210 -include $(BR2_CONFIG)
211 endif
213 # timezone and locale may affect build output
214 ifeq ($(BR2_REPRODUCIBLE),y)
215 export TZ=UTC
216 export LANG=C
217 export LC_ALL=C
218 endif
220 # To put more focus on warnings, be less verbose as default
221 # Use 'make V=1' to see the full commands
222 ifeq ("$(origin V)", "command line")
223 KBUILD_VERBOSE = $(V)
224 endif
225 ifndef KBUILD_VERBOSE
226 KBUILD_VERBOSE = 0
227 endif
229 ifeq ($(KBUILD_VERBOSE),1)
231 ifndef VERBOSE
232 VERBOSE = 1
233 endif
234 export VERBOSE
235 else
236 Q = @
237 endif
239 # kconfig uses CONFIG_SHELL
240 CONFIG_SHELL := $(SHELL)
242 export SHELL CONFIG_SHELL Q KBUILD_VERBOSE
244 ifndef HOSTAR
245 HOSTAR := ar
246 endif
247 ifndef HOSTAS
248 HOSTAS := as
249 endif
250 ifndef HOSTCC
251 HOSTCC := gcc
252 HOSTCC := $(shell which $(HOSTCC) || type -p $(HOSTCC) || echo gcc)
253 endif
254 HOSTCC_NOCCACHE := $(HOSTCC)
255 ifndef HOSTCXX
256 HOSTCXX := g++
257 HOSTCXX := $(shell which $(HOSTCXX) || type -p $(HOSTCXX) || echo g++)
258 endif
259 HOSTCXX_NOCCACHE := $(HOSTCXX)
260 ifndef HOSTCPP
261 HOSTCPP := cpp
262 endif
263 ifndef HOSTLD
264 HOSTLD := ld
265 endif
266 ifndef HOSTLN
267 HOSTLN := ln
268 endif
269 ifndef HOSTNM
270 HOSTNM := nm
271 endif
272 ifndef HOSTOBJCOPY
273 HOSTOBJCOPY := objcopy
274 endif
275 ifndef HOSTRANLIB
276 HOSTRANLIB := ranlib
277 endif
278 HOSTAR := $(shell which $(HOSTAR) || type -p $(HOSTAR) || echo ar)
279 HOSTAS := $(shell which $(HOSTAS) || type -p $(HOSTAS) || echo as)
280 HOSTCPP := $(shell which $(HOSTCPP) || type -p $(HOSTCPP) || echo cpp)
281 HOSTLD := $(shell which $(HOSTLD) || type -p $(HOSTLD) || echo ld)
282 HOSTLN := $(shell which $(HOSTLN) || type -p $(HOSTLN) || echo ln)
283 HOSTNM := $(shell which $(HOSTNM) || type -p $(HOSTNM) || echo nm)
284 HOSTOBJCOPY := $(shell which $(HOSTOBJCOPY) || type -p $(HOSTOBJCOPY) || echo objcopy)
285 HOSTRANLIB := $(shell which $(HOSTRANLIB) || type -p $(HOSTRANLIB) || echo ranlib)
287 export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTLD
288 export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE
290 # Determine the userland we are running on.
292 # Note that, despite its name, we are not interested in the actual
293 # architecture name. This is mostly used to determine whether some
294 # of the binary tools (e.g. pre-built external toolchains) can run
295 # on the current host. So we need to know if the userland we're
296 # running on can actually run those toolchains.
298 # For example, a 64-bit prebuilt toolchain will not run on a 64-bit
299 # kernel if the userland is 32-bit (e.g. in a chroot for example).
301 # So, we extract the first part of the tuple the host gcc was
302 # configured to generate code for; we assume this is our userland.
304 export HOSTARCH := $(shell LC_ALL=C $(HOSTCC_NOCCACHE) -v 2>&1 | \
305 sed -e '/^Target: \([^-]*\).*/!d' \
306 -e 's//\1/' \
307 -e 's/i.86/x86/' \
308 -e 's/sun4u/sparc64/' \
309 -e 's/arm.*/arm/' \
310 -e 's/sa110/arm/' \
311 -e 's/ppc64/powerpc64/' \
312 -e 's/ppc/powerpc/' \
313 -e 's/macppc/powerpc/' \
314 -e 's/sh.*/sh/' )
316 HOSTCC_VERSION := $(shell $(HOSTCC_NOCCACHE) --version | \
317 sed -n -r 's/^.* ([0-9]*)\.([0-9]*)\.([0-9]*)[ ]*.*/\1 \2/p')
319 # For gcc >= 5.x, we only need the major version.
320 ifneq ($(firstword $(HOSTCC_VERSION)),4)
321 HOSTCC_VERSION := $(firstword $(HOSTCC_VERSION))
322 endif
324 # Make sure pkg-config doesn't look outside the buildroot tree
325 HOST_PKG_CONFIG_PATH := $(PKG_CONFIG_PATH)
326 unexport PKG_CONFIG_PATH
327 unexport PKG_CONFIG_SYSROOT_DIR
328 unexport PKG_CONFIG_LIBDIR
330 # Having DESTDIR set in the environment confuses the installation
331 # steps of some packages.
332 unexport DESTDIR
334 # Causes breakage with packages that needs host-ruby
335 unexport RUBYOPT
337 include package/pkg-utils.mk
338 include package/doc-asciidoc.mk
340 ifeq ($(BR2_HAVE_DOT_CONFIG),y)
342 ################################################################################
344 # Hide troublesome environment variables from sub processes
346 ################################################################################
347 unexport CROSS_COMPILE
348 unexport ARCH
349 unexport CC
350 unexport LD
351 unexport AR
352 unexport CXX
353 unexport CPP
354 unexport RANLIB
355 unexport CFLAGS
356 unexport CXXFLAGS
357 unexport GREP_OPTIONS
358 unexport TAR_OPTIONS
359 unexport CONFIG_SITE
360 unexport QMAKESPEC
361 unexport TERMINFO
362 unexport MACHINE
363 unexport O
365 GNU_HOST_NAME := $(shell support/gnuconfig/config.guess)
367 PACKAGES :=
368 PACKAGES_ALL :=
370 # silent mode requested?
371 QUIET := $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),-q)
373 # Strip off the annoying quoting
374 ARCH := $(call qstrip,$(BR2_ARCH))
376 KERNEL_ARCH := $(shell echo "$(ARCH)" | sed -e "s/-.*//" \
377 -e s/i.86/i386/ -e s/sun4u/sparc64/ \
378 -e s/arcle/arc/ \
379 -e s/arceb/arc/ \
380 -e s/arm.*/arm/ -e s/sa110/arm/ \
381 -e s/aarch64.*/arm64/ \
382 -e s/bfin/blackfin/ \
383 -e s/parisc64/parisc/ \
384 -e s/powerpc64.*/powerpc/ \
385 -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
386 -e s/sh.*/sh/ \
387 -e s/microblazeel/microblaze/)
389 ZCAT := $(call qstrip,$(BR2_ZCAT))
390 BZCAT := $(call qstrip,$(BR2_BZCAT))
391 XZCAT := $(call qstrip,$(BR2_XZCAT))
392 TAR_OPTIONS = $(call qstrip,$(BR2_TAR_OPTIONS)) -xf
394 # packages compiled for the host go here
395 HOST_DIR := $(call qstrip,$(BR2_HOST_DIR))
397 # Quotes are needed for spaces and all in the original PATH content.
398 BR_PATH = "$(HOST_DIR)/bin:$(HOST_DIR)/sbin:$(HOST_DIR)/usr/bin:$(HOST_DIR)/usr/sbin:$(PATH)"
400 # Location of a file giving a big fat warning that output/target
401 # should not be used as the root filesystem.
402 TARGET_DIR_WARNING_FILE = $(TARGET_DIR)/THIS_IS_NOT_YOUR_ROOT_FILESYSTEM
404 ifeq ($(BR2_CCACHE),y)
405 CCACHE := $(HOST_DIR)/usr/bin/ccache
406 BR_CACHE_DIR ?= $(call qstrip,$(BR2_CCACHE_DIR))
407 export BR_CACHE_DIR
408 HOSTCC := $(CCACHE) $(HOSTCC)
409 HOSTCXX := $(CCACHE) $(HOSTCXX)
410 else
411 export BR_NO_CCACHE
412 endif
414 # Scripts in support/ or post-build scripts may need to reference
415 # these locations, so export them so it is easier to use
416 export BR2_CONFIG
417 export BR2_REPRODUCIBLE
418 export TARGET_DIR
419 export STAGING_DIR
420 export HOST_DIR
421 export BINARIES_DIR
422 export BASE_DIR
424 ################################################################################
426 # You should probably leave this stuff alone unless you know
427 # what you are doing.
429 ################################################################################
431 all: world
433 # Include legacy before the other things, because package .mk files
434 # may rely on it.
435 include Makefile.legacy
437 include package/Makefile.in
438 include support/dependencies/dependencies.mk
440 include toolchain/*.mk
441 include toolchain/*/*.mk
443 # Include the package override file if one has been provided in the
444 # configuration.
445 PACKAGE_OVERRIDE_FILE = $(call qstrip,$(BR2_PACKAGE_OVERRIDE_FILE))
446 ifneq ($(PACKAGE_OVERRIDE_FILE),)
447 -include $(PACKAGE_OVERRIDE_FILE)
448 endif
450 include $(sort $(wildcard package/*/*.mk))
452 include boot/common.mk
453 include linux/linux.mk
454 include fs/common.mk
456 # Nothing to include if no BR2_EXTERNAL tree in use
457 include $(BR2_EXTERNAL_MK)
459 # Now we are sure we have all the packages scanned and defined. We now
460 # check for each package in the list of enabled packages, that all its
461 # dependencies are indeed enabled.
463 # Only trigger the check for default builds. If the user forces building
464 # a package, even if not enabled in the configuration, we want to accept
465 # it.
467 ifeq ($(MAKECMDGOALS),)
469 define CHECK_ONE_DEPENDENCY
470 ifeq ($$($(2)_TYPE),target)
471 ifeq ($$($(2)_IS_VIRTUAL),)
472 ifneq ($$($$($(2)_KCONFIG_VAR)),y)
473 $$(error $$($(2)_NAME) is in the dependency chain of $$($(1)_NAME) that \
474 has added it to its _DEPENDENCIES variable without selecting it or \
475 depending on it from Config.in)
476 endif
477 endif
478 endif
479 endef
481 $(foreach pkg,$(call UPPERCASE,$(PACKAGES)),\
482 $(foreach dep,$(call UPPERCASE,$($(pkg)_FINAL_ALL_DEPENDENCIES)),\
483 $(eval $(call CHECK_ONE_DEPENDENCY,$(pkg),$(dep))$(sep))))
485 endif
487 dirs: $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
488 $(HOST_DIR) $(BINARIES_DIR)
490 $(BUILD_DIR)/buildroot-config/auto.conf: $(BR2_CONFIG)
491 $(MAKE1) $(EXTRAMAKEARGS) HOSTCC="$(HOSTCC_NOCCACHE)" HOSTCXX="$(HOSTCXX_NOCCACHE)" silentoldconfig
493 prepare: $(BUILD_DIR)/buildroot-config/auto.conf
495 world: target-post-image
497 .PHONY: all world toolchain dirs clean distclean source outputmakefile \
498 legal-info legal-info-prepare legal-info-clean printvars help \
499 list-defconfigs target-finalize target-post-image source-check
501 # Populating the staging with the base directories is handled by the skeleton package
502 $(STAGING_DIR):
503 @mkdir -p $(STAGING_DIR)
504 @ln -snf $(STAGING_DIR) $(BASE_DIR)/staging
506 RSYNC_VCS_EXCLUSIONS = \
507 --exclude .svn --exclude .git --exclude .hg --exclude .bzr \
508 --exclude CVS
510 STRIP_FIND_CMD = find $(TARGET_DIR)
511 ifneq (,$(call qstrip,$(BR2_STRIP_EXCLUDE_DIRS)))
512 STRIP_FIND_CMD += \( $(call finddirclauses,$(TARGET_DIR),$(call qstrip,$(BR2_STRIP_EXCLUDE_DIRS))) \) -prune -o
513 endif
514 STRIP_FIND_CMD += -type f \( -perm /111 -o -name '*.so*' \)
515 # file exclusions:
516 # - libpthread.so: a non-stripped libpthread shared library is needed for
517 # proper debugging of pthread programs using gdb.
518 # - ld.so: a non-stripped dynamic linker library is needed for valgrind
519 # - kernel modules (*.ko): do not function properly when stripped like normal
520 # applications and libraries. Normally kernel modules are already excluded
521 # by the executable permission check above, so the explicit exclusion is only
522 # done for kernel modules with incorrect permissions.
523 STRIP_FIND_CMD += -not \( $(call findfileclauses,libpthread*.so* ld-*.so* *.ko $(call qstrip,$(BR2_STRIP_EXCLUDE_FILES))) \) -print0
525 ifeq ($(BR2_ECLIPSE_REGISTER),y)
526 define TOOLCHAIN_ECLIPSE_REGISTER
527 ./support/scripts/eclipse-register-toolchain `readlink -f $(O)` \
528 $(notdir $(TARGET_CROSS)) $(BR2_ARCH)
529 endef
530 TARGET_FINALIZE_HOOKS += TOOLCHAIN_ECLIPSE_REGISTER
531 endif
533 # Generate locale data. Basically, we call the localedef program
534 # (built by the host-localedef package) for each locale. The input
535 # data comes preferably from the toolchain, or if the toolchain does
536 # not have them (Linaro toolchains), we use the ones available on the
537 # host machine.
538 ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
539 GLIBC_GENERATE_LOCALES = $(call qstrip,$(BR2_GENERATE_LOCALE))
540 ifneq ($(GLIBC_GENERATE_LOCALES),)
541 PACKAGES += host-localedef
543 define GENERATE_GLIBC_LOCALES
544 $(Q)mkdir -p $(TARGET_DIR)/usr/lib/locale/
545 $(Q)for locale in $(GLIBC_GENERATE_LOCALES) ; do \
546 inputfile=`echo $${locale} | cut -f1 -d'.'` ; \
547 charmap=`echo $${locale} | cut -f2 -d'.' -s` ; \
548 if test -z "$${charmap}" ; then \
549 charmap="UTF-8" ; \
550 fi ; \
551 echo "Generating locale $${inputfile}.$${charmap}" ; \
552 I18NPATH=$(STAGING_DIR)/usr/share/i18n:/usr/share/i18n \
553 $(HOST_DIR)/usr/bin/localedef \
554 --prefix=$(TARGET_DIR) \
555 --$(call LOWERCASE,$(BR2_ENDIAN))-endian \
556 -i $${inputfile} -f $${charmap} \
557 $${locale} ; \
558 done
559 endef
560 TARGET_FINALIZE_HOOKS += GENERATE_GLIBC_LOCALES
561 endif
562 endif
564 ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
565 LOCALE_WHITELIST = $(BUILD_DIR)/locales.nopurge
566 LOCALE_NOPURGE = $(call qstrip,$(BR2_ENABLE_LOCALE_WHITELIST))
568 # This piece of junk does the following:
569 # First collect the whitelist in a file.
570 # Then go over all the locale dirs and for each subdir, check if it exists
571 # in the whitelist file. If it doesn't, kill it.
572 # Finally, specifically for X11, regenerate locale.dir from the whitelist.
573 define PURGE_LOCALES
574 rm -f $(LOCALE_WHITELIST)
575 for i in $(LOCALE_NOPURGE) locale-archive; do echo $$i >> $(LOCALE_WHITELIST); done
577 for dir in $(wildcard $(addprefix $(TARGET_DIR),/usr/share/locale /usr/share/X11/locale /usr/lib/locale)); \
578 do \
579 for langdir in $$dir/*; \
580 do \
581 if [ -e "$${langdir}" ]; \
582 then \
583 grep -qx "$${langdir##*/}" $(LOCALE_WHITELIST) || rm -rf $$langdir; \
584 fi \
585 done; \
586 done
587 if [ -d $(TARGET_DIR)/usr/share/X11/locale ]; \
588 then \
589 for lang in $(LOCALE_NOPURGE); \
590 do \
591 if [ -f $(TARGET_DIR)/usr/share/X11/locale/$$lang/XLC_LOCALE ]; \
592 then \
593 echo "$$lang/XLC_LOCALE: $$lang"; \
594 fi \
595 done > $(TARGET_DIR)/usr/share/X11/locale/locale.dir; \
597 endef
598 TARGET_FINALIZE_HOOKS += PURGE_LOCALES
599 endif
601 $(TARGETS_ROOTFS): target-finalize
603 target-finalize: $(PACKAGES)
604 @$(call MESSAGE,"Finalizing target directory")
605 $(foreach hook,$(TARGET_FINALIZE_HOOKS),$($(hook))$(sep))
606 rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/share/aclocal \
607 $(TARGET_DIR)/usr/lib/pkgconfig $(TARGET_DIR)/usr/share/pkgconfig \
608 $(TARGET_DIR)/usr/lib/cmake $(TARGET_DIR)/usr/share/cmake
609 find $(TARGET_DIR)/usr/{lib,share}/ -name '*.cmake' -print0 | xargs -0 rm -f
610 find $(TARGET_DIR)/lib $(TARGET_DIR)/usr/lib $(TARGET_DIR)/usr/libexec \
611 \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
612 ifneq ($(BR2_PACKAGE_GDB),y)
613 rm -rf $(TARGET_DIR)/usr/share/gdb
614 endif
615 ifneq ($(BR2_PACKAGE_BASH),y)
616 rm -rf $(TARGET_DIR)/usr/share/bash-completion
617 endif
618 ifneq ($(BR2_PACKAGE_ZSH),y)
619 rm -rf $(TARGET_DIR)/usr/share/zsh
620 endif
621 rm -rf $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/man
622 rm -rf $(TARGET_DIR)/usr/info $(TARGET_DIR)/usr/share/info
623 rm -rf $(TARGET_DIR)/usr/doc $(TARGET_DIR)/usr/share/doc
624 rm -rf $(TARGET_DIR)/usr/share/gtk-doc
625 -rmdir $(TARGET_DIR)/usr/share 2>/dev/null
626 $(STRIP_FIND_CMD) | xargs -0 $(STRIPCMD) 2>/dev/null || true
628 # See http://sourceware.org/gdb/wiki/FAQ, "GDB does not see any threads
629 # besides the one in which crash occurred; or SIGTRAP kills my program when
630 # I set a breakpoint"
631 ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
632 find $(TARGET_DIR)/lib -type f -name 'libpthread*.so*' | \
633 xargs -r $(STRIPCMD) $(STRIP_STRIP_DEBUG)
634 endif
636 # Valgrind needs ld.so with enough information, so only strip
637 # debugging symbols.
638 find $(TARGET_DIR)/lib -type f -name 'ld-*.so*' | \
639 xargs -r $(STRIPCMD) $(STRIP_STRIP_DEBUG)
640 test -f $(TARGET_DIR)/etc/ld.so.conf && \
641 { echo "ERROR: we shouldn't have a /etc/ld.so.conf file"; exit 1; } || true
642 test -d $(TARGET_DIR)/etc/ld.so.conf.d && \
643 { echo "ERROR: we shouldn't have a /etc/ld.so.conf.d directory"; exit 1; } || true
644 mkdir -p $(TARGET_DIR)/etc
646 echo "NAME=Buildroot"; \
647 echo "VERSION=$(BR2_VERSION_FULL)"; \
648 echo "ID=buildroot"; \
649 echo "VERSION_ID=$(BR2_VERSION)"; \
650 echo "PRETTY_NAME=\"Buildroot $(BR2_VERSION)\"" \
651 ) > $(TARGET_DIR)/etc/os-release
653 @$(foreach d, $(call qstrip,$(BR2_ROOTFS_OVERLAY)), \
654 $(call MESSAGE,"Copying overlay $(d)"); \
655 rsync -a --ignore-times --keep-dirlinks $(RSYNC_VCS_EXCLUSIONS) \
656 --chmod=u=rwX,go=rX --exclude .empty --exclude '*~' \
657 $(d)/ $(TARGET_DIR)$(sep))
659 @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
660 $(call MESSAGE,"Executing post-build script $(s)"); \
661 $(EXTRA_ENV) $(s) $(TARGET_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep))
663 target-post-image: $(TARGETS_ROOTFS) target-finalize
664 @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_IMAGE_SCRIPT)), \
665 $(call MESSAGE,"Executing post-image script $(s)"); \
666 $(EXTRA_ENV) $(s) $(BINARIES_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep))
668 source: $(foreach p,$(PACKAGES),$(p)-all-source)
670 _external-deps: $(foreach p,$(PACKAGES),$(p)-all-external-deps)
671 external-deps:
672 @$(MAKE1) -Bs $(EXTRAMAKEARGS) _external-deps | sort -u
674 # check if download URLs are outdated
675 source-check: $(foreach p,$(PACKAGES),$(p)-all-source-check)
677 legal-info-clean:
678 @rm -fr $(LEGAL_INFO_DIR)
680 legal-info-prepare: $(LEGAL_INFO_DIR)
681 @$(call MESSAGE,"Collecting legal info")
682 @$(call legal-license-file,buildroot,COPYING,COPYING,HOST)
683 @$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,SOURCE SITE,TARGET)
684 @$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,SOURCE SITE,HOST)
685 @$(call legal-manifest,buildroot,$(BR2_VERSION_FULL),GPLv2+,COPYING,not saved,not saved,HOST)
686 @$(call legal-warning,the Buildroot source code has not been saved)
687 @cp $(BR2_CONFIG) $(LEGAL_INFO_DIR)/buildroot.config
689 legal-info: dirs legal-info-clean legal-info-prepare $(foreach p,$(PACKAGES),$(p)-all-legal-info) \
690 $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST)
691 @cat support/legal-info/README.header >>$(LEGAL_REPORT)
692 @if [ -r $(LEGAL_WARNINGS) ]; then \
693 cat support/legal-info/README.warnings-header \
694 $(LEGAL_WARNINGS) >>$(LEGAL_REPORT); \
695 cat $(LEGAL_WARNINGS); fi
696 @rm -f $(LEGAL_WARNINGS)
697 @(cd $(LEGAL_INFO_DIR); \
698 find * -type f -exec sha256sum {} + | LC_ALL=C sort -k2 \
699 >.legal-info.sha256; \
700 mv .legal-info.sha256 legal-info.sha256)
701 @echo "Legal info produced in $(LEGAL_INFO_DIR)"
703 show-targets:
704 @echo $(PACKAGES) $(TARGETS_ROOTFS)
706 graph-build: $(O)/build/build-time.log
707 @install -d $(GRAPHS_DIR)
708 $(foreach o,name build duration,./support/scripts/graph-build-time \
709 --type=histogram --order=$(o) --input=$(<) \
710 --output=$(GRAPHS_DIR)/build.hist-$(o).$(BR_GRAPH_OUT) \
711 $(if $(BR2_GRAPH_ALT),--alternate-colors)$(sep))
712 $(foreach t,packages steps,./support/scripts/graph-build-time \
713 --type=pie-$(t) --input=$(<) \
714 --output=$(GRAPHS_DIR)/build.pie-$(t).$(BR_GRAPH_OUT) \
715 $(if $(BR2_GRAPH_ALT),--alternate-colors)$(sep))
717 graph-depends-requirements:
718 @dot -? >/dev/null 2>&1 || \
719 { echo "ERROR: The 'dot' program from Graphviz is needed for graph-depends" >&2; exit 1; }
721 graph-depends: graph-depends-requirements
722 @$(INSTALL) -d $(GRAPHS_DIR)
723 @cd "$(CONFIG_DIR)"; \
724 $(TOPDIR)/support/scripts/graph-depends $(BR2_GRAPH_DEPS_OPTS) \
725 -o $(GRAPHS_DIR)/$(@).dot
726 dot $(BR2_GRAPH_DOT_OPTS) -T$(BR_GRAPH_OUT) \
727 -o $(GRAPHS_DIR)/$(@).$(BR_GRAPH_OUT) \
728 $(GRAPHS_DIR)/$(@).dot
730 graph-size:
731 $(Q)mkdir -p $(GRAPHS_DIR)
732 $(Q)$(TOPDIR)/support/scripts/size-stats --builddir $(BASE_DIR) \
733 --graph $(GRAPHS_DIR)/graph-size.$(BR_GRAPH_OUT) \
734 --file-size-csv $(GRAPHS_DIR)/file-size-stats.csv \
735 --package-size-csv $(GRAPHS_DIR)/package-size-stats.csv
737 check-dependencies:
738 @cd "$(CONFIG_DIR)"; \
739 $(TOPDIR)/support/scripts/graph-depends -C
741 else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
743 all: menuconfig
745 endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
747 # configuration
748 # ---------------------------------------------------------------------------
750 HOSTCFLAGS = $(CFLAGS_FOR_BUILD)
751 export HOSTCFLAGS
753 .PHONY: prepare-kconfig
754 prepare-kconfig: outputmakefile $(BUILD_DIR)/.br2-external.in
756 $(BUILD_DIR)/buildroot-config/%onf:
757 mkdir -p $(@D)/lxdialog
758 PKG_CONFIG_PATH="$(HOST_PKG_CONFIG_PATH)" $(MAKE) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" \
759 obj=$(@D) -C $(CONFIG) -f Makefile.br $(@F)
761 DEFCONFIG = $(call qstrip,$(BR2_DEFCONFIG))
763 # We don't want to fully expand BR2_DEFCONFIG here, so Kconfig will
764 # recognize that if it's still at its default $(CONFIG_DIR)/defconfig
765 COMMON_CONFIG_ENV = \
766 BR2_DEFCONFIG='$(call qstrip,$(value BR2_DEFCONFIG))' \
767 KCONFIG_AUTOCONFIG=$(BUILD_DIR)/buildroot-config/auto.conf \
768 KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \
769 KCONFIG_TRISTATE=$(BUILD_DIR)/buildroot-config/tristate.config \
770 BR2_CONFIG=$(BR2_CONFIG) \
771 BR2_EXTERNAL=$(BR2_EXTERNAL) \
772 HOST_GCC_VERSION="$(HOSTCC_VERSION)" \
773 BUILD_DIR=$(BUILD_DIR) \
774 SKIP_LEGACY=
776 xconfig: $(BUILD_DIR)/buildroot-config/qconf prepare-kconfig
777 @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
779 gconfig: $(BUILD_DIR)/buildroot-config/gconf prepare-kconfig
780 @$(COMMON_CONFIG_ENV) srctree=$(TOPDIR) $< $(CONFIG_CONFIG_IN)
782 menuconfig: $(BUILD_DIR)/buildroot-config/mconf prepare-kconfig
783 @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
785 nconfig: $(BUILD_DIR)/buildroot-config/nconf prepare-kconfig
786 @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
788 config: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
789 @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
791 # For the config targets that automatically select options, we pass
792 # SKIP_LEGACY=y to disable the legacy options. However, in that case
793 # no values are set for the legacy options so a subsequent oldconfig
794 # will query them. Therefore, run an additional olddefconfig.
796 oldconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
797 @$(COMMON_CONFIG_ENV) $< --oldconfig $(CONFIG_CONFIG_IN)
799 randconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
800 @$(COMMON_CONFIG_ENV) SKIP_LEGACY=y $< --randconfig $(CONFIG_CONFIG_IN)
801 @$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
803 allyesconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
804 @$(COMMON_CONFIG_ENV) SKIP_LEGACY=y $< --allyesconfig $(CONFIG_CONFIG_IN)
805 @$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
807 allnoconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
808 @$(COMMON_CONFIG_ENV) SKIP_LEGACY=y $< --allnoconfig $(CONFIG_CONFIG_IN)
809 @$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
811 randpackageconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
812 @grep -v BR2_PACKAGE_ $(BR2_CONFIG) > $(CONFIG_DIR)/.config.nopkg
813 @$(COMMON_CONFIG_ENV) SKIP_LEGACY=y \
814 KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
815 $< --randconfig $(CONFIG_CONFIG_IN)
816 @rm -f $(CONFIG_DIR)/.config.nopkg
817 @$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
819 allyespackageconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
820 @grep -v BR2_PACKAGE_ $(BR2_CONFIG) > $(CONFIG_DIR)/.config.nopkg
821 @$(COMMON_CONFIG_ENV) SKIP_LEGACY=y \
822 KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
823 $< --allyesconfig $(CONFIG_CONFIG_IN)
824 @rm -f $(CONFIG_DIR)/.config.nopkg
825 @$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
827 allnopackageconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
828 @grep -v BR2_PACKAGE_ $(BR2_CONFIG) > $(CONFIG_DIR)/.config.nopkg
829 @$(COMMON_CONFIG_ENV) SKIP_LEGACY=y \
830 KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
831 $< --allnoconfig $(CONFIG_CONFIG_IN)
832 @rm -f $(CONFIG_DIR)/.config.nopkg
833 @$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
835 silentoldconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
836 $(COMMON_CONFIG_ENV) $< --silentoldconfig $(CONFIG_CONFIG_IN)
838 olddefconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
839 $(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN)
841 defconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
842 @$(COMMON_CONFIG_ENV) $< --defconfig$(if $(DEFCONFIG),=$(DEFCONFIG)) $(CONFIG_CONFIG_IN)
844 define percent_defconfig
845 # Override the BR2_DEFCONFIG from COMMON_CONFIG_ENV with the new defconfig
846 %_defconfig: $(BUILD_DIR)/buildroot-config/conf $(1)/configs/%_defconfig prepare-kconfig
847 @$$(COMMON_CONFIG_ENV) BR2_DEFCONFIG=$(1)/configs/$$@ \
848 $$< --defconfig=$(1)/configs/$$@ $$(CONFIG_CONFIG_IN)
849 endef
850 $(eval $(foreach d,$(TOPDIR) $(BR2_EXTERNAL),$(call percent_defconfig,$(d))$(sep)))
852 savedefconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
853 @$(COMMON_CONFIG_ENV) $< \
854 --savedefconfig=$(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) \
855 $(CONFIG_CONFIG_IN)
856 @$(SED) '/BR2_DEFCONFIG=/d' $(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig)
858 .PHONY: defconfig savedefconfig
860 ################################################################################
862 # Cleanup and misc junk
864 ################################################################################
866 # outputmakefile generates a Makefile in the output directory, if using a
867 # separate output directory. This allows convenient use of make in the
868 # output directory.
869 outputmakefile:
870 ifeq ($(NEED_WRAPPER),y)
871 $(Q)$(TOPDIR)/support/scripts/mkmakefile $(TOPDIR) $(O)
872 endif
874 # Even though the target is a real file, we mark it as PHONY as we
875 # want it to be re-generated each time make is invoked, in case the
876 # value of BR2_EXTERNAL is changed.
877 .PHONY: $(BUILD_DIR)/.br2-external.in
878 $(BUILD_DIR)/.br2-external.in: $(BUILD_DIR)
879 $(Q)support/scripts/br2-external -o "$(@)" $(BR2_EXTERNAL)
881 # printvars prints all the variables currently defined in our
882 # Makefiles. Alternatively, if a non-empty VARS variable is passed,
883 # only the variables matching the make pattern passed in VARS are
884 # displayed.
885 printvars:
886 @$(foreach V, \
887 $(sort $(if $(VARS),$(filter $(VARS),$(.VARIABLES)),$(.VARIABLES))), \
888 $(if $(filter-out environment% default automatic, \
889 $(origin $V)), \
890 $(info $V=$($V) ($(value $V)))))
892 clean:
893 rm -rf $(TARGET_DIR) $(BINARIES_DIR) $(HOST_DIR) \
894 $(BUILD_DIR) $(BASE_DIR)/staging \
895 $(LEGAL_INFO_DIR) $(GRAPHS_DIR)
897 distclean: clean
898 ifeq ($(O),output)
899 rm -rf $(O)
900 endif
901 rm -rf $(TOPDIR)/dl $(BR2_CONFIG) $(CONFIG_DIR)/.config.old $(CONFIG_DIR)/..config.tmp \
902 $(CONFIG_DIR)/.auto.deps $(BR2_EXTERNAL_FILE)
904 help:
905 @echo 'Cleaning:'
906 @echo ' clean - delete all files created by build'
907 @echo ' distclean - delete all non-source files (including .config)'
908 @echo
909 @echo 'Build:'
910 @echo ' all - make world'
911 @echo ' toolchain - build toolchain'
912 @echo
913 @echo 'Configuration:'
914 @echo ' menuconfig - interactive curses-based configurator'
915 @echo ' nconfig - interactive ncurses-based configurator'
916 @echo ' xconfig - interactive Qt-based configurator'
917 @echo ' gconfig - interactive GTK-based configurator'
918 @echo ' oldconfig - resolve any unresolved symbols in .config'
919 @echo ' silentoldconfig - Same as oldconfig, but quietly, additionally update deps'
920 @echo ' olddefconfig - Same as silentoldconfig but sets new symbols to their default value'
921 @echo ' randconfig - New config with random answer to all options'
922 @echo ' defconfig - New config with default answer to all options'
923 @echo ' BR2_DEFCONFIG, if set, is used as input'
924 @echo ' savedefconfig - Save current config to BR2_DEFCONFIG (minimal config)'
925 @echo ' allyesconfig - New config where all options are accepted with yes'
926 @echo ' allnoconfig - New config where all options are answered with no'
927 @echo ' randpackageconfig - New config with random answer to package options'
928 @echo ' allyespackageconfig - New config where pkg options are accepted with yes'
929 @echo ' allnopackageconfig - New config where package options are answered with no'
930 @echo
931 @echo 'Package-specific:'
932 @echo ' <pkg> - Build and install <pkg> and all its dependencies'
933 @echo ' <pkg>-source - Only download the source files for <pkg>'
934 @echo ' <pkg>-extract - Extract <pkg> sources'
935 @echo ' <pkg>-patch - Apply patches to <pkg>'
936 @echo ' <pkg>-depends - Build <pkg>'\''s dependencies'
937 @echo ' <pkg>-configure - Build <pkg> up to the configure step'
938 @echo ' <pkg>-build - Build <pkg> up to the build step'
939 @echo ' <pkg>-graph-depends - Generate a graph of <pkg>'\''s dependencies'
940 @echo ' <pkg>-dirclean - Remove <pkg> build directory'
941 @echo ' <pkg>-reconfigure - Restart the build from the configure step'
942 @echo ' <pkg>-rebuild - Restart the build from the build step'
943 $(foreach p,$(HELP_PACKAGES), \
944 @echo $(sep) \
945 @echo '$($(p)_NAME):' $(sep) \
946 $($(p)_HELP_CMDS)$(sep))
947 @echo
948 @echo 'Documentation:'
949 @echo ' manual - build manual in all formats'
950 @echo ' manual-html - build manual in HTML'
951 @echo ' manual-split-html - build manual in split HTML'
952 @echo ' manual-pdf - build manual in PDF'
953 @echo ' manual-text - build manual in text'
954 @echo ' manual-epub - build manual in ePub'
955 @echo ' graph-build - generate graphs of the build times'
956 @echo ' graph-depends - generate graph of the dependency tree'
957 @echo ' graph-size - generate stats of the filesystem size'
958 @echo ' list-defconfigs - list all defconfigs (pre-configured minimal systems)'
959 @echo
960 @echo 'Miscellaneous:'
961 @echo ' source - download all sources needed for offline-build'
962 @echo ' source-check - check selected packages for valid download URLs'
963 @echo ' external-deps - list external packages used'
964 @echo ' legal-info - generate info about license compliance'
965 @echo
966 @echo ' make V=0|1 - 0 => quiet build (default), 1 => verbose build'
967 @echo ' make O=dir - Locate all output files in "dir", including .config'
968 @echo
969 @echo 'For further details, see README, generate the Buildroot manual, or consult'
970 @echo 'it on-line at http://buildroot.org/docs.html'
971 @echo
973 list-defconfigs:
974 @echo 'Built-in configs:'
975 @$(foreach b, $(sort $(notdir $(wildcard $(TOPDIR)/configs/*_defconfig))), \
976 printf " %-35s - Build for %s\\n" $(b) $(b:_defconfig=);)
977 ifneq ($(wildcard $(BR2_EXTERNAL)/configs/*_defconfig),)
978 @echo
979 @echo 'User-provided configs:'
980 @$(foreach b, $(sort $(notdir $(wildcard $(BR2_EXTERNAL)/configs/*_defconfig))), \
981 printf " %-35s - Build for %s\\n" $(b) $(b:_defconfig=);)
982 endif
983 @echo
985 release: OUT = buildroot-$(BR2_VERSION)
987 # Create release tarballs. We need to fiddle a bit to add the generated
988 # documentation to the git output
989 release:
990 git archive --format=tar --prefix=$(OUT)/ HEAD > $(OUT).tar
991 $(MAKE) O=$(OUT) manual-html manual-text manual-pdf
992 $(MAKE) O=$(OUT) manual-clean
993 tar rf $(OUT).tar $(OUT)
994 gzip -9 -c < $(OUT).tar > $(OUT).tar.gz
995 bzip2 -9 -c < $(OUT).tar > $(OUT).tar.bz2
996 rm -rf $(OUT) $(OUT).tar
998 print-version:
999 @echo $(BR2_VERSION_FULL)
1001 include docs/manual/manual.mk
1002 -include $(BR2_EXTERNAL)/docs/*/*.mk
1004 .PHONY: $(noconfig_targets)
1006 endif #umask