]> Git Repo - buildroot-mgba.git/blob - Makefile
Makefile: don't depend on current skeleton/overlay permissions
[buildroot-mgba.git] / Makefile
1 # Makefile for buildroot
2 #
3 # Copyright (C) 1999-2005 by Erik Andersen <[email protected]>
4 # Copyright (C) 2006-2014 by the Buildroot developers <[email protected]>
5 # Copyright (C) 2014 by the Buildroot developers <[email protected]>
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 # Trick for always running with a fixed umask
28 UMASK=0022
29 ifneq ($(shell umask),$(UMASK))
30 .PHONY: all $(MAKECMDGOALS)
31
32 all:
33         @umask $(UMASK) && $(MAKE) --no-print-directory
34
35 $(MAKECMDGOALS):
36         @umask $(UMASK) && $(MAKE) --no-print-directory $@
37
38 else # umask
39
40 # This is our default rule, so must come first
41 all:
42
43 # Set and export the version string
44 export BR2_VERSION := 2015.08-git
45
46 # Check for minimal make version (note: this check will break at make 10.x)
47 MIN_MAKE_VERSION = 3.81
48 ifneq ($(firstword $(sort $(MAKE_VERSION) $(MIN_MAKE_VERSION))),$(MIN_MAKE_VERSION))
49 $(error You have make '$(MAKE_VERSION)' installed. GNU make >= $(MIN_MAKE_VERSION) is required)
50 endif
51
52 export HOSTARCH := $(shell uname -m | \
53         sed -e s/i.86/x86/ \
54             -e s/sun4u/sparc64/ \
55             -e s/arm.*/arm/ \
56             -e s/sa110/arm/ \
57             -e s/ppc64/powerpc64/ \
58             -e s/ppc/powerpc/ \
59             -e s/macppc/powerpc/\
60             -e s/sh.*/sh/)
61
62 # Parallel execution of this Makefile is disabled because it changes
63 # the packages building order, that can be a problem for two reasons:
64 # - If a package has an unspecified optional dependency and that
65 #   dependency is present when the package is built, it is used,
66 #   otherwise it isn't (but compilation happily proceeds) so the end
67 #   result will differ if the order is swapped due to parallel
68 #   building.
69 # - Also changing the building order can be a problem if two packages
70 #   manipulate the same file in the target directory.
71 #
72 # Taking into account the above considerations, if you still want to execute
73 # this top-level Makefile in parallel comment the ".NOTPARALLEL" line and
74 # use the -j<jobs> option when building, e.g:
75 #      make -j$((`getconf _NPROCESSORS_ONLN`+1))
76 .NOTPARALLEL:
77
78 # absolute path
79 TOPDIR := $(shell pwd)
80 CONFIG_CONFIG_IN = Config.in
81 CONFIG = support/kconfig
82 DATE := $(shell date +%Y%m%d)
83
84 # Compute the full local version string so packages can use it as-is
85 # Need to export it, so it can be got from environment in children (eg. mconf)
86 export BR2_VERSION_FULL := $(BR2_VERSION)$(shell $(TOPDIR)/support/scripts/setlocalversion)
87
88 noconfig_targets := menuconfig nconfig gconfig xconfig config oldconfig randconfig \
89         defconfig %_defconfig allyesconfig allnoconfig silentoldconfig release \
90         randpackageconfig allyespackageconfig allnopackageconfig \
91         print-version olddefconfig
92
93 # Some global targets do not trigger a build, but are used to collect
94 # metadata, or do various checks. When such targets are triggered,
95 # some packages should not do their configuration sanity
96 # checks. Provide them a BR_BUILDING variable set to 'y' when we're
97 # actually building and they should do their sanity checks.
98 #
99 # We're building in two situations: when MAKECMDGOALS is empty
100 # (default target is to build), or when MAKECMDGOALS contains
101 # something else than one of the nobuild_targets.
102 nobuild_targets := source source-check \
103         legal-info external-deps _external-deps \
104         clean distclean
105 ifeq ($(MAKECMDGOALS),)
106 BR_BUILDING = y
107 else ifneq ($(filter-out $(nobuild_targets),$(MAKECMDGOALS)),)
108 BR_BUILDING = y
109 endif
110
111 # Strip quotes and then whitespaces
112 qstrip = $(strip $(subst ",,$(1)))
113 #"))
114
115 # Variables for use in Make constructs
116 comma := ,
117 empty :=
118 space := $(empty) $(empty)
119
120 ifneq ("$(origin O)", "command line")
121 O := output
122 CONFIG_DIR := $(TOPDIR)
123 NEED_WRAPPER =
124 else
125 # other packages might also support Linux-style out of tree builds
126 # with the O=<dir> syntax (E.G. BusyBox does). As make automatically
127 # forwards command line variable definitions those packages get very
128 # confused. Fix this by telling make to not do so
129 MAKEOVERRIDES =
130 # strangely enough O is still passed to submakes with MAKEOVERRIDES
131 # (with make 3.81 atleast), the only thing that changes is the output
132 # of the origin function (command line -> environment).
133 # Unfortunately some packages don't look at origin (E.G. uClibc 0.9.31+)
134 # To really make O go away, we have to override it.
135 override O := $(O)
136 CONFIG_DIR := $(O)
137 # we need to pass O= everywhere we call back into the toplevel makefile
138 EXTRAMAKEARGS = O=$(O)
139 NEED_WRAPPER = y
140 endif
141
142 # bash prints the name of the directory on 'cd <dir>' if CDPATH is
143 # set, so unset it here to not cause problems. Notice that the export
144 # line doesn't affect the environment of $(shell ..) calls, so
145 # explictly throw away any output from 'cd' here.
146 export CDPATH :=
147 BASE_DIR := $(shell mkdir -p $(O) && cd $(O) >/dev/null && pwd)
148 $(if $(BASE_DIR),, $(error output directory "$(O)" does not exist))
149
150
151 # Handling of BR2_EXTERNAL.
152 #
153 # The value of BR2_EXTERNAL is stored in .br-external in the output directory.
154 # On subsequent invocations of make, it is read in. It can still be overridden
155 # on the command line, therefore the file is re-created every time make is run.
156 #
157 # When BR2_EXTERNAL is set to an empty value (e.g. explicitly in command
158 # line), the .br-external file is removed and we point to
159 # support/dummy-external. This makes sure we can unconditionally include the
160 # Config.in and external.mk from the BR2_EXTERNAL directory. In this case,
161 # override is necessary so the user can clear BR2_EXTERNAL from the command
162 # line, but the dummy path is still used internally.
163
164 BR2_EXTERNAL_FILE = $(BASE_DIR)/.br-external
165 -include $(BR2_EXTERNAL_FILE)
166 ifeq ($(BR2_EXTERNAL),)
167   override BR2_EXTERNAL = support/dummy-external
168   $(shell rm -f $(BR2_EXTERNAL_FILE))
169 else
170   _BR2_EXTERNAL = $(shell cd $(BR2_EXTERNAL) >/dev/null 2>&1 && pwd)
171   ifeq ($(_BR2_EXTERNAL),)
172     $(error BR2_EXTERNAL='$(BR2_EXTERNAL)' does not exist, relative to $(TOPDIR))
173   endif
174   override BR2_EXTERNAL := $(_BR2_EXTERNAL)
175   $(shell echo BR2_EXTERNAL ?= $(BR2_EXTERNAL) > $(BR2_EXTERNAL_FILE))
176 endif
177
178 # To make sure that the environment variable overrides the .config option,
179 # set this before including .config.
180 ifneq ($(BR2_DL_DIR),)
181 DL_DIR := $(BR2_DL_DIR)
182 endif
183
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 # To put more focus on warnings, be less verbose as default
217 # Use 'make V=1' to see the full commands
218 ifeq ("$(origin V)", "command line")
219   KBUILD_VERBOSE = $(V)
220 endif
221 ifndef KBUILD_VERBOSE
222   KBUILD_VERBOSE = 0
223 endif
224
225 ifeq ($(KBUILD_VERBOSE),1)
226   quiet =
227   Q =
228 ifndef VERBOSE
229   VERBOSE = 1
230 endif
231 export VERBOSE
232 else
233   quiet = quiet_
234   Q = @
235 endif
236
237 # we want bash as shell
238 SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
239          else if [ -x /bin/bash ]; then echo /bin/bash; \
240          else echo sh; fi; fi)
241
242 # kconfig uses CONFIG_SHELL
243 CONFIG_SHELL := $(SHELL)
244
245 export SHELL CONFIG_SHELL quiet 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 # Make sure pkg-config doesn't look outside the buildroot tree
294 HOST_PKG_CONFIG_PATH := $(PKG_CONFIG_PATH)
295 unexport PKG_CONFIG_PATH
296 unexport PKG_CONFIG_SYSROOT_DIR
297 unexport PKG_CONFIG_LIBDIR
298
299 # Having DESTDIR set in the environment confuses the installation
300 # steps of some packages.
301 unexport DESTDIR
302
303 # Causes breakage with packages that needs host-ruby
304 unexport RUBYOPT
305
306 include package/pkg-utils.mk
307 include package/doc-asciidoc.mk
308
309 ifeq ($(BR2_HAVE_DOT_CONFIG),y)
310
311 ################################################################################
312 #
313 # Hide troublesome environment variables from sub processes
314 #
315 ################################################################################
316 unexport CROSS_COMPILE
317 unexport ARCH
318 unexport CC
319 unexport CXX
320 unexport CPP
321 unexport CFLAGS
322 unexport CXXFLAGS
323 unexport GREP_OPTIONS
324 unexport TAR_OPTIONS
325 unexport CONFIG_SITE
326 unexport QMAKESPEC
327 unexport TERMINFO
328 unexport MACHINE
329
330 GNU_HOST_NAME := $(shell support/gnuconfig/config.guess)
331
332 PACKAGES :=
333
334 # silent mode requested?
335 QUIET := $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),-q)
336
337 # Strip off the annoying quoting
338 ARCH := $(call qstrip,$(BR2_ARCH))
339
340 KERNEL_ARCH := $(shell echo "$(ARCH)" | sed -e "s/-.*//" \
341         -e s/i.86/i386/ -e s/sun4u/sparc64/ \
342         -e s/arcle/arc/ \
343         -e s/arceb/arc/ \
344         -e s/arm.*/arm/ -e s/sa110/arm/ \
345         -e s/aarch64.*/arm64/ \
346         -e s/bfin/blackfin/ \
347         -e s/parisc64/parisc/ \
348         -e s/powerpc64.*/powerpc/ \
349         -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
350         -e s/sh.*/sh/ \
351         -e s/microblazeel/microblaze/)
352
353 ZCAT := $(call qstrip,$(BR2_ZCAT))
354 BZCAT := $(call qstrip,$(BR2_BZCAT))
355 XZCAT := $(call qstrip,$(BR2_XZCAT))
356 TAR_OPTIONS = $(call qstrip,$(BR2_TAR_OPTIONS)) -xf
357
358 # packages compiled for the host go here
359 HOST_DIR := $(call qstrip,$(BR2_HOST_DIR))
360
361 # Quotes are needed for spaces and all in the original PATH content.
362 BR_PATH = "$(HOST_DIR)/bin:$(HOST_DIR)/sbin:$(HOST_DIR)/usr/bin:$(HOST_DIR)/usr/sbin:$(PATH)"
363
364 TARGET_SKELETON = $(TOPDIR)/system/skeleton
365
366 # Location of a file giving a big fat warning that output/target
367 # should not be used as the root filesystem.
368 TARGET_DIR_WARNING_FILE = $(TARGET_DIR)/THIS_IS_NOT_YOUR_ROOT_FILESYSTEM
369
370 ifeq ($(BR2_CCACHE),y)
371 CCACHE := $(HOST_DIR)/usr/bin/ccache
372 BR_CACHE_DIR = $(call qstrip,$(BR2_CCACHE_DIR))
373 export BR_CACHE_DIR
374 HOSTCC := $(CCACHE) $(HOSTCC)
375 HOSTCXX := $(CCACHE) $(HOSTCXX)
376 endif
377
378 # Scripts in support/ or post-build scripts may need to reference
379 # these locations, so export them so it is easier to use
380 export BR2_CONFIG
381 export TARGET_DIR
382 export STAGING_DIR
383 export HOST_DIR
384 export BINARIES_DIR
385 export BASE_DIR
386
387 ################################################################################
388 #
389 # You should probably leave this stuff alone unless you know
390 # what you are doing.
391 #
392 ################################################################################
393
394 all: world
395
396 # Include legacy before the other things, because package .mk files
397 # may rely on it.
398 ifneq ($(BR2_DEPRECATED),y)
399 include Makefile.legacy
400 endif
401
402 include package/Makefile.in
403 include support/dependencies/dependencies.mk
404
405 include toolchain/*.mk
406 include toolchain/*/*.mk
407
408 # Include the package override file if one has been provided in the
409 # configuration.
410 PACKAGE_OVERRIDE_FILE = $(call qstrip,$(BR2_PACKAGE_OVERRIDE_FILE))
411 ifneq ($(PACKAGE_OVERRIDE_FILE),)
412 -include $(PACKAGE_OVERRIDE_FILE)
413 endif
414
415 include $(sort $(wildcard package/*/*.mk))
416
417 include boot/common.mk
418 include linux/linux.mk
419 include system/system.mk
420 include fs/common.mk
421
422 include $(BR2_EXTERNAL)/external.mk
423
424 dirs: $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
425         $(HOST_DIR) $(BINARIES_DIR)
426
427 $(BUILD_DIR)/buildroot-config/auto.conf: $(BR2_CONFIG)
428         $(MAKE1) $(EXTRAMAKEARGS) HOSTCC="$(HOSTCC_NOCCACHE)" HOSTCXX="$(HOSTCXX_NOCCACHE)" silentoldconfig
429
430 prepare: $(BUILD_DIR)/buildroot-config/auto.conf
431
432 world: target-post-image
433
434 .PHONY: all world toolchain dirs clean distclean source outputmakefile \
435         legal-info legal-info-prepare legal-info-clean printvars help \
436         list-defconfigs target-finalize target-post-image source-check
437
438 ################################################################################
439 #
440 # staging and target directories do NOT list these as
441 # dependencies anywhere else
442 #
443 ################################################################################
444 $(BUILD_DIR) $(HOST_DIR) $(BINARIES_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST):
445         @mkdir -p $@
446
447 # We make a symlink lib32->lib or lib64->lib as appropriate
448 # MIPS64/n32 requires lib32 even though it's a 64-bit arch.
449 ifeq ($(BR2_ARCH_IS_64)$(BR2_MIPS_NABI32),y)
450 LIB_SYMLINK = lib64
451 else
452 LIB_SYMLINK = lib32
453 endif
454
455 $(STAGING_DIR):
456         @mkdir -p $(STAGING_DIR)/bin
457         @mkdir -p $(STAGING_DIR)/lib
458         @ln -snf lib $(STAGING_DIR)/$(LIB_SYMLINK)
459         @mkdir -p $(STAGING_DIR)/usr/lib
460         @ln -snf lib $(STAGING_DIR)/usr/$(LIB_SYMLINK)
461         @mkdir -p $(STAGING_DIR)/usr/include
462         @mkdir -p $(STAGING_DIR)/usr/bin
463         @ln -snf $(STAGING_DIR) $(BASE_DIR)/staging
464
465 ifeq ($(BR2_ROOTFS_SKELETON_CUSTOM),y)
466 TARGET_SKELETON = $(BR2_ROOTFS_SKELETON_CUSTOM_PATH)
467 endif
468
469 RSYNC_VCS_EXCLUSIONS = \
470         --exclude .svn --exclude .git --exclude .hg --exclude .bzr \
471         --exclude CVS
472
473 $(BUILD_DIR)/.root:
474         mkdir -p $(TARGET_DIR)
475         rsync -a --ignore-times $(RSYNC_VCS_EXCLUSIONS) \
476                 --chmod=u=rwX,go=rX --exclude .empty --exclude '*~' \
477                 $(TARGET_SKELETON)/ $(TARGET_DIR)/
478         $(INSTALL) -m 0644 support/misc/target-dir-warning.txt $(TARGET_DIR_WARNING_FILE)
479         @ln -snf lib $(TARGET_DIR)/$(LIB_SYMLINK)
480         @mkdir -p $(TARGET_DIR)/usr
481         @ln -snf lib $(TARGET_DIR)/usr/$(LIB_SYMLINK)
482         touch $@
483
484 $(TARGET_DIR): $(BUILD_DIR)/.root
485
486 STRIP_FIND_CMD = find $(TARGET_DIR)
487 ifneq (,$(call qstrip,$(BR2_STRIP_EXCLUDE_DIRS)))
488 STRIP_FIND_CMD += \( $(call finddirclauses,$(TARGET_DIR),$(call qstrip,$(BR2_STRIP_EXCLUDE_DIRS))) \) -prune -o
489 endif
490 STRIP_FIND_CMD += -type f \( -perm /111 -o -name '*.so*' \)
491 # file exclusions:
492 # - libpthread.so: a non-stripped libpthread shared library is needed for
493 #   proper debugging of pthread programs using gdb.
494 # - kernel modules (*.ko): do not function properly when stripped like normal
495 #   applications and libraries. Normally kernel modules are already excluded
496 #   by the executable permission check above, so the explicit exclusion is only
497 #   done for kernel modules with incorrect permissions.
498 STRIP_FIND_CMD += -not \( $(call findfileclauses,libpthread*.so* *.ko $(call qstrip,$(BR2_STRIP_EXCLUDE_FILES))) \) -print0
499
500 ifeq ($(BR2_ECLIPSE_REGISTER),y)
501 define TOOLCHAIN_ECLIPSE_REGISTER
502         ./support/scripts/eclipse-register-toolchain `readlink -f $(O)` \
503                 $(notdir $(TARGET_CROSS)) $(BR2_ARCH)
504 endef
505 TARGET_FINALIZE_HOOKS += TOOLCHAIN_ECLIPSE_REGISTER
506 endif
507
508 # Generate locale data. Basically, we call the localedef program
509 # (built by the host-localedef package) for each locale. The input
510 # data comes preferably from the toolchain, or if the toolchain does
511 # not have them (Linaro toolchains), we use the ones available on the
512 # host machine.
513 ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
514 GLIBC_GENERATE_LOCALES = $(call qstrip,$(BR2_GENERATE_LOCALE))
515 ifneq ($(GLIBC_GENERATE_LOCALES),)
516 PACKAGES += host-localedef
517
518 define GENERATE_GLIBC_LOCALES
519         $(Q)mkdir -p $(TARGET_DIR)/usr/lib/locale/
520         $(Q)for locale in $(GLIBC_GENERATE_LOCALES) ; do \
521                 inputfile=`echo $${locale} | cut -f1 -d'.'` ; \
522                 charmap=`echo $${locale} | cut -f2 -d'.' -s` ; \
523                 if test -z "$${charmap}" ; then \
524                         charmap="UTF-8" ; \
525                 fi ; \
526                 echo "Generating locale $${inputfile}.$${charmap}" ; \
527                 I18NPATH=$(STAGING_DIR)/usr/share/i18n:/usr/share/i18n \
528                 $(HOST_DIR)/usr/bin/localedef \
529                         --prefix=$(TARGET_DIR) \
530                         --$(call LOWERCASE,$(BR2_ENDIAN))-endian \
531                         -i $${inputfile} -f $${charmap} \
532                         $${locale} ; \
533         done
534 endef
535 TARGET_FINALIZE_HOOKS += GENERATE_GLIBC_LOCALES
536 endif
537 endif
538
539 ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
540 LOCALE_WHITELIST = $(BUILD_DIR)/locales.nopurge
541 LOCALE_NOPURGE = $(call qstrip,$(BR2_ENABLE_LOCALE_WHITELIST))
542
543 define PURGE_LOCALES
544         rm -f $(LOCALE_WHITELIST)
545         for i in $(LOCALE_NOPURGE) locale-archive; do echo $$i >> $(LOCALE_WHITELIST); done
546
547         for dir in $(wildcard $(addprefix $(TARGET_DIR),/usr/share/locale /usr/share/X11/locale /usr/man /usr/share/man /usr/lib/locale)); \
548         do \
549                 for lang in $$(cd $$dir; ls .|grep -v man); \
550                 do \
551                         grep -qx $$lang $(LOCALE_WHITELIST) || rm -rf $$dir/$$lang; \
552                 done; \
553         done
554 endef
555 TARGET_FINALIZE_HOOKS += PURGE_LOCALES
556 endif
557
558 $(TARGETS_ROOTFS): target-finalize
559
560 target-finalize: $(PACKAGES)
561         @$(call MESSAGE,"Finalizing target directory")
562         $(foreach hook,$(TARGET_FINALIZE_HOOKS),$($(hook))$(sep))
563         rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/share/aclocal \
564                 $(TARGET_DIR)/usr/lib/pkgconfig $(TARGET_DIR)/usr/share/pkgconfig \
565                 $(TARGET_DIR)/usr/lib/cmake $(TARGET_DIR)/usr/share/cmake
566         find $(TARGET_DIR)/usr/{lib,share}/ -name '*.cmake' -print0 | xargs -0 rm -f
567         find $(TARGET_DIR)/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
568         find $(TARGET_DIR)/usr/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
569 ifneq ($(BR2_PACKAGE_GDB),y)
570         rm -rf $(TARGET_DIR)/usr/share/gdb
571 endif
572 ifneq ($(BR2_PACKAGE_BASH),y)
573         rm -rf $(TARGET_DIR)/usr/share/bash-completion
574 endif
575 ifneq ($(BR2_PACKAGE_ZSH),y)
576         rm -rf $(TARGET_DIR)/usr/share/zsh
577 endif
578         rm -rf $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/man
579         rm -rf $(TARGET_DIR)/usr/info $(TARGET_DIR)/usr/share/info
580         rm -rf $(TARGET_DIR)/usr/doc $(TARGET_DIR)/usr/share/doc
581         rm -rf $(TARGET_DIR)/usr/share/gtk-doc
582         -rmdir $(TARGET_DIR)/usr/share 2>/dev/null
583         $(STRIP_FIND_CMD) | xargs -0 $(STRIPCMD) 2>/dev/null || true
584         if test -d $(TARGET_DIR)/lib/modules; then \
585                 find $(TARGET_DIR)/lib/modules -type f -name '*.ko' -print0 | \
586                 xargs -0 -r $(KSTRIPCMD); fi
587
588 # See http://sourceware.org/gdb/wiki/FAQ, "GDB does not see any threads
589 # besides the one in which crash occurred; or SIGTRAP kills my program when
590 # I set a breakpoint"
591 ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
592         find $(TARGET_DIR)/lib -type f -name 'libpthread*.so*' | \
593                 xargs -r $(STRIPCMD) $(STRIP_STRIP_DEBUG)
594 endif
595
596         mkdir -p $(TARGET_DIR)/etc
597         # Mandatory configuration file and auxiliary cache directory
598         # for recent versions of ldconfig
599         touch $(TARGET_DIR)/etc/ld.so.conf
600         mkdir -p $(TARGET_DIR)/var/cache/ldconfig
601         if [ -x "$(TARGET_CROSS)ldconfig" ]; \
602         then \
603                 $(TARGET_CROSS)ldconfig -r $(TARGET_DIR) \
604                                         -f $(TARGET_DIR)/etc/ld.so.conf; \
605         else \
606                 /sbin/ldconfig -r $(TARGET_DIR) \
607                                -f $(TARGET_DIR)/etc/ld.so.conf; \
608         fi
609         ( \
610                 echo "NAME=Buildroot"; \
611                 echo "VERSION=$(BR2_VERSION_FULL)"; \
612                 echo "ID=buildroot"; \
613                 echo "VERSION_ID=$(BR2_VERSION)"; \
614                 echo "PRETTY_NAME=\"Buildroot $(BR2_VERSION)\"" \
615         ) >  $(TARGET_DIR)/etc/os-release
616
617         @$(foreach d, $(call qstrip,$(BR2_ROOTFS_OVERLAY)), \
618                 $(call MESSAGE,"Copying overlay $(d)"); \
619                 rsync -a --ignore-times $(RSYNC_VCS_EXCLUSIONS) \
620                         --chmod=u=rwX,go=rX --exclude .empty --exclude '*~' \
621                         $(d)/ $(TARGET_DIR)$(sep))
622
623         @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
624                 $(call MESSAGE,"Executing post-build script $(s)"); \
625                 $(EXTRA_ENV) $(s) $(TARGET_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep))
626
627 target-post-image: $(TARGETS_ROOTFS) target-finalize
628         @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_IMAGE_SCRIPT)), \
629                 $(call MESSAGE,"Executing post-image script $(s)"); \
630                 $(EXTRA_ENV) $(s) $(BINARIES_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep))
631
632 source: $(foreach p,$(PACKAGES),$(p)-all-source)
633
634 _external-deps: $(foreach p,$(PACKAGES),$(p)-all-external-deps)
635 external-deps:
636         @$(MAKE1) -Bs $(EXTRAMAKEARGS) _external-deps | sort -u
637
638 # check if download URLs are outdated
639 source-check: $(foreach p,$(PACKAGES),$(p)-all-source-check)
640
641 legal-info-clean:
642         @rm -fr $(LEGAL_INFO_DIR)
643
644 legal-info-prepare: $(LEGAL_INFO_DIR)
645         @$(call MESSAGE,"Collecting legal info")
646         @$(call legal-license-file,buildroot,COPYING,COPYING,HOST)
647         @$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,SOURCE SITE,TARGET)
648         @$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,SOURCE SITE,HOST)
649         @$(call legal-manifest,buildroot,$(BR2_VERSION_FULL),GPLv2+,COPYING,not saved,not saved,HOST)
650         @$(call legal-warning,the Buildroot source code has not been saved)
651         @$(call legal-warning,the toolchain has not been saved)
652         @cp $(BR2_CONFIG) $(LEGAL_INFO_DIR)/buildroot.config
653
654 legal-info: dirs legal-info-clean legal-info-prepare $(foreach p,$(PACKAGES),$(p)-all-legal-info) \
655                 $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST)
656         @cat support/legal-info/README.header >>$(LEGAL_REPORT)
657         @if [ -r $(LEGAL_WARNINGS) ]; then \
658                 cat support/legal-info/README.warnings-header \
659                         $(LEGAL_WARNINGS) >>$(LEGAL_REPORT); \
660                 cat $(LEGAL_WARNINGS); fi
661         @echo "Legal info produced in $(LEGAL_INFO_DIR)"
662         @rm -f $(LEGAL_WARNINGS)
663
664 show-targets:
665         @echo $(PACKAGES) $(TARGETS_ROOTFS)
666
667 graph-build: $(O)/build/build-time.log
668         @install -d $(GRAPHS_DIR)
669         $(foreach o,name build duration,./support/scripts/graph-build-time \
670                                         --type=histogram --order=$(o) --input=$(<) \
671                                         --output=$(GRAPHS_DIR)/build.hist-$(o).$(BR_GRAPH_OUT) \
672                                         $(if $(BR2_GRAPH_ALT),--alternate-colors)$(sep))
673         $(foreach t,packages steps,./support/scripts/graph-build-time \
674                                    --type=pie-$(t) --input=$(<) \
675                                    --output=$(GRAPHS_DIR)/build.pie-$(t).$(BR_GRAPH_OUT) \
676                                    $(if $(BR2_GRAPH_ALT),--alternate-colors)$(sep))
677
678 graph-depends-requirements:
679         @dot -? >/dev/null 2>&1 || \
680                 { echo "ERROR: The 'dot' program from Graphviz is needed for graph-depends" >&2; exit 1; }
681
682 graph-depends: graph-depends-requirements
683         @$(INSTALL) -d $(GRAPHS_DIR)
684         @cd "$(CONFIG_DIR)"; \
685         $(TOPDIR)/support/scripts/graph-depends $(BR2_GRAPH_DEPS_OPTS) \
686         |tee $(GRAPHS_DIR)/$(@).dot \
687         |dot $(BR2_GRAPH_DOT_OPTS) -T$(BR_GRAPH_OUT) -o $(GRAPHS_DIR)/$(@).$(BR_GRAPH_OUT)
688
689 else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
690
691 all: menuconfig
692
693 endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
694
695 # configuration
696 # ---------------------------------------------------------------------------
697
698 HOSTCFLAGS = $(CFLAGS_FOR_BUILD)
699 export HOSTCFLAGS
700
701 $(BUILD_DIR)/buildroot-config/%onf:
702         mkdir -p $(@D)/lxdialog
703         PKG_CONFIG_PATH="$(HOST_PKG_CONFIG_PATH)" $(MAKE) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" \
704             obj=$(@D) -C $(CONFIG) -f Makefile.br $(@F)
705
706 DEFCONFIG = $(call qstrip,$(BR2_DEFCONFIG))
707
708 # We don't want to fully expand BR2_DEFCONFIG here, so Kconfig will
709 # recognize that if it's still at its default $(CONFIG_DIR)/defconfig
710 COMMON_CONFIG_ENV = \
711         BR2_DEFCONFIG='$(call qstrip,$(value BR2_DEFCONFIG))' \
712         KCONFIG_AUTOCONFIG=$(BUILD_DIR)/buildroot-config/auto.conf \
713         KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \
714         KCONFIG_TRISTATE=$(BUILD_DIR)/buildroot-config/tristate.config \
715         BR2_CONFIG=$(BR2_CONFIG) \
716         BR2_EXTERNAL=$(BR2_EXTERNAL) \
717         SKIP_LEGACY=
718
719 xconfig: $(BUILD_DIR)/buildroot-config/qconf outputmakefile
720         @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
721
722 gconfig: $(BUILD_DIR)/buildroot-config/gconf outputmakefile
723         @$(COMMON_CONFIG_ENV) srctree=$(TOPDIR) $< $(CONFIG_CONFIG_IN)
724
725 menuconfig: $(BUILD_DIR)/buildroot-config/mconf outputmakefile
726         @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
727
728 nconfig: $(BUILD_DIR)/buildroot-config/nconf outputmakefile
729         @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
730
731 config: $(BUILD_DIR)/buildroot-config/conf outputmakefile
732         @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
733
734 # For the config targets that automatically select options, we pass
735 # SKIP_LEGACY=y to disable the legacy options. However, in that case
736 # no values are set for the legacy options so a subsequent oldconfig
737 # will query them. Therefore, run an additional olddefconfig.
738
739 oldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
740         @$(COMMON_CONFIG_ENV) $< --oldconfig $(CONFIG_CONFIG_IN)
741
742 randconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
743         @$(COMMON_CONFIG_ENV) SKIP_LEGACY=y $< --randconfig $(CONFIG_CONFIG_IN)
744         @$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
745
746 allyesconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
747         @$(COMMON_CONFIG_ENV) SKIP_LEGACY=y $< --allyesconfig $(CONFIG_CONFIG_IN)
748         @$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
749
750 allnoconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
751         @$(COMMON_CONFIG_ENV) SKIP_LEGACY=y $< --allnoconfig $(CONFIG_CONFIG_IN)
752         @$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
753
754 randpackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
755         @grep -v BR2_PACKAGE_ $(BR2_CONFIG) > $(CONFIG_DIR)/.config.nopkg
756         @$(COMMON_CONFIG_ENV) SKIP_LEGACY=y \
757                 KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
758                 $< --randconfig $(CONFIG_CONFIG_IN)
759         @rm -f $(CONFIG_DIR)/.config.nopkg
760         @$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
761
762 allyespackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
763         @grep -v BR2_PACKAGE_ $(BR2_CONFIG) > $(CONFIG_DIR)/.config.nopkg
764         @$(COMMON_CONFIG_ENV) SKIP_LEGACY=y \
765                 KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
766                 $< --allyesconfig $(CONFIG_CONFIG_IN)
767         @rm -f $(CONFIG_DIR)/.config.nopkg
768         @$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
769
770 allnopackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
771         @grep -v BR2_PACKAGE_ $(BR2_CONFIG) > $(CONFIG_DIR)/.config.nopkg
772         @$(COMMON_CONFIG_ENV) SKIP_LEGACY=y \
773                 KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
774                 $< --allnoconfig $(CONFIG_CONFIG_IN)
775         @rm -f $(CONFIG_DIR)/.config.nopkg
776         @$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
777
778 silentoldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
779         $(COMMON_CONFIG_ENV) $< --silentoldconfig $(CONFIG_CONFIG_IN)
780
781 olddefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
782         $(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN)
783
784 defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
785         @$(COMMON_CONFIG_ENV) $< --defconfig$(if $(DEFCONFIG),=$(DEFCONFIG)) $(CONFIG_CONFIG_IN)
786
787 # Override the BR2_DEFCONFIG from COMMON_CONFIG_ENV with the new defconfig
788 %_defconfig: $(BUILD_DIR)/buildroot-config/conf $(TOPDIR)/configs/%_defconfig outputmakefile
789         @$(COMMON_CONFIG_ENV) BR2_DEFCONFIG=$(TOPDIR)/configs/$@ \
790                 $< --defconfig=$(TOPDIR)/configs/$@ $(CONFIG_CONFIG_IN)
791
792 %_defconfig: $(BUILD_DIR)/buildroot-config/conf $(BR2_EXTERNAL)/configs/%_defconfig outputmakefile
793         @$(COMMON_CONFIG_ENV) BR2_DEFCONFIG=$(BR2_EXTERNAL)/configs/$@ \
794                 $< --defconfig=$(BR2_EXTERNAL)/configs/$@ $(CONFIG_CONFIG_IN)
795
796 savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
797         @$(COMMON_CONFIG_ENV) $< \
798                 --savedefconfig=$(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) \
799                 $(CONFIG_CONFIG_IN)
800         @$(SED) '/BR2_DEFCONFIG=/d' $(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig)
801
802 .PHONY: defconfig savedefconfig
803
804 ################################################################################
805 #
806 # Cleanup and misc junk
807 #
808 ################################################################################
809
810 # outputmakefile generates a Makefile in the output directory, if using a
811 # separate output directory. This allows convenient use of make in the
812 # output directory.
813 outputmakefile:
814 ifeq ($(NEED_WRAPPER),y)
815         $(Q)$(TOPDIR)/support/scripts/mkmakefile $(TOPDIR) $(O)
816 endif
817
818 # printvars prints all the variables currently defined in our Makefiles
819 printvars:
820         @$(foreach V, \
821                 $(sort $(.VARIABLES)), \
822                 $(if $(filter-out environment% default automatic, \
823                                 $(origin $V)), \
824                 $(info $V=$($V) ($(value $V)))))
825
826 clean:
827         rm -rf $(TARGET_DIR) $(BINARIES_DIR) $(HOST_DIR) \
828                 $(BUILD_DIR) $(BASE_DIR)/staging \
829                 $(LEGAL_INFO_DIR) $(GRAPHS_DIR)
830
831 distclean: clean
832 ifeq ($(DL_DIR),$(TOPDIR)/dl)
833         rm -rf $(DL_DIR)
834 endif
835 ifeq ($(O),output)
836         rm -rf $(O)
837 endif
838         rm -rf $(BR2_CONFIG) $(CONFIG_DIR)/.config.old $(CONFIG_DIR)/..config.tmp \
839                 $(CONFIG_DIR)/.auto.deps
840
841 help:
842         @echo 'Cleaning:'
843         @echo '  clean                  - delete all files created by build'
844         @echo '  distclean              - delete all non-source files (including .config)'
845         @echo
846         @echo 'Build:'
847         @echo '  all                    - make world'
848         @echo '  toolchain              - build toolchain'
849         @echo
850         @echo 'Configuration:'
851         @echo '  menuconfig             - interactive curses-based configurator'
852         @echo '  nconfig                - interactive ncurses-based configurator'
853         @echo '  xconfig                - interactive Qt-based configurator'
854         @echo '  gconfig                - interactive GTK-based configurator'
855         @echo '  oldconfig              - resolve any unresolved symbols in .config'
856         @echo '  silentoldconfig        - Same as oldconfig, but quietly, additionally update deps'
857         @echo '  olddefconfig           - Same as silentoldconfig but sets new symbols to their default value'
858         @echo '  randconfig             - New config with random answer to all options'
859         @echo '  defconfig              - New config with default answer to all options'
860         @echo '                             BR2_DEFCONFIG, if set, is used as input'
861         @echo '  savedefconfig          - Save current config to BR2_DEFCONFIG (minimal config)'
862         @echo '  allyesconfig           - New config where all options are accepted with yes'
863         @echo '  allnoconfig            - New config where all options are answered with no'
864         @echo '  randpackageconfig      - New config with random answer to package options'
865         @echo '  allyespackageconfig    - New config where pkg options are accepted with yes'
866         @echo '  allnopackageconfig     - New config where package options are answered with no'
867         @echo
868         @echo 'Package-specific:'
869         @echo '  <pkg>                  - Build and install <pkg> and all its dependencies'
870         @echo '  <pkg>-source           - Only download the source files for <pkg>'
871         @echo '  <pkg>-extract          - Extract <pkg> sources'
872         @echo '  <pkg>-patch            - Apply patches to <pkg>'
873         @echo '  <pkg>-depends          - Build <pkg>'\''s dependencies'
874         @echo '  <pkg>-configure        - Build <pkg> up to the configure step'
875         @echo '  <pkg>-build            - Build <pkg> up to the build step'
876         @echo '  <pkg>-graph-depends    - Generate a graph of <pkg>'\''s dependencies'
877         @echo '  <pkg>-dirclean         - Remove <pkg> build directory'
878         @echo '  <pkg>-reconfigure      - Restart the build from the configure step'
879         @echo '  <pkg>-rebuild          - Restart the build from the build step'
880         @echo '  <pkg>-legal-info       - Generate license information for <pkg>'
881 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
882         @echo '  busybox-menuconfig     - Run BusyBox menuconfig'
883 endif
884 ifeq ($(BR2_LINUX_KERNEL),y)
885         @echo '  linux-menuconfig       - Run Linux kernel menuconfig'
886         @echo '  linux-savedefconfig    - Run Linux kernel savedefconfig'
887         @echo '  linux-update-defconfig - Save the Linux configuration to the path specified'
888         @echo '                             by BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE'
889 endif
890 ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
891         @echo '  uclibc-menuconfig      - Run uClibc menuconfig'
892 endif
893 ifeq ($(BR2_TARGET_BAREBOX),y)
894         @echo '  barebox-menuconfig     - Run barebox menuconfig'
895         @echo '  barebox-savedefconfig  - Run barebox savedefconfig'
896 endif
897         @echo
898         @echo 'Documentation:'
899         @echo '  manual                 - build manual in all formats'
900         @echo '  manual-html            - build manual in HTML'
901         @echo '  manual-split-html      - build manual in split HTML'
902         @echo '  manual-pdf             - build manual in PDF'
903         @echo '  manual-text            - build manual in text'
904         @echo '  manual-epub            - build manual in ePub'
905         @echo '  graph-build            - generate graphs of the build times'
906         @echo '  graph-depends          - generate graph of the dependency tree'
907         @echo '  list-defconfigs        - list all defconfigs (pre-configured minimal systems)'
908         @echo
909         @echo 'Miscellaneous:'
910         @echo '  source                 - download all sources needed for offline-build'
911         @echo '  source-check           - check selected packages for valid download URLs'
912         @echo '  external-deps          - list external packages used'
913         @echo '  legal-info             - generate info about license compliance'
914         @echo
915         @echo '  make V=0|1             - 0 => quiet build (default), 1 => verbose build'
916         @echo '  make O=dir             - Locate all output files in "dir", including .config'
917         @echo
918         @echo 'For further details, see README, generate the Buildroot manual, or consult'
919         @echo 'it on-line at http://buildroot.org/docs.html'
920         @echo
921
922 list-defconfigs:
923         @echo 'Built-in configs:'
924         @$(foreach b, $(sort $(notdir $(wildcard $(TOPDIR)/configs/*_defconfig))), \
925           printf "  %-35s - Build for %s\\n" $(b) $(b:_defconfig=);)
926 ifneq ($(wildcard $(BR2_EXTERNAL)/configs/*_defconfig),)
927         @echo
928         @echo 'User-provided configs:'
929         @$(foreach b, $(sort $(notdir $(wildcard $(BR2_EXTERNAL)/configs/*_defconfig))), \
930           printf "  %-35s - Build for %s\\n" $(b) $(b:_defconfig=);)
931 endif
932         @echo
933
934 release: OUT = buildroot-$(BR2_VERSION)
935
936 # Create release tarballs. We need to fiddle a bit to add the generated
937 # documentation to the git output
938 release:
939         git archive --format=tar --prefix=$(OUT)/ HEAD > $(OUT).tar
940         $(MAKE) O=$(OUT) manual-html manual-text manual-pdf
941         tar rf $(OUT).tar $(OUT)
942         gzip -9 -c < $(OUT).tar > $(OUT).tar.gz
943         bzip2 -9 -c < $(OUT).tar > $(OUT).tar.bz2
944         rm -rf $(OUT) $(OUT).tar
945
946 print-version:
947         @echo $(BR2_VERSION_FULL)
948
949 include docs/manual/manual.mk
950 -include $(BR2_EXTERNAL)/docs/*/*.mk
951
952 .PHONY: $(noconfig_targets)
953
954 endif #umask
This page took 0.083601 seconds and 4 git commands to generate.