]> Git Repo - buildroot-mgba.git/blobdiff - Makefile
Update for 2013.02-rc1
[buildroot-mgba.git] / Makefile
index d3e861063c7cbd70562fdd5e03092bfdc2f850df..3f967b246f0737651c565fd61c22a0fc59deaf6a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 # Makefile for buildroot2
 #
 # Copyright (C) 1999-2005 by Erik Andersen <[email protected]>
-# Copyright (C) 2006-2011 by the Buildroot developers <[email protected]>
+# Copyright (C) 2006-2012 by the Buildroot developers <[email protected]>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 #--------------------------------------------------------------
 
 # Set and export the version string
-export BR2_VERSION:=2012.02-git
+export BR2_VERSION:=2013.02-rc1
 
 # Check for minimal make version (note: this check will break at make 10.x)
 MIN_MAKE_VERSION=3.81
-ifeq ($(firstword $(sort $(MAKE_VERSION) $(MIN_MAKE_VERSION))),$(MAKE_VERSION))
+ifneq ($(firstword $(sort $(MAKE_VERSION) $(MIN_MAKE_VERSION))),$(MIN_MAKE_VERSION))
 $(error You have make '$(MAKE_VERSION)' installed. GNU make >= $(MIN_MAKE_VERSION) is required)
 endif
 
+export HOSTARCH := $(shell uname -m | \
+       sed -e s/i.86/x86/ \
+           -e s/sun4u/sparc64/ \
+           -e s/arm.*/arm/ \
+           -e s/sa110/arm/ \
+           -e s/ppc64/powerpc/ \
+           -e s/ppc/powerpc/ \
+           -e s/macppc/powerpc/\
+           -e s/sh.*/sh/)
+
 # This top-level Makefile can *not* be executed in parallel
 .NOTPARALLEL:
 
@@ -46,9 +56,9 @@ DATE:=$(shell date +%Y%m%d)
 export BR2_VERSION_FULL:=$(BR2_VERSION)$(shell $(TOPDIR)/support/scripts/setlocalversion)
 
 noconfig_targets:=menuconfig nconfig gconfig xconfig config oldconfig randconfig \
-       defconfig %_defconfig savedefconfig allyesconfig allnoconfig silentoldconfig release \
+       %_defconfig allyesconfig allnoconfig silentoldconfig release \
        randpackageconfig allyespackageconfig allnopackageconfig \
