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