diff --git a/MAKEALL b/MAKEALL
index ed85b7c07514f3bc31bf917253abce9707285f49..929fe884c54d73b2f7ca2badb807c75fca9d42fc 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -171,6 +171,14 @@ GNU_MAKE=$(scripts/show-gnu-make) || {
 # echo "Remaining arguments:"
 # for arg do echo '--> '"\`$arg'" ; done
 
+if [ ! -r boards.cfg ]; then
+	echo "Could not find boards.cfg"
+	tools/genboardscfg.py || {
+		echo "Failed to generate boards.cfg" >&2
+		exit 1
+	}
+fi
+
 FILTER="\$1 !~ /^#/"
 [ "$opt_a" ] && FILTER="${FILTER} && $opt_a"
 [ "$opt_c" ] && FILTER="${FILTER} && $opt_c"
@@ -512,9 +520,9 @@ get_target_location() {
 
 	set ${line}
 
-	CONFIG_NAME="${7%_config}"
+	CONFIG_NAME="${7%_defconfig}"
 
-	[ "${BOARD_NAME}" ] || BOARD_NAME="${7%_config}"
+	[ "${BOARD_NAME}" ] || BOARD_NAME="${7%_defconfig}"
 
 	if [ $# -gt 5 ]; then
 		if [ "$6" = "-" ] ; then
@@ -651,7 +659,9 @@ build_target() {
 	fi
 
 	${MAKE} distclean >/dev/null
-	${MAKE} -s ${target}_config
+
+	echo "Building ${target} board..."
+	${MAKE} -s ${target}_defconfig >/dev/null
 
 	${MAKE} ${JOBS} ${CHECK} all \
 		>${LOG_DIR}/$target.MAKELOG 2> ${LOG_DIR}/$target.ERR