-       source-check
+       source-check print-version
 
 # Strip quotes and then whitespaces
 qstrip=$(strip $(subst ",,$(1)))
@@ -81,14 +91,11 @@ EXTRAMAKEARGS = O=$(O)
 NEED_WRAPPER=y
 endif
 
+BUILDROOT_CONFIG=$(CONFIG_DIR)/.config
+
 # Pull in the user's configuration file
 ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
--include $(CONFIG_DIR)/.config
-endif
-
-# Override BR2_DL_DIR if shell variable defined
-ifneq ($(BUILDROOT_DL_DIR),)
-BR2_DL_DIR:=$(BUILDROOT_DL_DIR)
+-include $(BUILDROOT_CONFIG)
 endif
 
 # To put more focus on warnings, be less verbose as default
@@ -165,6 +172,14 @@ HOSTNM:=$(shell which $(HOSTNM) || type -p $(HOSTNM) || echo nm)
 export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTFC HOSTLD
 export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE
 
+# Make sure pkg-config doesn't look outside the buildroot tree
+unexport PKG_CONFIG_PATH
+unexport PKG_CONFIG_SYSROOT_DIR
+
+# Having DESTDIR set in the environment confuses the installation
+# steps of some packages.
+unexport DESTDIR
+
 # bash prints the name of the directory on 'cd <dir>' if CDPATH is
 # set, so unset it here to not cause problems. Notice that the export
 # line doesn't affect the environment of $(shell ..) calls, so
@@ -178,13 +193,6 @@ BUILD_DIR:=$(BASE_DIR)/build
 
 ifeq ($(BR2_HAVE_DOT_CONFIG),y)
 
-# cc-option
-# Usage: cflags-y+=$(call cc-option, -march=winchip-c6, -march=i586)
-# sets -march=winchip-c6 if supported else falls back to -march=i586
-# without checking the latter.
-cc-option=$(shell if $(TARGET_CC) $(TARGET_CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
-       > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
-
 #############################################################
 #
 # Hide troublesome environment variables from sub processes
@@ -199,37 +207,10 @@ unexport CFLAGS
 unexport CXXFLAGS
 unexport GREP_OPTIONS
 unexport CONFIG_SITE
+unexport QMAKESPEC
 
 GNU_HOST_NAME:=$(shell support/gnuconfig/config.guess)
 
-#############################################################
-#
-# Setup the proper filename extensions for the host
-#
-##############################################################
-ifneq ($(findstring linux,$(GNU_HOST_NAME)),)
-HOST_EXEEXT:=
-HOST_LIBEXT:=.a
-HOST_SHREXT:=.so
-endif
-ifneq ($(findstring apple,$(GNU_HOST_NAME)),)
-HOST_EXEEXT:=
-HOST_LIBEXT:=.a
-HOST_SHREXT:=.dylib
-endif
-ifneq ($(findstring cygwin,$(GNU_HOST_NAME)),)
-HOST_EXEEXT:=.exe
-HOST_LIBEXT:=.lib
-HOST_SHREXT:=.dll
-HOST_LOADLIBES=-lcurses -lintl
-export HOST_LOADLIBES
-endif
-ifneq ($(findstring mingw,$(GNU_HOST_NAME)),)
-HOST_EXEEXT:=.exe
-HOST_LIBEXT:=.lib
-HOST_SHREXT:=.dll
-endif
-
 ##############################################################
 #
 # The list of stuff to build for the target toolchain
@@ -253,13 +234,11 @@ QUIET:=$(if $(findstring s,$(MAKEFLAGS)),-q)
 
 # Strip off the annoying quoting
 ARCH:=$(call qstrip,$(BR2_ARCH))
-ifeq ($(ARCH),xtensa)
-ARCH:=$(ARCH)_$(call qstrip,$(BR2_xtensa_core_name))
-endif
 
 KERNEL_ARCH:=$(shell echo "$(ARCH)" | sed -e "s/-.*//" \
        -e s/i.86/i386/ -e s/sun4u/sparc64/ \
        -e s/arm.*/arm/ -e s/sa110/arm/ \
+       -e s/aarch64/arm64/ \
        -e s/bfin/blackfin/ \
        -e s/parisc64/parisc/ \
        -e s/powerpc64/powerpc/ \
@@ -271,28 +250,48 @@ BZCAT:=$(call qstrip,$(BR2_BZCAT))
 XZCAT:=$(call qstrip,$(BR2_XZCAT))
 TAR_OPTIONS=$(call qstrip,$(BR2_TAR_OPTIONS)) -xf
 
-GNU_TARGET_SUFFIX:=-$(call qstrip,$(BR2_GNU_TARGET_SUFFIX))
-
 # packages compiled for the host go here
 HOST_DIR:=$(call qstrip,$(BR2_HOST_DIR))
 
+# locales to generate
+GENERATE_LOCALE=$(call qstrip,$(BR2_GENERATE_LOCALE))
+
 # stamp (dependency) files go here
 STAMP_DIR:=$(BASE_DIR)/stamps
 
 BINARIES_DIR:=$(BASE_DIR)/images
 TARGET_DIR:=$(BASE_DIR)/target
 TOOLCHAIN_DIR=$(BASE_DIR)/toolchain
-TARGET_SKELETON=$(TOPDIR)/fs/skeleton
+TARGET_SKELETON=$(TOPDIR)/system/skeleton
+
+LEGAL_INFO_DIR=$(BASE_DIR)/legal-info
+REDIST_SOURCES_DIR=$(LEGAL_INFO_DIR)/sources
+LICENSE_FILES_DIR=$(LEGAL_INFO_DIR)/licenses
+LEGAL_MANIFEST_CSV=$(LEGAL_INFO_DIR)/manifest.csv
+LEGAL_LICENSES_TXT=$(LEGAL_INFO_DIR)/licenses.txt
+LEGAL_WARNINGS=$(LEGAL_INFO_DIR)/.warnings
+LEGAL_REPORT=$(LEGAL_INFO_DIR)/README
+
+# Location of a file giving a big fat warning that output/target
+# should not be used as the root filesystem.
+TARGET_DIR_WARNING_FILE=$(TARGET_DIR)/THIS_IS_NOT_YOUR_ROOT_FILESYSTEM
 
 ifeq ($(BR2_CCACHE),y)
 CCACHE:=$(HOST_DIR)/usr/bin/ccache
-CCACHE_CACHE_DIR=$(HOME)/.buildroot-ccache
+BUILDROOT_CACHE_DIR = $(call qstrip,$(BR2_CCACHE_DIR))
+export BUILDROOT_CACHE_DIR
 HOSTCC  := $(CCACHE) $(HOSTCC)
 HOSTCXX := $(CCACHE) $(HOSTCXX)
 endif
 
-include toolchain/Makefile.in
-include package/Makefile.in
+# Scripts in support/ or post-build scripts may need to reference
+# these locations, so export them so it is easier to use
+export BUILDROOT_CONFIG
+export TARGET_DIR
+export STAGING_DIR
+export HOST_DIR
+export BINARIES_DIR
+export BASE_DIR
 
 #############################################################
 #
@@ -303,6 +302,13 @@ include package/Makefile.in
 
 all: world
 
+# Include legacy before the other things, because package .mk files
+# may rely on it.
+ifneq ($(BR2_DEPRECATED),y)
+include Makefile.legacy
+endif
+
+include package/Makefile.in
 include support/dependencies/dependencies.mk
 
 # We also need the various per-package makefiles, which also add
@@ -326,8 +332,8 @@ endif
 include package/*/*.mk
 
 include boot/common.mk
-include target/Makefile.in
 include linux/linux.mk
+include system/system.mk
 
 TARGETS+=target-finalize
 
@@ -335,9 +341,19 @@ ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
 TARGETS+=target-purgelocales
 endif
 
+ifneq ($(BR2_TOOLCHAIN_EXTERNAL_GLIBC)$(BR2_TOOLCHAIN_CTNG_eglibc)$(BR2_TOOLCHAIN_CTNG_glibc),)
+ifneq ($(GENERATE_LOCALE),)
+TARGETS+=target-generatelocales
+endif
+endif
+
+ifeq ($(BR2_ECLIPSE_REGISTER),y)
+TARGETS+=toolchain-eclipse-register
+endif
+
 include fs/common.mk
 
-TARGETS+=erase-fakeroots
+TARGETS+=target-post-image
 
 TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
 TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS) $(BASE_TARGETS))
@@ -362,41 +378,31 @@ HOST_DEPS = $(sort $(foreach dep,\
                $($(dep))))
 HOST_SOURCE += $(addsuffix -source,$(sort $(TARGETS_HOST_DEPS) $(HOST_DEPS)))
 
+TARGETS_LEGAL_INFO:=$(patsubst %,%-legal-info,\
+               $(TARGETS) $(BASE_TARGETS) $(TARGETS_HOST_DEPS) $(HOST_DEPS))))
+
 # all targets depend on the crosscompiler and it's prerequisites
 $(TARGETS_ALL): __real_tgt_%: $(BASE_TARGETS) %
 
-dirs: $(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
+dirs: $(TOOLCHAIN_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
        $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR)
 
-$(BASE_TARGETS): dirs $(O)/toolchainfile.cmake
+$(BASE_TARGETS): dirs $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake
 
-$(BUILD_DIR)/buildroot-config/auto.conf: $(CONFIG_DIR)/.config
+$(BUILD_DIR)/buildroot-config/auto.conf: $(BUILDROOT_CONFIG)
        $(MAKE) $(EXTRAMAKEARGS) HOSTCC="$(HOSTCC_NOCCACHE)" HOSTCXX="$(HOSTCXX_NOCCACHE)" silentoldconfig
 
 prepare: $(BUILD_DIR)/buildroot-config/auto.conf
 
-world: prepare dirs dependencies $(BASE_TARGETS) $(TARGETS_ALL)
-
-$(O)/toolchainfile.cmake:
-       @echo -en "\
-       set(CMAKE_SYSTEM_NAME Linux)\n\
-       set(CMAKE_C_COMPILER $(TARGET_CC_NOCCACHE))\n\
-       set(CMAKE_CXX_COMPILER $(TARGET_CXX_NOCCACHE))\n\
-       set(CMAKE_C_FLAGS \"\$${CMAKE_C_FLAGS} $(TARGET_CFLAGS)\" CACHE STRING \"Buildroot CFLAGS\" FORCE)\n\
-       set(CMAKE_CXX_FLAGS \"\$${CMAKE_CXX_FLAGS} $(TARGET_CXXFLAGS)\" CACHE STRING \"Buildroot CXXFLAGS\" FORCE)\n\
-       set(CMAKE_INSTALL_SO_NO_EXE 0)\n\
-       set(CMAKE_PROGRAM_PATH \"$(HOST_DIR)/usr/bin\")\n\
-       set(CMAKE_FIND_ROOT_PATH \"$(STAGING_DIR)\")\n\
-       set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)\n\
-       set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)\n\
-       set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)\n\
-       set(ENV{PKG_CONFIG_SYSROOT_DIR} \"$(STAGING_DIR)\")\n\
-       " > $@
-
-.PHONY: all world dirs clean distclean source outputmakefile \
+toolchain: prepare dirs dependencies $(BASE_TARGETS)
+
+world: toolchain $(TARGETS_ALL)
+
+.PHONY: all world toolchain dirs clean distclean source outputmakefile \
+       legal-info legal-info-prepare legal-info-clean \
        $(BASE_TARGETS) $(TARGETS) $(TARGETS_ALL) \
-       $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) \
-       $(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
+       $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) $(TARGETS_LEGAL_INFO) \
+       $(TOOLCHAIN_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
        $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR)
 
 #############################################################
@@ -405,7 +411,7 @@ $(O)/toolchainfile.cmake:
 # dependencies anywhere else
 #
 #############################################################
-$(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR):
+$(TOOLCHAIN_DIR) $(BUILD_DIR) $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR):
        @mkdir -p $@
 
 $(STAGING_DIR):
@@ -426,22 +432,27 @@ $(BUILD_DIR)/.root:
                if [ -d "$(TARGET_SKELETON)" ]; then \
                        cp -fa $(TARGET_SKELETON)/* $(TARGET_DIR)/; \
                fi; \
-               touch $(STAGING_DIR)/.fakeroot.00000; \
        fi
+       cp support/misc/target-dir-warning.txt $(TARGET_DIR_WARNING_FILE)
        -find $(TARGET_DIR) -type d -name CVS -print0 -o -name .svn -print0 | xargs -0 rm -rf
        -find $(TARGET_DIR) -type f \( -name .empty -o -name '*~' \) -print0 | xargs -0 rm -rf
        touch $@
 
 $(TARGET_DIR): $(BUILD_DIR)/.root
 
-erase-fakeroots:
-       rm -f $(BUILD_DIR)/.fakeroot*
+STRIP_FIND_CMD = find $(TARGET_DIR)
+ifneq (,$(call qstrip,$(BR2_STRIP_EXCLUDE_DIRS)))
+STRIP_FIND_CMD += \( $(call finddirclauses,$(TARGET_DIR),$(call qstrip,$(BR2_STRIP_EXCLUDE_DIRS))) \) -prune -o
+endif
+STRIP_FIND_CMD += -type f -perm +111
+STRIP_FIND_CMD += -not \( $(call findfileclauses,libpthread*.so* $(call qstrip,$(BR2_STRIP_EXCLUDE_FILES))) \) -print
 
 target-finalize:
 ifeq ($(BR2_HAVE_DEVFILES),y)
        ( support/scripts/copy.sh $(STAGING_DIR) $(TARGET_DIR) )
 else
-       rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/lib/pkgconfig $(TARGET_DIR)/usr/share/aclocal
+       rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/share/aclocal \
+               $(TARGET_DIR)/usr/lib/pkgconfig $(TARGET_DIR)/usr/share/pkgconfig
        find $(TARGET_DIR)/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
        find $(TARGET_DIR)/usr/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
 endif
@@ -461,11 +472,18 @@ endif
 ifeq ($(BR2_PACKAGE_PYTHON_PYC_ONLY),y)
        find $(TARGET_DIR)/usr/lib/ -name '*.py' -print0 | xargs -0 rm -f
 endif
-       find $(TARGET_DIR) -type f -perm +111 '!' -name 'libthread_db*.so*' | \
-               xargs $(STRIPCMD) 2>/dev/null || true
+       $(STRIP_FIND_CMD) | xargs $(STRIPCMD) 2>/dev/null || true
        find $(TARGET_DIR)/lib/modules -type f -name '*.ko' | \
                xargs -r $(KSTRIPCMD) || true
 
+# See http://sourceware.org/gdb/wiki/FAQ, "GDB does not see any threads
+# besides the one in which crash occurred; or SIGTRAP kills my program when
+# I set a breakpoint"
+ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
+       find $(TARGET_DIR)/lib -type f -name 'libpthread*.so*' | \
+               xargs $(STRIPCMD) $(STRIP_STRIP_DEBUG) || true
+endif
+
        mkdir -p $(TARGET_DIR)/etc
        # Mandatory configuration file and auxilliary cache directory
        # for recent versions of ldconfig
@@ -477,10 +495,26 @@ endif
        else \
                /sbin/ldconfig -r $(TARGET_DIR); \
        fi
-       echo $(BR2_VERSION_FULL) > $(TARGET_DIR)/etc/br-version
+       ( \
+               echo "NAME=Buildroot"; \
+               echo "VERSION=$(BR2_VERSION_FULL)"; \
+               echo "ID=buildroot"; \
+               echo "VERSION_ID=$(BR2_VERSION)"; \
+               echo "PRETTY_NAME=\"Buildroot $(BR2_VERSION)\"" \
+       ) >  $(TARGET_DIR)/etc/os-release
+
+       @for dir in $(call qstrip,$(BR2_ROOTFS_OVERLAY)); do \
+               $(call MESSAGE,"Copying overlay $${dir}"); \
+               rsync -a \
+                       --exclude .empty --exclude .svn --exclude .git \
+                       --exclude .hg --exclude '*~' \
+                       $${dir}/ $(TARGET_DIR); \
+       done
 
 ifneq ($(BR2_ROOTFS_POST_BUILD_SCRIPT),"")
-       $(BR2_ROOTFS_POST_BUILD_SCRIPT) $(TARGET_DIR)
+       @$(call MESSAGE,"Executing post-build script\(s\)")
+       @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
+               $(s) $(TARGET_DIR)$(sep))
 endif
 
 ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
@@ -500,11 +534,67 @@ target-purgelocales:
        done
 endif
 
+ifneq ($(GENERATE_LOCALE),)
+# Generate locale data. Basically, we call the localedef program
+# (built by the host-localedef package) for each locale. The input
+# data comes preferably from the toolchain, or if the toolchain does
+# not have them (Linaro toolchains), we use the ones available on the
+# host machine.
+target-generatelocales: host-localedef
+       $(Q)mkdir -p $(TARGET_DIR)/usr/lib/locale/
+       $(Q)for locale in $(GENERATE_LOCALE) ; do \
+               inputfile=`echo $${locale} | cut -f1 -d'.'` ; \
+               charmap=`echo $${locale} | cut -f2 -d'.'` ; \
+               if test -z "$${charmap}" ; then \
+                       charmap="UTF-8" ; \
+               fi ; \
+               echo "Generating locale $${inputfile}.$${charmap}" ; \
+               I18NPATH=$(STAGING_DIR)/usr/share/i18n:/usr/share/i18n \
+               $(HOST_DIR)/usr/bin/localedef \
+                       --prefix=$(TARGET_DIR) \
+                       --`echo $(BR2_ENDIAN) | tr [A-Z] [a-z]`-endian \
+                       -i $${inputfile} -f $${charmap} \
+                       $${locale} ; \
+       done
+endif
+
+target-post-image:
+ifneq ($(BR2_ROOTFS_POST_IMAGE_SCRIPT),"")
+       @$(call MESSAGE,"Executing post-image script\(s\)")
+       @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_IMAGE_SCRIPT)), \
+               $(s) $(BINARIES_DIR)$(sep))
+endif
+
+toolchain-eclipse-register:
+       ./support/scripts/eclipse-register-toolchain `readlink -f $(O)` $(notdir $(TARGET_CROSS)) $(BR2_ARCH)
+
 source: dirs $(TARGETS_SOURCE) $(HOST_SOURCE)
 
 external-deps:
        @$(MAKE) -Bs DL_MODE=SHOW_EXTERNAL_DEPS $(EXTRAMAKEARGS) source | sort -u
 
+legal-info-clean:
+       @rm -fr $(LEGAL_INFO_DIR)
+
+legal-info-prepare: $(LEGAL_INFO_DIR)
+       @$(call MESSAGE,"Collecting legal info")
+       @$(call legal-license-file,buildroot,COPYING,COPYING)
+       @$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE)
+       @$(call legal-manifest,buildroot,$(BR2_VERSION_FULL),GPLv2+,COPYING,not saved)
+       @$(call legal-warning,the Buildroot source code has not been saved)
+       @$(call legal-warning,the toolchain has not been saved)
+       @cp $(BUILDROOT_CONFIG) $(LEGAL_INFO_DIR)/buildroot.config
+
+legal-info: dirs legal-info-clean legal-info-prepare $(REDIST_SOURCES_DIR) \
+               $(TARGETS_LEGAL_INFO)
+       @cat support/legal-info/README.header >>$(LEGAL_REPORT)
+       @if [ -r $(LEGAL_WARNINGS) ]; then \
+               cat support/legal-info/README.warnings-header \
+                       $(LEGAL_WARNINGS) >>$(LEGAL_REPORT); \
+               cat $(LEGAL_WARNINGS); fi
+       @echo "Legal info produced in $(LEGAL_INFO_DIR)"
+       @rm -f $(LEGAL_WARNINGS)
+
 show-targets:
        @echo $(TARGETS)
 
@@ -512,6 +602,8 @@ else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
 
 all: menuconfig
 
+endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
+
 # configuration
 # ---------------------------------------------------------------------------
 
@@ -522,11 +614,16 @@ $(BUILD_DIR)/buildroot-config/%onf:
        mkdir -p $(@D)/lxdialog
        $(MAKE) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" obj=$(@D) -C $(CONFIG) -f Makefile.br $(@F)
 
+DEFCONFIG = $(call qstrip,$(BR2_DEFCONFIG))
+
+# We don't want to fully expand BR2_DEFCONFIG here, so Kconfig will
+# recognize that if it's still at its default $(CONFIG_DIR)/defconfig
 COMMON_CONFIG_ENV = \
+       BR2_DEFCONFIG='$(call qstrip,$(value BR2_DEFCONFIG))' \
        KCONFIG_AUTOCONFIG=$(BUILD_DIR)/buildroot-config/auto.conf \
        KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \
        KCONFIG_TRISTATE=$(BUILD_DIR)/buildroot-config/tristate.config \
-       BUILDROOT_CONFIG=$(CONFIG_DIR)/.config
+       BUILDROOT_CONFIG=$(BUILDROOT_CONFIG)
 
 xconfig: $(BUILD_DIR)/buildroot-config/qconf outputmakefile
        @mkdir -p $(BUILD_DIR)/buildroot-config
@@ -566,7 +663,10 @@ allnoconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 
 randpackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
        @mkdir -p $(BUILD_DIR)/buildroot-config
-       @grep -v BR2_PACKAGE_ $(CONFIG_DIR)/.config > $(CONFIG_DIR)/.config.nopkg
+       @grep -v BR2_PACKAGE_ $(BUILDROOT_CONFIG) > $(CONFIG_DIR)/.config.nopkg
+       @grep '^config BR2_PACKAGE_' Config.in.legacy | \
+               while read config pkg; do \
+               echo "# $$pkg is not set" >> $(CONFIG_DIR)/.config.nopkg; done
        @$(COMMON_CONFIG_ENV) \
                KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
                $< --randconfig $(CONFIG_CONFIG_IN)
@@ -574,7 +674,10 @@ randpackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 
 allyespackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
        @mkdir -p $(BUILD_DIR)/buildroot-config
-       @grep -v BR2_PACKAGE_ $(CONFIG_DIR)/.config > $(CONFIG_DIR)/.config.nopkg
+       @grep -v BR2_PACKAGE_ $(BUILDROOT_CONFIG) > $(CONFIG_DIR)/.config.nopkg
+       @grep '^config BR2_PACKAGE_' Config.in.legacy | \
+               while read config pkg; do \
+               echo "# $$pkg is not set" >> $(CONFIG_DIR)/.config.nopkg; done
        @$(COMMON_CONFIG_ENV) \
                KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
                $< --allyesconfig $(CONFIG_CONFIG_IN)
@@ -582,7 +685,7 @@ allyespackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 
 allnopackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
        @mkdir -p $(BUILD_DIR)/buildroot-config
-       @grep -v BR2_PACKAGE_ $(CONFIG_DIR)/.config > $(CONFIG_DIR)/.config.nopkg
+       @grep -v BR2_PACKAGE_ $(BUILDROOT_CONFIG) > $(CONFIG_DIR)/.config.nopkg
        @$(COMMON_CONFIG_ENV) \
                KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
                $< --allnoconfig $(CONFIG_CONFIG_IN)
@@ -594,7 +697,7 @@ silentoldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 
 defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
        @mkdir -p $(BUILD_DIR)/buildroot-config
-       @$(COMMON_CONFIG_ENV) $< --defconfig $(CONFIG_CONFIG_IN)
+       @$(COMMON_CONFIG_ENV) $< --defconfig$(if $(DEFCONFIG),=$(DEFCONFIG)) $(CONFIG_CONFIG_IN)
 
 %_defconfig: $(BUILD_DIR)/buildroot-config/conf $(TOPDIR)/configs/%_defconfig outputmakefile
        @mkdir -p $(BUILD_DIR)/buildroot-config
@@ -602,13 +705,15 @@ defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 
 savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
        @mkdir -p $(BUILD_DIR)/buildroot-config
-       @$(COMMON_CONFIG_ENV) $< --savedefconfig=$(CONFIG_DIR)/defconfig $(CONFIG_CONFIG_IN)
+       @$(COMMON_CONFIG_ENV) $< \
+               --savedefconfig=$(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) \
+               $(CONFIG_CONFIG_IN)
 
 # check if download URLs are outdated
-source-check: allyesconfig
+source-check:
        $(MAKE) DL_MODE=SOURCE_CHECK $(EXTRAMAKEARGS) source
 
-endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
+.PHONY: defconfig savedefconfig
 
 #############################################################
 #
@@ -626,7 +731,8 @@ endif
 
 clean:
        rm -rf $(STAGING_DIR) $(TARGET_DIR) $(BINARIES_DIR) $(HOST_DIR) \
-               $(STAMP_DIR) $(BUILD_DIR) $(TOOLCHAIN_DIR) $(BASE_DIR)/staging
+               $(STAMP_DIR) $(BUILD_DIR) $(TOOLCHAIN_DIR) $(BASE_DIR)/staging \
+               $(LEGAL_INFO_DIR)
 
 distclean: clean
 ifeq ($(DL_DIR),$(TOPDIR)/dl)
@@ -635,9 +741,7 @@ endif
 ifeq ($(O),output)
        rm -rf $(O)
 endif
-       rm -rf $(CONFIG_DIR)/.config $(CONFIG_DIR)/.config.old $(CONFIG_DIR)/.auto.deps
-
-cross: $(BASE_TARGETS)
+       rm -rf $(BUILDROOT_CONFIG) $(CONFIG_DIR)/.config.old $(CONFIG_DIR)/.auto.deps
 
 help:
        @echo 'Cleaning:'
@@ -646,6 +750,9 @@ help:
        @echo
        @echo 'Build:'
        @echo '  all                    - make world'
+       @echo '  toolchain              - build toolchain'
+       @echo '  <package>-rebuild      - force recompile <package>'
+       @echo '  <package>-reconfigure  - force reconfigure <package>'
        @echo
        @echo 'Configuration:'
        @echo '  menuconfig             - interactive curses-based configurator'
@@ -655,6 +762,7 @@ help:
        @echo '  oldconfig              - resolve any unresolved symbols in .config'
        @echo '  randconfig             - New config with random answer to all options'
        @echo '  defconfig              - New config with default answer to all options'
+       @echo '                             BR2_DEFCONFIG, if set, is used as input'
        @echo '  savedefconfig          - Save current config as ./defconfig (minimal config)'
        @echo '  allyesconfig           - New config where all options are accepted with yes'
        @echo '  allnoconfig            - New config where all options are answered with no'
@@ -689,8 +797,9 @@ endif
        @echo
        @echo 'Miscellaneous:'
        @echo '  source                 - download all sources needed for offline-build'
-       @echo '  source-check           - check all packages for valid download URLs'
+       @echo '  source-check           - check selected packages for valid download URLs'
        @echo '  external-deps          - list external packages used'
+       @echo '  legal-info             - generate info about license compliance'
        @echo
        @echo '  make V=0|1             - 0 => quiet build (default), 1 => verbose build'
        @echo '  make O=dir             - Locate all output files in "dir", including .config'
@@ -713,54 +822,9 @@ release:
        bzip2 -9 -c < $(OUT).tar > $(OUT).tar.bz2
        rm -rf $(OUT) $(OUT).tar
 
-################################################################################
-# GENDOC -- generates the make targets needed to build a specific type of
-#           asciidoc documentation.
-#
-#  argument 1 is the name of the document and must be a subdirectory of docs/;
-#             the top-level asciidoc file must have the same name
-#  argument 2 is the type of document to generate (-f argument of a2x)
-#  argument 3 is the document type as used in the make target
-#  argument 4 is the output file extension for the document type
-#  argument 5 is the human text for the document type
-#  argument 6 (optional) are extra arguments for a2x
-#
-# The variable <DOCUMENT_NAME>_SOURCES defines the dependencies.
-################################################################################
-define GENDOC_INNER
-$(1): $(1)-$(3)
-.PHONY: $(1)-$(3)
-$(1)-$(3): $$(O)/docs/$(1)/$(1).$(4)
-
-$$(O)/docs/$(1)/$(1).$(4): docs/$(1)/$(1).txt $$($(call UPPERCASE,$(1))_SOURCES)
-       @echo "Generating $(5) $(1)..."
-       $(Q)mkdir -p $$(@D)
-       $(Q)a2x $(6) -f $(2) -d book -L -r $(TOPDIR)/docs/images \
-         -D $$(@D) $$<
-endef
-
-################################################################################
-# GENDOC -- generates the make targets needed to build asciidoc documentation.
-#
-#  argument 1 is the name of the document and must be a subdirectory of docs/;
-#             the top-level asciidoc file must have the same name
-#
-# The variable <DOCUMENT_NAME>_SOURCES defines the dependencies.
-################################################################################
-define GENDOC
-$(call GENDOC_INNER,$(1),xhtml,html,html,HTML)
-$(call GENDOC_INNER,$(1),chunked,split-html,chunked,Split HTML)
-$(call GENDOC_INNER,$(1),pdf,pdf,pdf,PDF,--dblatex-opts "-P latex.output.revhistory=0")
-$(call GENDOC_INNER,$(1),text,txt,text,Text)
-$(call GENDOC_INNER,$(1),epub,epub,epub,EPUB)
-clean: clean-$(1)
-clean-$(1):
-       $(Q)$(RM) -rf $(O)/docs/$(1)
-.PHONY: $(1) clean-$(1)
-endef
-
-MANUAL_SOURCES = $(wildcard docs/manual/*.txt) $(wildcard docs/images/*)
-$(eval $(call GENDOC,manual))
+print-version:
+       @echo $(BR2_VERSION_FULL)
 
-.PHONY: $(noconfig_targets)
+include docs/manual/manual.mk
 
+.PHONY: $(noconfig_targets)
This page took 0.047623 seconds and 4 git commands to generate.