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> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6152 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
parent
d351925446
commit
89ec3760a9
5
Makefile
5
Makefile
|
@ -47,7 +47,10 @@ export KCONFIG_AUTOCONFIG := $(obj)/auto.conf
|
||||||
CONFIG_SHELL := sh
|
CONFIG_SHELL := sh
|
||||||
KBUILD_DEFCONFIG := configs/defconfig
|
KBUILD_DEFCONFIG := configs/defconfig
|
||||||
UNAME_RELEASE := $(shell uname -r)
|
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
|
MAKEFLAGS += -rR --no-print-directory
|
||||||
|
|
||||||
# Make is silent per default, but 'make V=1' will show all compiler calls.
|
# Make is silent per default, but 'make V=1' will show all compiler calls.
|
||||||
|
|
|
@ -162,53 +162,52 @@ function create_config
|
||||||
if [ "$CONFIG" != "" ]; then
|
if [ "$CONFIG" != "" ]; then
|
||||||
printf " Using existing configuration $CONFIG ... "
|
printf " Using existing configuration $CONFIG ... "
|
||||||
xml " <config>$CONFIG</config>"
|
xml " <config>$CONFIG</config>"
|
||||||
cp $CONFIG .config
|
cp $CONFIG ${build_dir}/config.build
|
||||||
else
|
else
|
||||||
printf " Creating config file... "
|
printf " Creating config file... "
|
||||||
xml " <config>autogenerated</config>"
|
xml " <config>autogenerated</config>"
|
||||||
grep "if[\t ]*VENDOR" src/mainboard/$VENDOR/$MAINBOARD/../Kconfig | \
|
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 | \
|
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 | \
|
grep "select[\t ]*ARCH" src/mainboard/$VENDOR/$MAINBOARD/Kconfig | \
|
||||||
sed "s,^.*\(ARCH_.*\)[^A-Z0-9_]*,CONFIG_\1=y," >> .config
|
sed "s,^.*\(ARCH_.*\)[^A-Z0-9_]*,CONFIG_\1=y," >> ${build_dir}/config.build
|
||||||
echo "CONFIG_MAINBOARD_DIR=\"$VENDOR/$MAINBOARD\"" >> .config
|
echo "CONFIG_MAINBOARD_DIR=\"$VENDOR/$MAINBOARD\"" >> ${build_dir}/config.build
|
||||||
echo "CONFIG_CBFS_PREFIX=\"$cbfs_prefix\"" >> .config
|
echo "CONFIG_CBFS_PREFIX=\"$cbfs_prefix\"" >> ${build_dir}/config.build
|
||||||
if [ "$PAYLOAD" != "/dev/null" ]; then
|
if [ "$PAYLOAD" != "/dev/null" ]; then
|
||||||
echo "# CONFIG_PAYLOAD_NONE is not set" >> .config
|
echo "# CONFIG_PAYLOAD_NONE is not set" >> ${build_dir}/config.build
|
||||||
echo "CONFIG_PAYLOAD_ELF=y" >> .config
|
echo "CONFIG_PAYLOAD_ELF=y" >> ${build_dir}/config.build
|
||||||
echo "CONFIG_FALLBACK_PAYLOAD_FILE=\"$PAYLOAD\"" >> .config
|
echo "CONFIG_FALLBACK_PAYLOAD_FILE=\"$PAYLOAD\"" >> ${build_dir}/config.build
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$loglevel" != "default" ]; then
|
if [ "$loglevel" != "default" ]; then
|
||||||
printf "(loglevel override) "
|
printf "(loglevel override) "
|
||||||
echo "CONFIG_MAXIMUM_CONSOLE_LOGLEVEL_$loglevel=y" >> .config
|
echo "CONFIG_MAXIMUM_CONSOLE_LOGLEVEL_$loglevel=y" >> ${build_dir}/config.build
|
||||||
echo "CONFIG_MAXIMUM_CONSOLE_LOGLEVEL=$loglevel" >> .config
|
echo "CONFIG_MAXIMUM_CONSOLE_LOGLEVEL=$loglevel" >> ${build_dir}/config.build
|
||||||
echo "CONFIG_DEFAULT_CONSOLE_LOGLEVEL_$loglevel=y" >> .config
|
echo "CONFIG_DEFAULT_CONSOLE_LOGLEVEL_$loglevel=y" >> ${build_dir}/config.build
|
||||||
echo "CONFIG_DEFAULT_CONSOLE_LOGLEVEL=$loglevel" >> .config
|
echo "CONFIG_DEFAULT_CONSOLE_LOGLEVEL=$loglevel" >> ${build_dir}/config.build
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$update" != "false" ]; then
|
if [ "$update" != "false" ]; then
|
||||||
printf "(update) "
|
printf "(update) "
|
||||||
echo "CONFIG_UPDATE_IMAGE=y" >> .config
|
echo "CONFIG_UPDATE_IMAGE=y" >> ${build_dir}/config.build
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$ccache" = "true" ]; then
|
if [ "$ccache" = "true" ]; then
|
||||||
printf "(ccache enabled) "
|
printf "(ccache enabled) "
|
||||||
echo "CONFIG_CCACHE=y" >> .config
|
echo "CONFIG_CCACHE=y" >> ${build_dir}/config.build
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$scanbuild" = "true" ]; then
|
if [ "$scanbuild" = "true" ]; then
|
||||||
printf "(scan-build enabled) "
|
printf "(scan-build enabled) "
|
||||||
echo "CONFIG_SCANBUILD_ENABLE=y" >> .config
|
echo "CONFIG_SCANBUILD_ENABLE=y" >> ${build_dir}/config.build
|
||||||
echo "CONFIG_SCANBUILD_REPORT_LOCATION=\"$TARGET/scan-build-results-tmp\"" >> .config
|
echo "CONFIG_SCANBUILD_REPORT_LOCATION=\"$TARGET/scan-build-results-tmp\"" >> ${build_dir}/config.build
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#yes "" | $MAKE oldconfig -j $cpus obj=${build_dir} objutil=$TARGET/sharedutils &> ${build_dir}/config.log
|
#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=$?
|
ret=$?
|
||||||
mv .config.old $TARGET/${VENDOR}_${MAINBOARD}/config.in
|
|
||||||
if [ $ret -eq 0 ]; then
|
if [ $ret -eq 0 ]; then
|
||||||
printf "ok; "
|
printf "ok; "
|
||||||
xml " <builddir>ok</builddir>"
|
xml " <builddir>ok</builddir>"
|
||||||
|
@ -245,9 +244,8 @@ function create_buildenv
|
||||||
echo "TOP=$ROOT" >> $MAKEFILE
|
echo "TOP=$ROOT" >> $MAKEFILE
|
||||||
echo "OUT=$TARGET/${VENDOR}_${MAINBOARD}" >> $MAKEFILE
|
echo "OUT=$TARGET/${VENDOR}_${MAINBOARD}" >> $MAKEFILE
|
||||||
echo "all:" >> $MAKEFILE
|
echo "all:" >> $MAKEFILE
|
||||||
echo " cp config.build \$(TOP)/.config" >> $MAKEFILE
|
echo " cd \$(TOP); \$(MAKE) oldconfig DOTCONFIG=\$(OUT)/config.build obj=\$(OUT)" >> $MAKEFILE
|
||||||
echo " cd \$(TOP); \$(MAKE) oldconfig obj=\$(OUT)" >> $MAKEFILE
|
echo " cd \$(TOP); \$(MAKE) DOTCONFIG=\$(OUT)/config.build obj=\$(OUT)" >> $MAKEFILE
|
||||||
echo " cd \$(TOP); \$(MAKE) obj=\$(OUT)" >> $MAKEFILE
|
|
||||||
|
|
||||||
return $ret
|
return $ret
|
||||||
}
|
}
|
||||||
|
@ -265,10 +263,9 @@ function compile_target
|
||||||
CURR=$( pwd )
|
CURR=$( pwd )
|
||||||
#stime=`perl -e 'print time();' 2>/dev/null || date +%s`
|
#stime=`perl -e 'print time();' 2>/dev/null || date +%s`
|
||||||
build_dir=$TARGET/${VENDOR}_${MAINBOARD}
|
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
|
&> ${build_dir}/make.log
|
||||||
ret=$?
|
ret=$?
|
||||||
mv .config ${build_dir}/config.build
|
|
||||||
mv .xcompile ${build_dir}/xcompile.build
|
mv .xcompile ${build_dir}/xcompile.build
|
||||||
cd $TARGET/${VENDOR}_${MAINBOARD}
|
cd $TARGET/${VENDOR}_${MAINBOARD}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue