1 # Makefile for buildroot2
6 # This program is free software; you can redistribute it and/or modify
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.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
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
21 #--------------------------------------------------------------
22 # Just run 'make menuconfig', configure stuff, then run 'make'.
23 # You shouldn't need to mess with anything beyond this point...
24 #--------------------------------------------------------------
26 # Set and export the version string
27 export BR2_VERSION:=2011.02-git
29 # This top-level Makefile can *not* be executed in parallel
34 CONFIG_CONFIG_IN=Config.in
36 DATE:=$(shell date +%Y%m%d)
38 # Compute the full local version string so packages can use it as-is
39 # Need to export it, so it can be got from environment in children (eg. mconf)
40 export BR2_VERSION_FULL:=$(BR2_VERSION)$(shell $(TOPDIR)/scripts/setlocalversion)
42 noconfig_targets:=menuconfig nconfig gconfig xconfig config oldconfig randconfig \
43 defconfig %_defconfig savedefconfig allyesconfig allnoconfig silentoldconfig release \
44 randpackageconfig allyespackageconfig allnopackageconfig \
47 # Strip quotes and then whitespaces
48 qstrip=$(strip $(subst ",,$(1)))
51 # Variables for use in Make constructs
54 space:=$(empty) $(empty)
56 ifneq ("$(origin O)", "command line")
61 # other packages might also support Linux-style out of tree builds
62 # with the O=<dir> syntax (E.G. Busybox does). As make automatically
63 # forwards command line variable definitions those packages get very
64 # confused. Fix this by telling make to not do so
66 # strangely enough O is still passed to submakes with MAKEOVERRIDES
67 # (with make 3.81 atleast), the only thing that changes is the output
68 # of the origin function (command line -> environment).
69 # Unfortunately some packages don't look at origin (E.G. uClibc 0.9.31+)
70 # To really make O go away, we have to override it.
73 # we need to pass O= everywhere we call back into the toplevel makefile
74 EXTRAMAKEARGS = O=$(O)
78 # Pull in the user's configuration file
79 ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
80 -include $(CONFIG_DIR)/.config
83 # Override BR2_DL_DIR if shell variable defined
84 ifneq ($(BUILDROOT_DL_DIR),)
85 BR2_DL_DIR:=$(BUILDROOT_DL_DIR)
88 # To put more focus on warnings, be less verbose as default
89 # Use 'make V=1' to see the full commands
91 ifeq ("$(origin V)", "command line")
99 ifeq ($(KBUILD_VERBOSE),1)
110 # we want bash as shell
111 SHELL:=$(shell if [ -x "$$BASH" ]; then echo $$BASH; \
112 else if [ -x /bin/bash ]; then echo /bin/bash; \
113 else echo sh; fi; fi)
115 # kconfig uses CONFIG_SHELL
116 CONFIG_SHELL:=$(SHELL)
118 export SHELL CONFIG_SHELL quiet Q KBUILD_VERBOSE VERBOSE
128 HOSTCC:=$(shell which $(HOSTCC) || type -p $(HOSTCC) || echo gcc)
129 HOSTCC_NOCCACHE:=$(HOSTCC)
133 HOSTCXX:=$(shell which $(HOSTCXX) || type -p $(HOSTCXX) || echo g++)
134 HOSTCXX_NOCCACHE:=$(HOSTCXX)
151 HOSTAR:=$(shell which $(HOSTAR) || type -p $(HOSTAR) || echo ar)
152 HOSTAS:=$(shell which $(HOSTAS) || type -p $(HOSTAS) || echo as)
153 HOSTFC:=$(shell which $(HOSTLD) || type -p $(HOSTLD) || echo || which g77 || type -p g77 || echo gfortran)
154 HOSTCPP:=$(shell which $(HOSTCPP) || type -p $(HOSTCPP) || echo cpp)
155 HOSTLD:=$(shell which $(HOSTLD) || type -p $(HOSTLD) || echo ld)
156 HOSTLN:=$(shell which $(HOSTLN) || type -p $(HOSTLN) || echo ln)
157 HOSTNM:=$(shell which $(HOSTNM) || type -p $(HOSTNM) || echo nm)
159 export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTFC HOSTLD
160 export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE
162 # bash prints the name of the directory on 'cd <dir>' if CDPATH is
163 # set, so unset it here to not cause problems. Notice that the export
164 # line doesn't affect the environment of $(shell ..) calls, so
165 # explictly throw away any output from 'cd' here.
167 BASE_DIR := $(shell mkdir -p $(O) && cd $(O) >/dev/null && pwd)
168 $(if $(BASE_DIR),, $(error output directory "$(O)" does not exist))
170 BUILD_DIR:=$(BASE_DIR)/build
173 ifeq ($(BR2_HAVE_DOT_CONFIG),y)
176 # Usage: cflags-y+=$(call cc-option, -march=winchip-c6, -march=i586)
177 # sets -march=winchip-c6 if supported else falls back to -march=i586
178 # without checking the latter.
179 cc-option=$(shell if $(TARGET_CC) $(TARGET_CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
180 > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
182 #############################################################
184 # Hide troublesome environment variables from sub processes
186 #############################################################
187 unexport CROSS_COMPILE
194 unexport GREP_OPTIONS
196 GNU_HOST_NAME:=$(shell package/gnuconfig/config.guess)
198 #############################################################
200 # Setup the proper filename extensions for the host
202 ##############################################################
203 ifneq ($(findstring linux,$(GNU_HOST_NAME)),)
208 ifneq ($(findstring apple,$(GNU_HOST_NAME)),)
213 ifneq ($(findstring cygwin,$(GNU_HOST_NAME)),)
217 HOST_LOADLIBES="-lcurses -lintl"
218 export HOST_LOADLIBES
220 ifneq ($(findstring mingw,$(GNU_HOST_NAME)),)
226 # The preferred type of libs we build for the target
227 ifeq ($(BR2_PREFER_STATIC_LIB),y)
229 #PREFERRED_LIB_FLAGS:=--disable-shared --enable-static
232 #PREFERRED_LIB_FLAGS:=--disable-static --enable-shared
234 PREFERRED_LIB_FLAGS:=--enable-static --enable-shared
236 ##############################################################
238 # The list of stuff to build for the target toolchain
239 # along with the packages to build for the target.
241 ##############################################################
243 ifeq ($(BR2_CCACHE),y)
244 BASE_TARGETS += host-ccache
247 ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
248 BASE_TARGETS += uclibc-configured host-binutils cross_compiler uclibc-target-utils kernel-headers
250 BASE_TARGETS += uclibc
254 # silent mode requested?
255 QUIET:=$(if $(findstring s,$(MAKEFLAGS)),-q)
257 # Strip off the annoying quoting
258 ARCH:=$(call qstrip,$(BR2_ARCH))
259 ifeq ($(ARCH),xtensa)
260 ARCH:=$(ARCH)_$(call qstrip,$(BR2_xtensa_core_name))
263 KERNEL_ARCH:=$(shell echo "$(ARCH)" | sed -e "s/-.*//" \
264 -e s/i.86/i386/ -e s/sun4u/sparc64/ \
265 -e s/arm.*/arm/ -e s/sa110/arm/ \
266 -e s/parisc64/parisc/ \
267 -e s/powerpc64/powerpc/ \
268 -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
271 ZCAT:=$(call qstrip,$(BR2_ZCAT))
272 BZCAT:=$(call qstrip,$(BR2_BZCAT))
273 TAR_OPTIONS=$(call qstrip,$(BR2_TAR_OPTIONS)) -xf
275 GNU_TARGET_SUFFIX:=-$(call qstrip,$(BR2_GNU_TARGET_SUFFIX))
277 # packages compiled for the host goes here
278 HOST_DIR:=$(BASE_DIR)/host
280 # stamp (dependency) files go here
281 STAMP_DIR:=$(BASE_DIR)/stamps
283 BINARIES_DIR:=$(BASE_DIR)/images
284 TARGET_DIR:=$(BASE_DIR)/target
285 TOOLCHAIN_DIR=$(BASE_DIR)/toolchain
286 TOOLCHAIN_EXTERNAL_DIR=$(BASE_DIR)/external-toolchain
287 TARGET_SKELETON=$(TOPDIR)/fs/skeleton
289 BR2_DEPENDS_DIR=$(BUILD_DIR)/buildroot-config
291 ifeq ($(BR2_CCACHE),y)
292 CCACHE:=$(HOST_DIR)/usr/bin/ccache
293 CCACHE_CACHE_DIR=$(HOME)/.buildroot-ccache
294 HOSTCC := $(CCACHE) $(HOSTCC)
295 HOSTCXX := $(CCACHE) $(HOSTCXX)
298 include toolchain/Makefile.in
299 include package/Makefile.in
301 #############################################################
303 # You should probably leave this stuff alone unless you know
304 # what you are doing.
306 #############################################################
310 # We also need the various per-package makefiles, which also add
311 # each selected package to TARGETS if that package was selected
312 # in the .config file.
313 ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
314 include toolchain/toolchain-buildroot.mk
315 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
316 include toolchain/toolchain-external.mk
317 else ifeq ($(BR2_TOOLCHAIN_CTNG),y)
318 include toolchain/toolchain-crosstool-ng.mk
321 include package/*/*.mk
323 include boot/common.mk
324 include target/Makefile.in
325 include linux/linux.mk
327 TARGETS+=target-finalize
329 ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
330 TARGETS+=target-purgelocales
335 TARGETS+=erase-fakeroots
337 TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
338 TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS) $(BASE_TARGETS))
339 TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS))
340 TARGETS_ALL:=$(patsubst %,__real_tgt_%,$(TARGETS))
342 # host-* dependencies have to be handled specially, as those aren't
343 # visible in Kconfig and hence not added to a variable like TARGETS.
344 # instead, find all the host-* targets listed in each <PKG>_DEPENDENCIES
345 # variable for each enabled target.
346 # Notice: this only works for newstyle gentargets/autotargets packages
347 TARGETS_HOST_DEPS = $(sort $(filter host-%,$(foreach dep,\
348 $(addsuffix _DEPENDENCIES,$(call UPPERCASE,$(TARGETS))),\
350 # Host packages can in turn have their own dependencies. Likewise find
351 # all the package names listed in the HOST_<PKG>_DEPENDENCIES for each
352 # host package found above. Ideally this should be done recursively until
353 # no more packages are found, but that's hard to do in make, so limit to
355 HOST_DEPS = $(sort $(foreach dep,\
356 $(addsuffix _DEPENDENCIES,$(call UPPERCASE,$(TARGETS_HOST_DEPS))),\
358 HOST_SOURCE += $(addsuffix -source,$(sort $(TARGETS_HOST_DEPS) $(HOST_DEPS)))
360 # all targets depend on the crosscompiler and it's prerequisites
361 $(TARGETS_ALL): __real_tgt_%: $(BASE_TARGETS) %
363 dirs: $(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
364 $(HOST_DIR) $(BR2_DEPENDS_DIR) $(BINARIES_DIR) $(STAMP_DIR)
366 $(BASE_TARGETS): dirs
368 $(BUILD_DIR)/buildroot-config/auto.conf: $(CONFIG_DIR)/.config
369 $(MAKE) $(EXTRAMAKEARGS) silentoldconfig
371 prepare: $(BUILD_DIR)/buildroot-config/auto.conf
373 world: prepare dependencies dirs $(BASE_TARGETS) $(TARGETS_ALL)
376 .PHONY: all world dirs clean distclean source outputmakefile \
377 $(BASE_TARGETS) $(TARGETS) $(TARGETS_ALL) \
378 $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) \
379 $(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
380 $(HOST_DIR) $(BR2_DEPENDS_DIR) $(BINARIES_DIR) $(STAMP_DIR)
382 #############################################################
384 # staging and target directories do NOT list these as
385 # dependencies anywhere else
387 #############################################################
388 $(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR):
392 @mkdir -p $(STAGING_DIR)/bin
393 @mkdir -p $(STAGING_DIR)/lib
394 @mkdir -p $(STAGING_DIR)/usr/lib
395 @mkdir -p $(STAGING_DIR)/usr/include
396 @mkdir -p $(STAGING_DIR)/usr/bin
397 @ln -snf $(STAGING_DIR) $(BASE_DIR)/staging
399 ifeq ($(BR2_ROOTFS_SKELETON_CUSTOM),y)
400 TARGET_SKELETON=$(BR2_ROOTFS_SKELETON_CUSTOM_PATH)
404 mkdir -p $(TARGET_DIR)
405 if ! [ -d "$(TARGET_DIR)/bin" ]; then \
406 if [ -d "$(TARGET_SKELETON)" ]; then \
407 cp -fa $(TARGET_SKELETON)/* $(TARGET_DIR)/; \
409 if [ -d "$(TARGET_SKELETON_PATCH)" ]; then \
410 toolchain/patch-kernel.sh $(TARGET_DIR) $(TARGET_SKELETON_PATCH)/ \*patch\*; \
412 touch $(STAGING_DIR)/.fakeroot.00000; \
414 -find $(TARGET_DIR) -type d -name CVS -print0 -o -name .svn -print0 | xargs -0 rm -rf
415 -find $(TARGET_DIR) -type f \( -name .empty -o -name '*~' \) -print0 | xargs -0 rm -rf
418 $(TARGET_DIR): $(BUILD_DIR)/.root
421 rm -f $(BUILD_DIR)/.fakeroot*
424 ifeq ($(BR2_HAVE_DEVFILES),y)
425 ( scripts/copy.sh $(STAGING_DIR) $(TARGET_DIR) )
427 rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/lib/pkgconfig $(TARGET_DIR)/usr/share/aclocal
428 find $(TARGET_DIR)/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
429 find $(TARGET_DIR)/usr/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
431 ifneq ($(BR2_PACKAGE_GDB),y)
432 rm -rf $(TARGET_DIR)/usr/share/gdb
434 ifneq ($(BR2_HAVE_DOCUMENTATION),y)
435 rm -rf $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/man
436 rm -rf $(TARGET_DIR)/usr/info $(TARGET_DIR)/usr/share/info
437 rm -rf $(TARGET_DIR)/usr/doc $(TARGET_DIR)/usr/share/doc
438 rm -rf $(TARGET_DIR)/usr/share/gtk-doc
439 -rmdir $(TARGET_DIR)/usr/share 2>/dev/null
441 find $(TARGET_DIR) -type f -perm +111 '!' -name 'libthread_db*.so*' | \
442 xargs $(STRIPCMD) 2>/dev/null || true
443 find $(TARGET_DIR)/lib/modules -type f -name '*.ko' | \
444 xargs -r $(KSTRIPCMD) || true
446 mkdir -p $(TARGET_DIR)/etc
447 # Mandatory configuration file and auxilliary cache directory
448 # for recent versions of ldconfig
449 touch $(TARGET_DIR)/etc/ld.so.conf
450 mkdir -p $(TARGET_DIR)/var/cache/ldconfig
451 if [ -x "$(TARGET_CROSS)ldconfig" ]; \
453 $(TARGET_CROSS)ldconfig -r $(TARGET_DIR); \
455 /sbin/ldconfig -r $(TARGET_DIR); \
457 echo $(BR2_VERSION_FULL) > $(TARGET_DIR)/etc/br-version
459 ifneq ($(BR2_ROOTFS_POST_BUILD_SCRIPT),"")
460 $(BR2_ROOTFS_POST_BUILD_SCRIPT) $(TARGET_DIR)
463 ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
464 LOCALE_WHITELIST=$(BUILD_DIR)/locales.nopurge
465 LOCALE_NOPURGE=$(call qstrip,$(BR2_ENABLE_LOCALE_WHITELIST))
468 rm -f $(LOCALE_WHITELIST)
469 for i in $(LOCALE_NOPURGE); do echo $$i >> $(LOCALE_WHITELIST); done
471 for dir in $(wildcard $(addprefix $(TARGET_DIR),/usr/share/locale /usr/share/X11/locale /usr/man /usr/share/man)); \
473 for lang in $$(cd $$dir; ls .|grep -v man); \
475 grep -qx $$lang $(LOCALE_WHITELIST) || rm -rf $$dir/$$lang; \
480 source: $(TARGETS_SOURCE) $(HOST_SOURCE)
483 $(MAKE) DL_MODE=SOURCE_CHECK $(EXTRAMAKEARGS) source
486 @$(MAKE) -Bs DL_MODE=SHOW_EXTERNAL_DEPS $(EXTRAMAKEARGS) source | sort -u
491 else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
496 # ---------------------------------------------------------------------------
498 HOSTCFLAGS=$(CFLAGS_FOR_BUILD)
501 $(BUILD_DIR)/buildroot-config/%onf:
502 mkdir -p $(@D)/lxdialog
503 $(MAKE) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" obj=$(@D) -C $(CONFIG) -f Makefile.br $(@F)
505 COMMON_CONFIG_ENV = \
506 KCONFIG_AUTOCONFIG=$(BUILD_DIR)/buildroot-config/auto.conf \
507 KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \
508 KCONFIG_TRISTATE=$(BUILD_DIR)/buildroot-config/tristate.config \
509 BUILDROOT_CONFIG=$(CONFIG_DIR)/.config
511 xconfig: $(BUILD_DIR)/buildroot-config/qconf outputmakefile
512 @mkdir -p $(BUILD_DIR)/buildroot-config
513 @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
515 gconfig: $(BUILD_DIR)/buildroot-config/gconf outputmakefile
516 @mkdir -p $(BUILD_DIR)/buildroot-config
517 @$(COMMON_CONFIG_ENV) srctree=$(TOPDIR) $< $(CONFIG_CONFIG_IN)
519 menuconfig: $(BUILD_DIR)/buildroot-config/mconf outputmakefile
520 @mkdir -p $(BUILD_DIR)/buildroot-config
521 @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
523 nconfig: $(BUILD_DIR)/buildroot-config/nconf outputmakefile
524 @mkdir -p $(BUILD_DIR)/buildroot-config
525 @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
527 config: $(BUILD_DIR)/buildroot-config/conf outputmakefile
528 @mkdir -p $(BUILD_DIR)/buildroot-config
529 @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
531 oldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
532 mkdir -p $(BUILD_DIR)/buildroot-config
533 @$(COMMON_CONFIG_ENV) $< --oldconfig $(CONFIG_CONFIG_IN)
535 randconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
536 @mkdir -p $(BUILD_DIR)/buildroot-config
537 @$(COMMON_CONFIG_ENV) $< --randconfig $(CONFIG_CONFIG_IN)
539 allyesconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
540 @mkdir -p $(BUILD_DIR)/buildroot-config
541 @$(COMMON_CONFIG_ENV) $< --allyesconfig $(CONFIG_CONFIG_IN)
543 allnoconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
544 @mkdir -p $(BUILD_DIR)/buildroot-config
545 @$(COMMON_CONFIG_ENV) $< --allnoconfig $(CONFIG_CONFIG_IN)
547 randpackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
548 @mkdir -p $(BUILD_DIR)/buildroot-config
549 @grep -v BR2_PACKAGE_ $(CONFIG_DIR)/.config > $(CONFIG_DIR)/.config.nopkg
550 @$(COMMON_CONFIG_ENV) \
551 KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
552 $< --randconfig $(CONFIG_CONFIG_IN)
553 @rm -f $(CONFIG_DIR)/.config.nopkg
555 allyespackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
556 @mkdir -p $(BUILD_DIR)/buildroot-config
557 @grep -v BR2_PACKAGE_ $(CONFIG_DIR)/.config > $(CONFIG_DIR)/.config.nopkg
558 @$(COMMON_CONFIG_ENV) \
559 KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
560 $< --allyesconfig $(CONFIG_CONFIG_IN)
561 @rm -f $(CONFIG_DIR)/.config.nopkg
563 allnopackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
564 @mkdir -p $(BUILD_DIR)/buildroot-config
565 @grep -v BR2_PACKAGE_ $(CONFIG_DIR)/.config > $(CONFIG_DIR)/.config.nopkg
566 @$(COMMON_CONFIG_ENV) \
567 KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
568 $< --allnoconfig $(CONFIG_CONFIG_IN)
569 @rm -f $(CONFIG_DIR)/.config.nopkg
571 silentoldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
572 @mkdir -p $(BUILD_DIR)/buildroot-config
573 $(COMMON_CONFIG_ENV) $< --silentoldconfig $(CONFIG_CONFIG_IN)
575 defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
576 @mkdir -p $(BUILD_DIR)/buildroot-config
577 @$(COMMON_CONFIG_ENV) $< --defconfig $(CONFIG_CONFIG_IN)
579 %_defconfig: $(BUILD_DIR)/buildroot-config/conf $(TOPDIR)/configs/%_defconfig outputmakefile
580 @mkdir -p $(BUILD_DIR)/buildroot-config
581 @$(COMMON_CONFIG_ENV) $< --defconfig=$(TOPDIR)/configs/$@ $(CONFIG_CONFIG_IN)
583 savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
584 @mkdir -p $(BUILD_DIR)/buildroot-config
585 @$(COMMON_CONFIG_ENV) $< --savedefconfig=$(TOPDIR)/defconfig $(CONFIG_CONFIG_IN)
587 # check if download URLs are outdated
588 source-check: allyesconfig
589 $(MAKE) $(EXTRAMAKEARGS) _source-check
591 endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
593 #############################################################
595 # Cleanup and misc junk
597 #############################################################
599 # outputmakefile generates a Makefile in the output directory, if using a
600 # separate output directory. This allows convenient use of make in the
603 ifeq ($(NEED_WRAPPER),y)
604 $(Q)$(TOPDIR)/scripts/mkmakefile $(TOPDIR) $(O)
608 rm -rf $(STAGING_DIR) $(TARGET_DIR) $(BINARIES_DIR) $(HOST_DIR) \
609 $(STAMP_DIR) $(BUILD_DIR) $(TOOLCHAIN_DIR) $(BASE_DIR)/staging \
610 $(TOOLCHAIN_EXTERNAL_DIR)
613 ifeq ($(DL_DIR),$(TOPDIR)/dl)
619 rm -rf $(CONFIG_DIR)/.config $(CONFIG_DIR)/.config.old $(CONFIG_DIR)/.auto.deps
621 configured: dirs kernel-headers uclibc-config busybox-config linux26-config
623 prepatch: gcc-patched gdb-patched uclibc-patched
625 cross: $(BASE_TARGETS)
629 @echo ' clean - delete all files created by build'
630 @echo ' distclean - delete all non-source files (including .config)'
633 @echo ' all - make world'
635 @echo 'Configuration:'
636 @echo ' menuconfig - interactive curses-based configurator'
637 @echo ' xconfig - interactive Qt-based configurator'
638 @echo ' gconfig - interactive GTK-based configurator'
639 @echo ' oldconfig - resolve any unresolved symbols in .config'
640 @echo ' randconfig - New config with random answer to all options'
641 @echo ' defconfig - New config with default answer to all options'
642 @echo ' savedefconfig - Save current config as ./defconfig (minimal config)'
643 @echo ' allyesconfig - New config where all options are accepted with yes'
644 @echo ' allnoconfig - New config where all options are answered with no'
645 @echo ' randpackageconfig - New config with random answer to package options'
646 @echo ' allyespackageconfig - New config where pkg options are accepted with yes'
647 @echo ' allnopackageconfig - New config where package options are answered with no'
648 @echo ' configured - make {uclibc/busybox/linux26}-config'
650 @echo 'Miscellaneous:'
651 @echo ' source - download all sources needed for offline-build'
652 @echo ' source-check - check all packages for valid download URLs'
653 @echo ' external-deps - list external packages used'
655 @$(foreach b, $(notdir $(wildcard $(TOPDIR)/configs/*_defconfig)), \
656 printf " %-35s - Build for %s\\n" $(b) $(b:_defconfig=);)
658 @echo 'See docs/README and docs/buildroot.html for further details'
661 release: OUT=buildroot-$(BR2_VERSION)
664 git archive --format=tar --prefix=$(OUT)/ master|gzip -9 >$(OUT).tar.gz
666 .PHONY: $(noconfig_targets)