Author: oxygene Date: Wed Dec 8 20:58:30 2010 New Revision: 6152 URL: https://tracker.coreboot.org/trac/coreboot/changeset/6152
Log: Allow user to define location for Kconfig config via DOTCONFIG make variable (defaults to .config). Let abuild use that.
Signed-off-by: Patrick Georgi patrick@georgi-clan.de Acked-by: Uwe Hermann uwe@hermann-uwe.de
Modified: trunk/Makefile trunk/util/abuild/abuild
Modified: trunk/Makefile ============================================================================== --- trunk/Makefile Wed Dec 8 09:22:04 2010 (r6151) +++ trunk/Makefile Wed Dec 8 20:58:30 2010 (r6152) @@ -47,7 +47,10 @@ CONFIG_SHELL := sh KBUILD_DEFCONFIG := configs/defconfig UNAME_RELEASE := $(shell uname -r) -HAVE_DOTCONFIG := $(wildcard .config) +DOTCONFIG ?= .config +KCONFIG_CONFIG = $(DOTCONFIG) +export KCONFIG_CONFIG +HAVE_DOTCONFIG := $(wildcard $(DOTCONFIG)) MAKEFLAGS += -rR --no-print-directory
# Make is silent per default, but 'make V=1' will show all compiler calls.
Modified: trunk/util/abuild/abuild ============================================================================== --- trunk/util/abuild/abuild Wed Dec 8 09:22:04 2010 (r6151) +++ trunk/util/abuild/abuild Wed Dec 8 20:58:30 2010 (r6152) @@ -162,53 +162,52 @@ if [ "$CONFIG" != "" ]; then printf " Using existing configuration $CONFIG ... " xml " <config>$CONFIG</config>" - cp $CONFIG .config + cp $CONFIG ${build_dir}/config.build else printf " Creating config file... " xml " <config>autogenerated</config>" grep "if[\t ]*VENDOR" src/mainboard/$VENDOR/$MAINBOARD/../Kconfig | \ - sed "s,^.*(VENDOR_.*)[^A-Z0-9_]*,CONFIG_\1=y," > .config + sed "s,^.*(VENDOR_.*)[^A-Z0-9_]*,CONFIG_\1=y," > ${build_dir}/config.build grep "if[\t ]*BOARD" src/mainboard/$VENDOR/$MAINBOARD/Kconfig | \ - sed "s,^.*(BOARD_.*)[^A-Z0-9_]*,CONFIG_\1=y," >> .config + sed "s,^.*(BOARD_.*)[^A-Z0-9_]*,CONFIG_\1=y," >> ${build_dir}/config.build grep "select[\t ]*ARCH" src/mainboard/$VENDOR/$MAINBOARD/Kconfig | \ - sed "s,^.*(ARCH_.*)[^A-Z0-9_]*,CONFIG_\1=y," >> .config - echo "CONFIG_MAINBOARD_DIR="$VENDOR/$MAINBOARD"" >> .config - echo "CONFIG_CBFS_PREFIX="$cbfs_prefix"" >> .config + sed "s,^.*(ARCH_.*)[^A-Z0-9_]*,CONFIG_\1=y," >> ${build_dir}/config.build + echo "CONFIG_MAINBOARD_DIR="$VENDOR/$MAINBOARD"" >> ${build_dir}/config.build + echo "CONFIG_CBFS_PREFIX="$cbfs_prefix"" >> ${build_dir}/config.build if [ "$PAYLOAD" != "/dev/null" ]; then - echo "# CONFIG_PAYLOAD_NONE is not set" >> .config - echo "CONFIG_PAYLOAD_ELF=y" >> .config - echo "CONFIG_FALLBACK_PAYLOAD_FILE="$PAYLOAD"" >> .config + echo "# CONFIG_PAYLOAD_NONE is not set" >> ${build_dir}/config.build + echo "CONFIG_PAYLOAD_ELF=y" >> ${build_dir}/config.build + echo "CONFIG_FALLBACK_PAYLOAD_FILE="$PAYLOAD"" >> ${build_dir}/config.build fi
if [ "$loglevel" != "default" ]; then printf "(loglevel override) " - echo "CONFIG_MAXIMUM_CONSOLE_LOGLEVEL_$loglevel=y" >> .config - echo "CONFIG_MAXIMUM_CONSOLE_LOGLEVEL=$loglevel" >> .config - echo "CONFIG_DEFAULT_CONSOLE_LOGLEVEL_$loglevel=y" >> .config - echo "CONFIG_DEFAULT_CONSOLE_LOGLEVEL=$loglevel" >> .config + echo "CONFIG_MAXIMUM_CONSOLE_LOGLEVEL_$loglevel=y" >> ${build_dir}/config.build + echo "CONFIG_MAXIMUM_CONSOLE_LOGLEVEL=$loglevel" >> ${build_dir}/config.build + echo "CONFIG_DEFAULT_CONSOLE_LOGLEVEL_$loglevel=y" >> ${build_dir}/config.build + echo "CONFIG_DEFAULT_CONSOLE_LOGLEVEL=$loglevel" >> ${build_dir}/config.build fi
if [ "$update" != "false" ]; then printf "(update) " - echo "CONFIG_UPDATE_IMAGE=y" >> .config + echo "CONFIG_UPDATE_IMAGE=y" >> ${build_dir}/config.build fi
if [ "$ccache" = "true" ]; then printf "(ccache enabled) " - echo "CONFIG_CCACHE=y" >> .config + echo "CONFIG_CCACHE=y" >> ${build_dir}/config.build fi
if [ "$scanbuild" = "true" ]; then printf "(scan-build enabled) " - echo "CONFIG_SCANBUILD_ENABLE=y" >> .config - echo "CONFIG_SCANBUILD_REPORT_LOCATION="$TARGET/scan-build-results-tmp"" >> .config + echo "CONFIG_SCANBUILD_ENABLE=y" >> ${build_dir}/config.build + echo "CONFIG_SCANBUILD_REPORT_LOCATION="$TARGET/scan-build-results-tmp"" >> ${build_dir}/config.build fi fi
#yes "" | $MAKE oldconfig -j $cpus obj=${build_dir} objutil=$TARGET/sharedutils &> ${build_dir}/config.log - yes "" | $MAKE oldconfig obj=${build_dir} objutil=$TARGET/sharedutils &> ${build_dir}/config.log + yes "" | $MAKE oldconfig DOTCONFIG=${build_dir}/config.build obj=${build_dir} objutil=$TARGET/sharedutils &> ${build_dir}/config.log ret=$? - mv .config.old $TARGET/${VENDOR}_${MAINBOARD}/config.in if [ $ret -eq 0 ]; then printf "ok; " xml " <builddir>ok</builddir>" @@ -245,9 +244,8 @@ echo "TOP=$ROOT" >> $MAKEFILE echo "OUT=$TARGET/${VENDOR}_${MAINBOARD}" >> $MAKEFILE echo "all:" >> $MAKEFILE - echo " cp config.build $(TOP)/.config" >> $MAKEFILE - echo " cd $(TOP); $(MAKE) oldconfig obj=$(OUT)" >> $MAKEFILE - echo " cd $(TOP); $(MAKE) obj=$(OUT)" >> $MAKEFILE + echo " cd $(TOP); $(MAKE) oldconfig DOTCONFIG=$(OUT)/config.build obj=$(OUT)" >> $MAKEFILE + echo " cd $(TOP); $(MAKE) DOTCONFIG=$(OUT)/config.build obj=$(OUT)" >> $MAKEFILE
return $ret } @@ -265,10 +263,9 @@ CURR=$( pwd ) #stime=`perl -e 'print time();' 2>/dev/null || date +%s` build_dir=$TARGET/${VENDOR}_${MAINBOARD} - eval $MAKE $silent -j $cpus obj=${build_dir} objutil=$TARGET/sharedutils \ + eval $MAKE $silent -j $cpus DOTCONFIG=${build_dir}/config.build obj=${build_dir} objutil=$TARGET/sharedutils \ &> ${build_dir}/make.log ret=$? - mv .config ${build_dir}/config.build mv .xcompile ${build_dir}/xcompile.build cd $TARGET/${VENDOR}_${MAINBOARD}