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