]> Git Repo - buildroot-mgba.git/blame - Makefile
busybox: add 1.16.0 fixes
[buildroot-mgba.git] / Makefile
CommitLineData
2d523c23 1# Makefile for buildroot2
ffde94bd 2#
15b26aee 3# Copyright (C) 1999-2005 by Erik Andersen <[email protected]>
2671be4d 4# Copyright (C) 2006-2009 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#--------------------------------------------------------------
6b1dd45b
PK
25# absolute path
26TOPDIR:=$(shell pwd)
18d979c7
BRF
27CONFIG_CONFIG_IN=Config.in
28CONFIG_DEFCONFIG=.defconfig
29CONFIG=package/config
a8ee1240 30DATE:=$(shell date +%Y%m%d)
a0aef7c4 31
b0df9df3 32noconfig_targets:=menuconfig xconfig config oldconfig randconfig \
c48bbb8c 33 defconfig allyesconfig allnoconfig release \
6652770f 34 randpackageconfig allyespackageconfig allnopackageconfig \
e491fba2 35 source-check help
9e250356 36
580c6d9b
TP
37# Strip quotes and then whitespaces
38qstrip=$(strip $(subst ",,$(1)))
39#"))
40
f85f2de1
PK
41# Variables for use in Make constructs
42comma:=,
43empty:=
44space:=$(empty) $(empty)
45
a1b0651a
US
46# $(shell find . -name *_defconfig |sed 's/.*\///')
47# Pull in the user's configuration file
48ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
d45f355d 49-include .config
7521f373 50endif
9741a49e 51
efd8576c
US
52# Override BR2_DL_DIR if shell variable defined
53ifneq ($(BUILDROOT_DL_DIR),)
54BR2_DL_DIR:=$(BUILDROOT_DL_DIR)
55endif
efd8576c 56
afc61c6e
BRF
57# To put more focus on warnings, be less verbose as default
58# Use 'make V=1' to see the full commands
59ifdef V
60 ifeq ("$(origin V)", "command line")
18d979c7 61 KBUILD_VERBOSE=$(V)
afc61c6e
BRF
62 endif
63endif
64ifndef KBUILD_VERBOSE
18d979c7 65 KBUILD_VERBOSE=0
afc61c6e
BRF
66endif
67
68ifeq ($(KBUILD_VERBOSE),1)
4df454e9 69 quiet=
18d979c7 70 Q=
1669b6ed
BRF
71ifndef VERBOSE
72 VERBOSE=1
73endif
afc61c6e
BRF
74else
75 quiet=quiet_
18d979c7 76 Q=@
afc61c6e
BRF
77endif
78
69f85924
PK
79# we want bash as shell
80SHELL:=$(shell if [ -x "$$BASH" ]; then echo $$BASH; \
afc61c6e 81 else if [ -x /bin/bash ]; then echo /bin/bash; \
18d979c7 82 else echo sh; fi; fi)
afc61c6e 83
69f85924
PK
84# kconfig uses CONFIG_SHELL
85CONFIG_SHELL:=$(SHELL)
86
87export SHELL CONFIG_SHELL quiet Q KBUILD_VERBOSE VERBOSE
afc61c6e
BRF
88
89ifndef HOSTAR
90HOSTAR:=ar
91endif
92ifndef HOSTAS
93HOSTAS:=as
94endif
95ifndef HOSTCC
96HOSTCC:=gcc
97else
98endif
99ifndef HOSTCXX
100HOSTCXX:=g++
101endif
5f97580e
BRF
102ifndef HOSTFC
103HOSTFC:=gfortran
104endif
356133b4
US
105ifndef HOSTCPP
106HOSTCPP:=cpp
107endif
afc61c6e
BRF
108ifndef HOSTLD
109HOSTLD:=ld
110endif
0f9c5b11
US
111ifndef HOSTLN
112HOSTLN:=ln
113endif
356133b4
US
114ifndef HOSTNM
115HOSTNM:=nm
116endif
69f85924
PK
117HOSTAR:=$(shell which $(HOSTAR) || type -p $(HOSTAR) || echo ar)
118HOSTAS:=$(shell which $(HOSTAS) || type -p $(HOSTAS) || echo as)
119HOSTCC:=$(shell which $(HOSTCC) || type -p $(HOSTCC) || echo gcc)
120HOSTCXX:=$(shell which $(HOSTCXX) || type -p $(HOSTCXX) || echo g++)
121HOSTFC:=$(shell which $(HOSTLD) || type -p $(HOSTLD) || echo || which g77 || type -p g77 || echo gfortran)
122HOSTCPP:=$(shell which $(HOSTCPP) || type -p $(HOSTCPP) || echo cpp)
123HOSTLD:=$(shell which $(HOSTLD) || type -p $(HOSTLD) || echo ld)
124HOSTLN:=$(shell which $(HOSTLN) || type -p $(HOSTLN) || echo ln)
125HOSTNM:=$(shell which $(HOSTNM) || type -p $(HOSTNM) || echo nm)
54e93328 126
afc61c6e 127ifndef CFLAGS_FOR_BUILD
f987b7a5 128CFLAGS_FOR_BUILD:=-g -O2
afc61c6e 129endif
5f97580e
BRF
130ifndef CXXFLAGS_FOR_BUILD
131CXXFLAGS_FOR_BUILD:=-g -O2
132endif
133ifndef FCFLAGS_FOR_BUILD
134FCFLAGS_FOR_BUILD:=-g -O2
135endif
136export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTFC HOSTLD
afc61c6e
BRF
137
138
cfe511b2 139ifeq ($(BR2_HAVE_DOT_CONFIG),y)
54e098e4 140
99cf7293 141# cc-option
18d979c7 142# Usage: cflags-y+=$(call cc-option, -march=winchip-c6, -march=i586)
99cf7293
BRF
143# sets -march=winchip-c6 if supported else falls back to -march=i586
144# without checking the latter.
18d979c7 145cc-option=$(shell if $(TARGET_CC) $(TARGET_CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
99cf7293
BRF
146 > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
147
2c649045
PK
148#############################################################
149#
150# Hide troublesome environment variables from sub processes
151#
152#############################################################
153unexport CROSS_COMPILE
154unexport ARCH
27bc59d4 155
08782ae7
EA
156#############################################################
157#
c6e43c9d 158# Setup the proper filename extensions for the host
08782ae7 159#
7dcbbfbb
BRF
160##############################################################
161ifneq ($(findstring linux,$(BR2_GNU_BUILD_SUFFIX)),)
c6e43c9d
BRF
162HOST_EXEEXT:=
163HOST_LIBEXT:=.a
164HOST_SHREXT:=.so
3096f34d 165endif
7dcbbfbb 166ifneq ($(findstring apple,$(BR2_GNU_BUILD_SUFFIX)),)
c6e43c9d
BRF
167HOST_EXEEXT:=
168HOST_LIBEXT:=.a
169HOST_SHREXT:=.dylib
3096f34d 170endif
7dcbbfbb 171ifneq ($(findstring cygwin,$(BR2_GNU_BUILD_SUFFIX)),)
c6e43c9d
BRF
172HOST_EXEEXT:=.exe
173HOST_LIBEXT:=.lib
174HOST_SHREXT:=.dll
2c279671
PK
175HOST_LOADLIBES="-lcurses -lintl"
176export HOST_LOADLIBES
3096f34d 177endif
7dcbbfbb 178ifneq ($(findstring mingw,$(BR2_GNU_BUILD_SUFFIX)),)
c6e43c9d
BRF
179HOST_EXEEXT:=.exe
180HOST_LIBEXT:=.lib
181HOST_SHREXT:=.dll
3096f34d 182endif
cb7d5b81 183
c6e43c9d 184# The preferred type of libs we build for the target
3096f34d 185ifeq ($(BR2_PREFER_STATIC_LIB),y)
c6e43c9d 186LIBTGTEXT=.a
8027784c 187#PREFERRED_LIB_FLAGS:=--disable-shared --enable-static
3096f34d 188else
c6e43c9d 189LIBTGTEXT=.so
8027784c 190#PREFERRED_LIB_FLAGS:=--disable-static --enable-shared
3096f34d 191endif
8027784c 192PREFERRED_LIB_FLAGS:=--enable-static --enable-shared
ffde94bd 193
6ad07203 194##############################################################
7dcbbfbb
BRF
195#
196# The list of stuff to build for the target toolchain
197# along with the packages to build for the target.
198#
199##############################################################
bc994c53 200ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
3d8919a1 201BASE_TARGETS:=uclibc-configured binutils cross_compiler uclibc-target-utils kernel-headers
7dcbbfbb 202else
51f5f627 203BASE_TARGETS:=uclibc
7dcbbfbb 204endif
acc706b7
BRF
205TARGETS:=
206
89464a96
PK
207# silent mode requested?
208QUIET:=$(if $(findstring s,$(MAKEFLAGS)),-q)
209
397fe5cc
TP
210# Strip off the annoying quoting
211ARCH:=$(call qstrip,$(BR2_ARCH))
212ifeq ($(ARCH),xtensa)
213ARCH:=$(ARCH)_$(call qstrip,$(BR2_xtensa_core_name))
214endif
215WGET:=$(call qstrip,$(BR2_WGET)) $(SPIDER) $(QUIET)
216SVN_CO:=$(call qstrip,$(BR2_SVN_CO)) $(QUIET)
217SVN_UP:=$(call qstrip,$(BR2_SVN_UP)) $(QUIET)
218BZR_CO:=$(call qstrip,$(BR2_BZR_CO)) $(QUIET)
219BZR_UP:=$(call qstrip,$(BR2_BZR_UP)) $(QUIET)
220GIT:=$(call qstrip,$(BR2_GIT)) $(QUIET)
221ZCAT:=$(call qstrip,$(BR2_ZCAT))
222BZCAT:=$(call qstrip,$(BR2_BZCAT))
223TAR_OPTIONS=$(call qstrip,$(BR2_TAR_OPTIONS)) -xf
224
a07d6b9d
TP
225ifneq ("$(origin O)", "command line")
226O:=output
227else
397fe5cc
TP
228# other packages might also support Linux-style out of tree builds
229# with the O=<dir> syntax (E.G. Busybox does). As make automatically
230# forwards command line variable definitions those packages get very
231# confused. Fix this by telling make to not do so
232MAKEOVERRIDES =
233endif
a07d6b9d 234
f7a501e1
PK
235# bash prints the name of the directory on 'cd <dir>' if CDPATH is
236# set, so unset it here to not cause problems. Notice that the export
237# line doesn't affect the environment of $(shell ..) calls, so
238# explictly throw away any output from 'cd' here.
239export CDPATH:=
240BASE_DIR := $(shell mkdir -p $(O) && cd $(O) >/dev/null && pwd)
a07d6b9d 241$(if $(BASE_DIR),, $(error output directory "$(O)" does not exist))
397fe5cc 242
397fe5cc
TP
243DL_DIR=$(call qstrip,$(BR2_DL_DIR))
244ifeq ($(DL_DIR),)
416323e9 245DL_DIR:=$(TOPDIR)/dl
397fe5cc
TP
246endif
247
3b2a803d 248BUILD_DIR:=$(BASE_DIR)/build
1dbe6e33 249
397fe5cc
TP
250GNU_TARGET_SUFFIX:=-$(call qstrip,$(BR2_GNU_TARGET_SUFFIX))
251
252STAGING_DIR:=$(call qstrip,$(BR2_STAGING_DIR))
253
254# packages compiled for the host goes here
3b2a803d 255HOST_DIR:=$(BASE_DIR)/host
397fe5cc
TP
256
257# stamp (dependency) files go here
3b2a803d 258STAMP_DIR:=$(BASE_DIR)/stamps
397fe5cc 259
3b2a803d
TP
260BINARIES_DIR:=$(BASE_DIR)/images
261TARGET_DIR:=$(BASE_DIR)/target
397fe5cc
TP
262
263# define values for prepatched source trees for toolchains
264VENDOR_SITE:=$(call qstrip,$(BR2_VENDOR_SITE))
397fe5cc
TP
265VENDOR_BINUTILS_RELEASE:=$(call qstrip,$(BR2_VENDOR_BINUTILS_RELEASE))
266VENDOR_GCC_RELEASE:=$(call qstrip,$(BR2_VENDOR_GCC_RELEASE))
267VENDOR_UCLIBC_RELEASE:=$(call qstrip,$(BR2_VENDOR_UCLIBC_RELEASE))
397fe5cc
TP
268VENDOR_PATCH_DIR:=$(call qstrip,$(BR2_VENDOR_PATCH_DIR))
269
270BR2_DEPENDS_DIR=$(BUILD_DIR)/buildroot-config
1dbe6e33 271
7dcbbfbb
BRF
272include toolchain/Makefile.in
273include package/Makefile.in
274
275#############################################################
276#
277# You should probably leave this stuff alone unless you know
278# what you are doing.
279#
280#############################################################
281
6547bced 282all: world
ffde94bd 283
2d523c23
EA
284# In this section, we need .config
285include .config.cmd
286
d06645d8
EA
287# We also need the various per-package makefiles, which also add
288# each selected package to TARGETS if that package was selected
289# in the .config file.
bc994c53 290ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
acc706b7 291# avoid pulling in external toolchain which is broken for toplvl parallel builds
57310ec6
BRF
292# Explicit ordering:
293include toolchain/dependencies/dependencies.mk
294include toolchain/binutils/binutils.mk
295include toolchain/ccache/ccache.mk
296include toolchain/elf2flt/elf2flt.mk
297include toolchain/gcc/gcc-uclibc-3.x.mk
298include toolchain/gcc/gcc-uclibc-4.x.mk
299include toolchain/gdb/gdb.mk
300include toolchain/kernel-headers/kernel-headers.mk
301include toolchain/mklibs/mklibs.mk
302include toolchain/sstrip/sstrip.mk
303include toolchain/uClibc/uclibc.mk
acc706b7 304else
d06645d8 305include toolchain/*/*.mk
acc706b7
BRF
306endif
307
62b5ae4b
SH
308ifeq ($(BR2_PACKAGE_LINUX),y)
309TARGETS+=linux26-modules
310endif
acc706b7 311
d06645d8 312include package/*/*.mk
d06645d8 313
32faf351 314TARGETS+=target-finalize
d45de0ca 315
b87b4742
PK
316ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
317TARGETS+=target-purgelocales
318endif
319
79f5f1e8
EA
320# target stuff is last so it can override anything else
321include target/Makefile.in
322
02a623dd 323TARGETS+=erase-fakeroots
c2fc93bc 324
08782ae7 325TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
3b08e64d 326TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS) $(BASE_TARGETS))
08782ae7 327TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS))
b3efde23 328TARGETS_ALL:=$(patsubst %,__real_tgt_%,$(TARGETS))
acc706b7 329# all targets depend on the crosscompiler and it's prerequisites
b3efde23 330$(TARGETS_ALL): __real_tgt_%: $(BASE_TARGETS) %
acc706b7 331
1dbe6e33
BRF
332$(BR2_DEPENDS_DIR): .config
333 rm -rf $@
b3efde23 334 mkdir -p $(@D)
1dbe6e33
BRF
335 cp -dpRf $(CONFIG)/buildroot-config $@
336
cb5710c5 337dirs: $(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
397fe5cc 338 $(HOST_DIR) $(BR2_DEPENDS_DIR) $(BINARIES_DIR) $(STAMP_DIR)
f958d897 339
5ef9e52b 340$(BASE_TARGETS): dirs
f958d897 341
397fe5cc 342world: dependencies dirs $(BASE_TARGETS) $(TARGETS_ALL)
ffde94bd 343
5ef9e52b 344
406053d5 345.PHONY: all world dirs clean distclean source \
b3efde23 346 $(BASE_TARGETS) $(TARGETS) $(TARGETS_ALL) \
747b16dd 347 $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) \
cb5710c5 348 $(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
397fe5cc 349 $(HOST_DIR) $(BR2_DEPENDS_DIR) $(BINARIES_DIR) $(STAMP_DIR)
ffde94bd 350
08782ae7
EA
351#############################################################
352#
ef407d3d 353# staging and target directories do NOT list these as
d99c31c6 354# dependencies anywhere else
08782ae7
EA
355#
356#############################################################
cb5710c5 357$(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR):
8d583fc0 358 @mkdir -p $@
3ad3d8a1 359
08782ae7 360$(STAGING_DIR):
9c865d75 361 @mkdir -p $(STAGING_DIR)/bin
bf38723f 362 @mkdir -p $(STAGING_DIR)/lib
7e0c890c 363ifeq ($(BR2_TOOLCHAIN_SYSROOT),y)
8027784c
BRF
364 @mkdir -p $(STAGING_DIR)/usr/lib
365else
f5905dc9 366ifneq ($(BR2_TOOLCHAIN_EXTERNAL),y)
8027784c
BRF
367 @ln -snf . $(STAGING_DIR)/usr
368 @mkdir -p $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)
3da708e4 369 @ln -snf ../lib $(STAGING_DIR)/usr/lib
8027784c 370 @ln -snf ../lib $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib
f5905dc9 371endif
8027784c
BRF
372endif
373 @mkdir -p $(STAGING_DIR)/usr/include
a05c337d 374 @mkdir -p $(STAGING_DIR)/usr/bin
ffde94bd 375
397fe5cc 376$(BUILD_DIR)/.root:
7547c7eb 377 mkdir -p $(TARGET_DIR)
f0ca4b82
BRF
378 if ! [ -d "$(TARGET_DIR)/bin" ]; then \
379 if [ -d "$(TARGET_SKELETON)" ]; then \
18d979c7 380 cp -fa $(TARGET_SKELETON)/* $(TARGET_DIR)/; \
74cda1e4 381 fi; \
edb5ca9c
MG
382 if [ -d "$(TARGET_SKELETON_PATCH)" ]; then \
383 toolchain/patch-kernel.sh $(TARGET_DIR) $(TARGET_SKELETON_PATCH)/ \*patch\*; \
384 fi; \
18d979c7 385 touch $(STAGING_DIR)/.fakeroot.00000; \
f0ca4b82 386 fi
fc3eb18b 387 -find $(TARGET_DIR) -type d -name CVS -print0 -o -name .svn -print0 | xargs -0 rm -rf
b9656e81 388 -find $(TARGET_DIR) -type f \( -name .empty -o -name '*~' \) -print0 | xargs -0 rm -rf
7547c7eb 389 touch $@
08782ae7 390
397fe5cc 391$(TARGET_DIR): $(BUILD_DIR)/.root
c6771dfb 392
c2fc93bc 393erase-fakeroots:
397fe5cc 394 rm -f $(BUILD_DIR)/.fakeroot*
412ca2a4 395
32faf351 396target-finalize:
d45de0ca
JV
397ifeq ($(BR2_HAVE_DEVFILES),y)
398 ( scripts/copy.sh $(STAGING_DIR) $(TARGET_DIR) )
bc67ca29 399else
926646d9 400 rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/lib/pkgconfig
027aa1d2
WB
401 find $(TARGET_DIR)/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
402 find $(TARGET_DIR)/usr/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
bc67ca29 403endif
32faf351
PK
404ifneq ($(BR2_HAVE_MANPAGES),y)
405 rm -rf $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/man
406endif
407ifneq ($(BR2_HAVE_INFOPAGES),y)
408 rm -rf $(TARGET_DIR)/usr/info $(TARGET_DIR)/usr/share/info
409endif
410 find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIPCMD) 2>/dev/null || true
411 $(TARGET_LDCONFIG) -r $(TARGET_DIR) 2>/dev/null
bc67ca29 412
912ea81a
PK
413 mkdir -p $(TARGET_DIR)/etc
414 echo $(BR2_VERSION)$(shell $(TOPDIR)/scripts/setlocalversion) > \
415 $(TARGET_DIR)/etc/br-version
416
eed7d873
DM
417ifneq ($(BR2_ROOTFS_POST_BUILD_SCRIPT),"")
418 $(BR2_ROOTFS_POST_BUILD_SCRIPT) $(TARGET_DIR)
419endif
420
b87b4742 421ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
397fe5cc 422LOCALE_WHITELIST=$(BUILD_DIR)/locales.nopurge
6cdf2481 423LOCALE_NOPURGE=$(call qstrip,$(BR2_ENABLE_LOCALE_WHITELIST))
b87b4742
PK
424
425target-purgelocales:
426 rm -f $(LOCALE_WHITELIST)
427 for i in $(LOCALE_NOPURGE); do echo $$i >> $(LOCALE_WHITELIST); done
428
429 for dir in $(wildcard $(addprefix $(TARGET_DIR),/usr/share/locale /usr/share/X11/locale /usr/man /usr/share/man)); \
430 do \
431 for lang in $$(cd $$dir; ls .|grep -v man); \
432 do \
433 grep -qx $$lang $(LOCALE_WHITELIST) || rm -rf $$dir/$$lang; \
434 done; \
435 done
436endif
437
3b08e64d 438source: $(TARGETS_SOURCE) $(HOST_SOURCE)
08782ae7 439
6547bced 440_source-check:
e7c08c29 441 $(MAKE) SPIDER=--spider source
825ff341 442
155971e0 443external-deps:
2ad346ab 444 @$(MAKE) -Bs BR2_WGET=$(TOPDIR)/toolchain/wget-show-external-deps.sh \
bcad6288 445 SPIDER=--spider source
155971e0 446
b5972138 447ifeq ($(BR2_CONFIG_CACHE),y)
97c996d6 448# drop configure cache if configuration is changed
b5972138
PK
449$(BUILD_DIR)/tgt-config.cache: .config
450 rm -f $@
451 touch $@
452
453$(BASE_TARGETS): | $(BUILD_DIR)/tgt-config.cache
454endif
455
cfe511b2 456else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
2d523c23
EA
457
458all: menuconfig
459
460# configuration
461# ---------------------------------------------------------------------------
462
c0d7d4e0
BRF
463HOSTCFLAGS=$(CFLAGS_FOR_BUILD)
464export HOSTCFLAGS
465
2d523c23 466$(CONFIG)/conf:
1dbe6e33 467 @mkdir -p $(CONFIG)/buildroot-config
fb2c8fec 468 $(MAKE) CC="$(HOSTCC)" -C $(CONFIG) conf
18d979c7 469 -@if [ ! -f .config ]; then \
2d523c23
EA
470 cp $(CONFIG_DEFCONFIG) .config; \
471 fi
b0df9df3 472
2d523c23 473$(CONFIG)/mconf:
1dbe6e33 474 @mkdir -p $(CONFIG)/buildroot-config
b0df9df3
AY
475 $(MAKE) CC="$(HOSTCC)" -C $(CONFIG) mconf
476 -@if [ ! -f .config ]; then \
477 cp $(CONFIG_DEFCONFIG) .config; \
478 fi
479
480$(CONFIG)/qconf:
481 @mkdir -p $(CONFIG)/buildroot-config
482 $(MAKE) CC="$(HOSTCC)" -C $(CONFIG) qconf
18d979c7 483 -@if [ ! -f .config ]; then \
2d523c23
EA
484 cp $(CONFIG_DEFCONFIG) .config; \
485 fi
486
b0df9df3
AY
487xconfig: $(CONFIG)/qconf
488 @mkdir -p $(CONFIG)/buildroot-config
489 @if ! KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
490 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
491 $(CONFIG)/qconf $(CONFIG_CONFIG_IN); then \
492 test -f .config.cmd || rm -f .config; \
493 fi
494
2d523c23 495menuconfig: $(CONFIG)/mconf
7b403ada 496 @mkdir -p $(CONFIG)/buildroot-config
153b1bea 497 @if ! KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
62b5ae4b 498 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
153b1bea
BRF
499 $(CONFIG)/mconf $(CONFIG_CONFIG_IN); then \
500 test -f .config.cmd || rm -f .config; \
501 fi
2d523c23
EA
502
503config: $(CONFIG)/conf
7b403ada 504 @mkdir -p $(CONFIG)/buildroot-config
62b5ae4b
SH
505 @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
506 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
f987b7a5 507 $(CONFIG)/conf $(CONFIG_CONFIG_IN)
2d523c23
EA
508
509oldconfig: $(CONFIG)/conf
7b403ada 510 @mkdir -p $(CONFIG)/buildroot-config
62b5ae4b
SH
511 @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
512 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
f987b7a5 513 $(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
2d523c23
EA
514
515randconfig: $(CONFIG)/conf
7b403ada 516 @mkdir -p $(CONFIG)/buildroot-config
62b5ae4b
SH
517 @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
518 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
f987b7a5 519 $(CONFIG)/conf -r $(CONFIG_CONFIG_IN)
2d523c23
EA
520
521allyesconfig: $(CONFIG)/conf
f987b7a5 522 cat $(CONFIG_DEFCONFIG) > .config
7b403ada 523 @mkdir -p $(CONFIG)/buildroot-config
62b5ae4b
SH
524 @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
525 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
f987b7a5 526 $(CONFIG)/conf -y $(CONFIG_CONFIG_IN)
2d523c23
EA
527
528allnoconfig: $(CONFIG)/conf
7b403ada 529 @mkdir -p $(CONFIG)/buildroot-config
62b5ae4b
SH
530 @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
531 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
f987b7a5 532 $(CONFIG)/conf -n $(CONFIG_CONFIG_IN)
2d523c23 533
6652770f
PK
534randpackageconfig: $(CONFIG)/conf
535 @mkdir -p $(CONFIG)/buildroot-config
536 @grep -v BR2_PACKAGE_ .config > .config.nopkg
537 @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
538 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
539 KCONFIG_ALLCONFIG=.config.nopkg \
540 $(CONFIG)/conf -r $(CONFIG_CONFIG_IN)
541 @rm -f .config.nopkg
542
543allyespackageconfig: $(CONFIG)/conf
544 @mkdir -p $(CONFIG)/buildroot-config
545 @grep -v BR2_PACKAGE_ .config > .config.nopkg
546 @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
547 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
548 KCONFIG_ALLCONFIG=.config.nopkg \
549 $(CONFIG)/conf -y $(CONFIG_CONFIG_IN)
550 @rm -f .config.nopkg
551
552allnopackageconfig: $(CONFIG)/conf
553 @mkdir -p $(CONFIG)/buildroot-config
554 @grep -v BR2_PACKAGE_ .config > .config.nopkg
555 @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
556 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
557 KCONFIG_ALLCONFIG=.config.nopkg \
558 $(CONFIG)/conf -n $(CONFIG_CONFIG_IN)
559 @rm -f .config.nopkg
560
2d523c23 561defconfig: $(CONFIG)/conf
7b403ada 562 @mkdir -p $(CONFIG)/buildroot-config
62b5ae4b
SH
563 @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
564 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
f987b7a5 565 $(CONFIG)/conf -d $(CONFIG_CONFIG_IN)
2d523c23 566
6547bced 567# check if download URLs are outdated
825ff341
BRF
568source-check: allyesconfig
569 $(MAKE) _source-check
570
406053d5
PK
571endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
572
2d523c23
EA
573#############################################################
574#
575# Cleanup and misc junk
576#
577#############################################################
578clean:
406053d5
PK
579 rm -rf $(STAGING_DIR) $(TARGET_DIR) $(BINARIES_DIR) $(HOST_DIR) \
580 $(STAMP_DIR) $(BUILD_DIR) $(TOOLCHAIN_DIR)
2d523c23
EA
581
582distclean: clean
406053d5
PK
583ifeq ($(DL_DIR),$(TOPDIR)/dl)
584 rm -rf $(DL_DIR)
585endif
586ifeq ($(O),output)
587 rm -rf $(O)
588endif
589 rm -rf .config .config.old .config.cmd .auto.deps
590 -$(MAKE) -C $(CONFIG) clean
2d523c23 591
260d3b4a 592flush:
397fe5cc 593 rm -f $(BUILD_DIR)/tgt-config.cache
260d3b4a 594
58fd779a
PK
595%_defconfig: $(TOPDIR)/configs/%_defconfig
596 cp $^ .config
597 @$(MAKE) oldconfig
ba2e7e02 598
5459a9c5 599configured: dirs host-sed kernel-headers uclibc-config busybox-config linux26-config
b8f28d65 600
126bb72f
US
601prepatch: gcc-patched binutils-patched gdb-patched uclibc-patched
602
b8f28d65
US
603cross: $(BASE_TARGETS)
604
e491fba2
BRF
605help:
606 @echo 'Cleaning:'
406053d5 607 @echo ' clean - delete all files created by build'
e491fba2
BRF
608 @echo ' distclean - delete all non-source files (including .config)'
609 @echo
610 @echo 'Build:'
611 @echo ' all - make world'
612 @echo
613 @echo 'Configuration:'
614 @echo ' menuconfig - interactive curses-based configurator'
c48bbb8c 615 @echo ' xconfig - interactive Qt-based configurator'
e491fba2 616 @echo ' oldconfig - resolve any unresolved symbols in .config'
c48bbb8c
PK
617 @echo ' randconfig - New config with random answer to all options'
618 @echo ' defconfig - New config with default answer to all options'
619 @echo ' allyesconfig - New config where all options are accepted with yes'
620 @echo ' allnoconfig - New config where all options are answered with no'
6652770f
PK
621 @echo ' randpackageconfig - New config with random answer to package options'
622 @echo ' allyespackageconfig - New config where pkg options are accepted with yes'
623 @echo ' allnopackageconfig - New config where package options are answered with no'
7b2ec610 624 @echo ' configured - make {uclibc/busybox/linux26}-config'
e491fba2
BRF
625 @echo
626 @echo 'Miscellaneous:'
627 @echo ' source - download all sources needed for offline-build'
03380402 628 @echo ' source-check - check all packages for valid download URLs'
155971e0 629 @echo ' external-deps - list external packages used'
13a85e3c 630 @echo ' flush - flush configuration cache'
e491fba2 631 @echo
58fd779a
PK
632 @$(foreach b, $(notdir $(wildcard $(TOPDIR)/configs/*_defconfig)), \
633 printf " %-35s - Build for %s\\n" $(b) $(b:_defconfig=);)
634 @echo
232fa7ee 635 @echo 'See docs/README and docs/buildroot.html for further details'
663dee48 636 @echo
ba2e7e02 637
23ddf460 638release:
e62d2ecd 639 OUT=buildroot-$$(grep -A2 BR2_VERSION $(CONFIG_CONFIG_IN)|grep default|cut -f2 -d\"); \
23ddf460 640 git archive --format=tar --prefix=$$OUT/ master|gzip -9 >$$OUT.tar.gz
e62d2ecd 641
6652770f 642.PHONY: $(noconfig_targets)
50cbb4a1 643
This page took 0.28367 seconds and 4 git commands to generate.