1 # Makefile for buildroot2
3 # Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
4 # Copyright (C) 2006-2011 by the Buildroot developers <buildroot@uclibc.org>
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.08
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)
130 HOSTCC_NOCCACHE:=$(HOSTCC)
133 HOSTCXX:=$(shell which $(HOSTCXX) || type -p $(HOSTCXX) || echo g++)
135 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 ##############################################################
228 # The list of stuff to build for the target toolchain
229 # along with the packages to build for the target.
231 ##############################################################
233 ifeq ($(BR2_CCACHE),y)
234 BASE_TARGETS += host-ccache
237 ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
238 BASE_TARGETS += uclibc-configured host-binutils cross_compiler uclibc-target-utils kernel-headers
240 BASE_TARGETS += uclibc
244 # silent mode requested?
245 QUIET:=$(if $(findstring s,$(MAKEFLAGS)),-q)
247 # Strip off the annoying quoting
248 ARCH:=$(call qstrip,$(BR2_ARCH))
249 ifeq ($(ARCH),xtensa)
250 ARCH:=$(ARCH)_$(call qstrip,$(BR2_xtensa_core_name))
253 KERNEL_ARCH:=$(shell echo "$(ARCH)" | sed -e "s/-.*//" \
254 -e s/i.86/i386/ -e s/sun4u/sparc64/ \
255 -e s/arm.*/arm/ -e s/sa110/arm/ \
256 -e s/bfin/blackfin/ \
257 -e s/parisc64/parisc/ \
258 -e s/powerpc64/powerpc/ \
259 -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
262 ZCAT:=$(call qstrip,$(BR2_ZCAT))
263 BZCAT:=$(call qstrip,$(BR2_BZCAT))
264 XZCAT:=$(call qstrip,$(BR2_XZCAT))
265 TAR_OPTIONS=$(call qstrip,$(BR2_TAR_OPTIONS)) -xf
267 GNU_TARGET_SUFFIX:=-$(call qstrip,$(BR2_GNU_TARGET_SUFFIX))
269 # packages compiled for the host go here
270 HOST_DIR:=$(call qstrip,$(BR2_HOST_DIR))
272 # stamp (dependency) files go here
273 STAMP_DIR:=$(BASE_DIR)/stamps
275 BINARIES_DIR:=$(BASE_DIR)/images
276 TARGET_DIR:=$(BASE_DIR)/target
277 TOOLCHAIN_DIR=$(BASE_DIR)/toolchain
278 TARGET_SKELETON=$(TOPDIR)/fs/skeleton
280 BR2_DEPENDS_DIR=$(BUILD_DIR)/buildroot-config
282 ifeq ($(BR2_CCACHE),y)
283 CCACHE:=$(HOST_DIR)/usr/bin/ccache
284 CCACHE_CACHE_DIR=$(HOME)/.buildroot-ccache
285 HOSTCC := $(CCACHE) $(HOSTCC)
286 HOSTCXX := $(CCACHE) $(HOSTCXX)
289 include toolchain/Makefile.in
290 include package/Makefile.in
292 #############################################################
294 # You should probably leave this stuff alone unless you know
295 # what you are doing.
297 #############################################################
301 # We also need the various per-package makefiles, which also add
302 # each selected package to TARGETS if that package was selected
303 # in the .config file.
304 ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
305 include toolchain/toolchain-buildroot.mk
306 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
307 include toolchain/toolchain-external.mk
308 else ifeq ($(BR2_TOOLCHAIN_CTNG),y)
309 include toolchain/toolchain-crosstool-ng.mk
312 include package/*/*.mk
314 include boot/common.mk
315 include target/Makefile.in
316 include linux/linux.mk
318 TARGETS+=target-finalize
320 ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
321 TARGETS+=target-purgelocales
326 TARGETS+=erase-fakeroots
328 TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
329 TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS) $(BASE_TARGETS))
330 TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS))
331 TARGETS_ALL:=$(patsubst %,__real_tgt_%,$(TARGETS))
333 # host-* dependencies have to be handled specially, as those aren't
334 # visible in Kconfig and hence not added to a variable like TARGETS.
335 # instead, find all the host-* targets listed in each <PKG>_DEPENDENCIES
336 # variable for each enabled target.
337 # Notice: this only works for newstyle gentargets/autotargets packages
338 TARGETS_HOST_DEPS = $(sort $(filter host-%,$(foreach dep,\
339 $(addsuffix _DEPENDENCIES,$(call UPPERCASE,$(TARGETS))),\
341 # Host packages can in turn have their own dependencies. Likewise find
342 # all the package names listed in the HOST_<PKG>_DEPENDENCIES for each
343 # host package found above. Ideally this should be done recursively until
344 # no more packages are found, but that's hard to do in make, so limit to
346 HOST_DEPS = $(sort $(foreach dep,\
347 $(addsuffix _DEPENDENCIES,$(call UPPERCASE,$(TARGETS_HOST_DEPS))),\
349 HOST_SOURCE += $(addsuffix -source,$(sort $(TARGETS_HOST_DEPS) $(HOST_DEPS)))
351 # all targets depend on the crosscompiler and it's prerequisites
352 $(TARGETS_ALL): __real_tgt_%: $(BASE_TARGETS) %
354 dirs: $(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
355 $(HOST_DIR) $(BR2_DEPENDS_DIR) $(BINARIES_DIR) $(STAMP_DIR)
357 $(BASE_TARGETS): dirs $(O)/toolchainfile.cmake
359 $(BUILD_DIR)/buildroot-config/auto.conf: $(CONFIG_DIR)/.config
360 $(MAKE) $(EXTRAMAKEARGS) HOSTCC="$(HOSTCC_NOCCACHE)" HOSTCXX="$(HOSTCXX_NOCCACHE)" silentoldconfig
362 prepare: $(BUILD_DIR)/buildroot-config/auto.conf
364 world: prepare dependencies dirs $(BASE_TARGETS) $(TARGETS_ALL)
366 $(O)/toolchainfile.cmake:
368 set(CMAKE_SYSTEM_NAME Linux)\n\
369 set(CMAKE_C_COMPILER $(TARGET_CC_NOCCACHE))\n\
370 set(CMAKE_CXX_COMPILER $(TARGET_CXX_NOCCACHE))\n\
371 set(CMAKE_C_FLAGS \"\$${CMAKE_C_FLAGS} $(TARGET_CFLAGS)\" CACHE STRING \"Buildroot CFLAGS\" FORCE)\n\
372 set(CMAKE_CXX_FLAGS \"\$${CMAKE_CXX_FLAGS} $(TARGET_CXXFLAGS)\" CACHE STRING \"Buildroot CXXFLAGS\" FORCE)\n\
373 set(CMAKE_INSTALL_SO_NO_EXE 0)\n\
374 set(CMAKE_PROGRAM_PATH \"$(HOST_DIR)/usr/bin\")\n\
375 set(CMAKE_FIND_ROOT_PATH \"$(STAGING_DIR)\")\n\
376 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)\n\
377 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)\n\
378 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)\n\
379 set(ENV{PKG_CONFIG_SYSROOT_DIR} \"$(STAGING_DIR)\")\n\
382 .PHONY: all world dirs clean distclean source outputmakefile \
383 $(BASE_TARGETS) $(TARGETS) $(TARGETS_ALL) \
384 $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) \
385 $(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
386 $(HOST_DIR) $(BR2_DEPENDS_DIR) $(BINARIES_DIR) $(STAMP_DIR)
388 #############################################################
390 # staging and target directories do NOT list these as
391 # dependencies anywhere else
393 #############################################################
394 $(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR):
398 @mkdir -p $(STAGING_DIR)/bin
399 @mkdir -p $(STAGING_DIR)/lib
400 @mkdir -p $(STAGING_DIR)/usr/lib
401 @mkdir -p $(STAGING_DIR)/usr/include
402 @mkdir -p $(STAGING_DIR)/usr/bin
403 @ln -snf $(STAGING_DIR) $(BASE_DIR)/staging
405 ifeq ($(BR2_ROOTFS_SKELETON_CUSTOM),y)
406 TARGET_SKELETON=$(BR2_ROOTFS_SKELETON_CUSTOM_PATH)
410 mkdir -p $(TARGET_DIR)
411 if ! [ -d "$(TARGET_DIR)/bin" ]; then \
412 if [ -d "$(TARGET_SKELETON)" ]; then \
413 cp -fa $(TARGET_SKELETON)/* $(TARGET_DIR)/; \
415 touch $(STAGING_DIR)/.fakeroot.00000; \
417 -find $(TARGET_DIR) -type d -name CVS -print0 -o -name .svn -print0 | xargs -0 rm -rf
418 -find $(TARGET_DIR) -type f \( -name .empty -o -name '*~' \) -print0 | xargs -0 rm -rf
421 $(TARGET_DIR): $(BUILD_DIR)/.root
424 rm -f $(BUILD_DIR)/.fakeroot*
427 ifeq ($(BR2_HAVE_DEVFILES),y)
428 ( scripts/copy.sh $(STAGING_DIR) $(TARGET_DIR) )
430 rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/lib/pkgconfig $(TARGET_DIR)/usr/share/aclocal
431 find $(TARGET_DIR)/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
432 find $(TARGET_DIR)/usr/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
434 ifneq ($(BR2_PACKAGE_GDB),y)
435 rm -rf $(TARGET_DIR)/usr/share/gdb
437 ifneq ($(BR2_HAVE_DOCUMENTATION),y)
438 rm -rf $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/man
439 rm -rf $(TARGET_DIR)/usr/info $(TARGET_DIR)/usr/share/info
440 rm -rf $(TARGET_DIR)/usr/doc $(TARGET_DIR)/usr/share/doc
441 rm -rf $(TARGET_DIR)/usr/share/gtk-doc
442 -rmdir $(TARGET_DIR)/usr/share 2>/dev/null
444 ifeq ($(BR2_PACKAGE_PYTHON_PY_ONLY),y)
445 find $(TARGET_DIR)/usr/lib/ -name '*.pyc' -print0 | xargs -0 rm -f
447 ifeq ($(BR2_PACKAGE_PYTHON_PYC_ONLY),y)
448 find $(TARGET_DIR)/usr/lib/ -name '*.py' -print0 | xargs -0 rm -f
450 find $(TARGET_DIR) -type f -perm +111 '!' -name 'libthread_db*.so*' | \
451 xargs $(STRIPCMD) 2>/dev/null || true
452 find $(TARGET_DIR)/lib/modules -type f -name '*.ko' | \
453 xargs -r $(KSTRIPCMD) || true
455 mkdir -p $(TARGET_DIR)/etc
456 # Mandatory configuration file and auxilliary cache directory
457 # for recent versions of ldconfig
458 touch $(TARGET_DIR)/etc/ld.so.conf
459 mkdir -p $(TARGET_DIR)/var/cache/ldconfig
460 if [ -x "$(TARGET_CROSS)ldconfig" ]; \
462 $(TARGET_CROSS)ldconfig -r $(TARGET_DIR); \
464 /sbin/ldconfig -r $(TARGET_DIR); \
466 echo $(BR2_VERSION_FULL) > $(TARGET_DIR)/etc/br-version
468 ifneq ($(BR2_ROOTFS_POST_BUILD_SCRIPT),"")
469 $(BR2_ROOTFS_POST_BUILD_SCRIPT) $(TARGET_DIR)
472 ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
473 LOCALE_WHITELIST=$(BUILD_DIR)/locales.nopurge
474 LOCALE_NOPURGE=$(call qstrip,$(BR2_ENABLE_LOCALE_WHITELIST))
477 rm -f $(LOCALE_WHITELIST)
478 for i in $(LOCALE_NOPURGE); do echo $$i >> $(LOCALE_WHITELIST); done
480 for dir in $(wildcard $(addprefix $(TARGET_DIR),/usr/share/locale /usr/share/X11/locale /usr/man /usr/share/man)); \
482 for lang in $$(cd $$dir; ls .|grep -v man); \
484 grep -qx $$lang $(LOCALE_WHITELIST) || rm -rf $$dir/$$lang; \
489 source: dirs $(TARGETS_SOURCE) $(HOST_SOURCE)
492 @$(MAKE) -Bs DL_MODE=SHOW_EXTERNAL_DEPS $(EXTRAMAKEARGS) source | sort -u
497 else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
502 # ---------------------------------------------------------------------------
504 HOSTCFLAGS=$(CFLAGS_FOR_BUILD)
507 $(BUILD_DIR)/buildroot-config/%onf:
508 mkdir -p $(@D)/lxdialog
509 $(MAKE) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" obj=$(@D) -C $(CONFIG) -f Makefile.br $(@F)
511 COMMON_CONFIG_ENV = \
512 KCONFIG_AUTOCONFIG=$(BUILD_DIR)/buildroot-config/auto.conf \
513 KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \
514 KCONFIG_TRISTATE=$(BUILD_DIR)/buildroot-config/tristate.config \
515 BUILDROOT_CONFIG=$(CONFIG_DIR)/.config
517 xconfig: $(BUILD_DIR)/buildroot-config/qconf outputmakefile
518 @mkdir -p $(BUILD_DIR)/buildroot-config
519 @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
521 gconfig: $(BUILD_DIR)/buildroot-config/gconf outputmakefile
522 @mkdir -p $(BUILD_DIR)/buildroot-config
523 @$(COMMON_CONFIG_ENV) srctree=$(TOPDIR) $< $(CONFIG_CONFIG_IN)
525 menuconfig: $(BUILD_DIR)/buildroot-config/mconf outputmakefile
526 @mkdir -p $(BUILD_DIR)/buildroot-config
527 @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
529 nconfig: $(BUILD_DIR)/buildroot-config/nconf outputmakefile
530 @mkdir -p $(BUILD_DIR)/buildroot-config
531 @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
533 config: $(BUILD_DIR)/buildroot-config/conf outputmakefile
534 @mkdir -p $(BUILD_DIR)/buildroot-config
535 @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
537 oldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
538 mkdir -p $(BUILD_DIR)/buildroot-config
539 @$(COMMON_CONFIG_ENV) $< --oldconfig $(CONFIG_CONFIG_IN)
541 randconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
542 @mkdir -p $(BUILD_DIR)/buildroot-config
543 @$(COMMON_CONFIG_ENV) $< --randconfig $(CONFIG_CONFIG_IN)
545 allyesconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
546 @mkdir -p $(BUILD_DIR)/buildroot-config
547 @$(COMMON_CONFIG_ENV) $< --allyesconfig $(CONFIG_CONFIG_IN)
549 allnoconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
550 @mkdir -p $(BUILD_DIR)/buildroot-config
551 @$(COMMON_CONFIG_ENV) $< --allnoconfig $(CONFIG_CONFIG_IN)
553 randpackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
554 @mkdir -p $(BUILD_DIR)/buildroot-config
555 @grep -v BR2_PACKAGE_ $(CONFIG_DIR)/.config > $(CONFIG_DIR)/.config.nopkg
556 @$(COMMON_CONFIG_ENV) \
557 KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
558 $< --randconfig $(CONFIG_CONFIG_IN)
559 @rm -f $(CONFIG_DIR)/.config.nopkg
561 allyespackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
562 @mkdir -p $(BUILD_DIR)/buildroot-config
563 @grep -v BR2_PACKAGE_ $(CONFIG_DIR)/.config > $(CONFIG_DIR)/.config.nopkg
564 @$(COMMON_CONFIG_ENV) \
565 KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
566 $< --allyesconfig $(CONFIG_CONFIG_IN)
567 @rm -f $(CONFIG_DIR)/.config.nopkg
569 allnopackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
570 @mkdir -p $(BUILD_DIR)/buildroot-config
571 @grep -v BR2_PACKAGE_ $(CONFIG_DIR)/.config > $(CONFIG_DIR)/.config.nopkg
572 @$(COMMON_CONFIG_ENV) \
573 KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
574 $< --allnoconfig $(CONFIG_CONFIG_IN)
575 @rm -f $(CONFIG_DIR)/.config.nopkg
577 silentoldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
578 @mkdir -p $(BUILD_DIR)/buildroot-config
579 $(COMMON_CONFIG_ENV) $< --silentoldconfig $(CONFIG_CONFIG_IN)
581 defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
582 @mkdir -p $(BUILD_DIR)/buildroot-config
583 @$(COMMON_CONFIG_ENV) $< --defconfig $(CONFIG_CONFIG_IN)
585 %_defconfig: $(BUILD_DIR)/buildroot-config/conf $(TOPDIR)/configs/%_defconfig outputmakefile
586 @mkdir -p $(BUILD_DIR)/buildroot-config
587 @$(COMMON_CONFIG_ENV) $< --defconfig=$(TOPDIR)/configs/$@ $(CONFIG_CONFIG_IN)
589 savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
590 @mkdir -p $(BUILD_DIR)/buildroot-config
591 @$(COMMON_CONFIG_ENV) $< --savedefconfig=$(CONFIG_DIR)/defconfig $(CONFIG_CONFIG_IN)
593 # check if download URLs are outdated
594 source-check: allyesconfig
595 $(MAKE) DL_MODE=SOURCE_CHECK $(EXTRAMAKEARGS) source
597 endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
599 #############################################################
601 # Cleanup and misc junk
603 #############################################################
605 # outputmakefile generates a Makefile in the output directory, if using a
606 # separate output directory. This allows convenient use of make in the
609 ifeq ($(NEED_WRAPPER),y)
610 $(Q)$(TOPDIR)/scripts/mkmakefile $(TOPDIR) $(O)
614 rm -rf $(STAGING_DIR) $(TARGET_DIR) $(BINARIES_DIR) $(HOST_DIR) \
615 $(STAMP_DIR) $(BUILD_DIR) $(TOOLCHAIN_DIR) $(BASE_DIR)/staging
618 ifeq ($(DL_DIR),$(TOPDIR)/dl)
624 rm -rf $(CONFIG_DIR)/.config $(CONFIG_DIR)/.config.old $(CONFIG_DIR)/.auto.deps
626 cross: $(BASE_TARGETS)
630 @echo ' clean - delete all files created by build'
631 @echo ' distclean - delete all non-source files (including .config)'
634 @echo ' all - make world'
636 @echo 'Configuration:'
637 @echo ' menuconfig - interactive curses-based configurator'
638 @echo ' nconfig - interactive ncurses-based configurator'
639 @echo ' xconfig - interactive Qt-based configurator'
640 @echo ' gconfig - interactive GTK-based configurator'
641 @echo ' oldconfig - resolve any unresolved symbols in .config'
642 @echo ' randconfig - New config with random answer to all options'
643 @echo ' defconfig - New config with default answer to all options'
644 @echo ' savedefconfig - Save current config as ./defconfig (minimal config)'
645 @echo ' allyesconfig - New config where all options are accepted with yes'
646 @echo ' allnoconfig - New config where all options are answered with no'
647 @echo ' randpackageconfig - New config with random answer to package options'
648 @echo ' allyespackageconfig - New config where pkg options are accepted with yes'
649 @echo ' allnopackageconfig - New config where package options are answered with no'
650 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
651 @echo ' busybox-menuconfig - Run BusyBox menuconfig'
653 ifeq ($(BR2_LINUX_KERNEL),y)
654 @echo ' linux-menuconfig - Run Linux kernel menuconfig'
655 @echo ' linux-savedefconfig - Run Linux kernel savedefconfig'
657 ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
658 @echo ' uclibc-menuconfig - Run uClibc menuconfig'
660 ifeq ($(BR2_TOOLCHAIN_CTNG),y)
661 @echo ' ctng-menuconfig - Run crosstool-NG menuconfig'
663 ifeq ($(BR2_TARGET_BAREBOX),y)
664 @echo ' barebox-menuconfig - Run barebox menuconfig'
665 @echo ' barebox-savedefconfig - Run barebox savedefconfig'
668 @echo 'Miscellaneous:'
669 @echo ' source - download all sources needed for offline-build'
670 @echo ' source-check - check all packages for valid download URLs'
671 @echo ' external-deps - list external packages used'
673 @echo ' make V=0|1 - 0 => quiet build (default), 1 => verbose build'
674 @echo ' make O=dir - Locate all output files in "dir", including .config'
676 @$(foreach b, $(sort $(notdir $(wildcard $(TOPDIR)/configs/*_defconfig))), \
677 printf " %-35s - Build for %s\\n" $(b) $(b:_defconfig=);)
679 @echo 'See docs/README and docs/buildroot.html for further details'
682 release: OUT=buildroot-$(BR2_VERSION)
685 git archive --format=tar --prefix=$(OUT)/ master|gzip -9 >$(OUT).tar.gz
687 .PHONY: $(noconfig_targets)