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