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