diff options
authorSimon Glass <>2013-04-20 08:42:36 +0000
committerTom Rini <>2013-05-01 11:17:21 -0400
commitfada9e2048446878c95fb331bbc21e1e40eddc72 (patch)
parentce5346a80599a714962d3fc4bf90ddf0d2e62299 (diff)
Trigger generic board error only when building
At present the generic board error can occur when configuring U-Boot, or during distclean, but this is incorrect. The existing may come from an earlier U-Boot configuration which is about to be overwritten. Make the error conditional so that it will only be triggered when we are actually building U-Boot. This avoids a problem where the system is being reconfigured to remove CONFIG_SYS_GENERIC_BOARD on an architecture that does not support it. Currently this will print an error and require the manual removal of include/ Signed-off-by: Simon Glass <>
2 files changed, 12 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index f8ecfd7130..dbc4b709b6 100644
--- a/Makefile
+++ b/Makefile
@@ -183,6 +183,16 @@ endif
# load other configuration
include $(TOPDIR)/
+# Targets which don't build the source code
+NON_BUILD_TARGETS = backup clean clobber distclean mkproper tidy unconfig
+# Only do the generic board check when actually building, not configuring
+ifeq ($(filter $(NON_BUILD_TARGETS),$(MAKECMDGOALS)),)
+ifeq ($(findstring _config,$(MAKECMDGOALS)),)
# If board code explicitly specified LDSCRIPT or CONFIG_SYS_LDSCRIPT, use
# that (or fail if absent). Otherwise, search for a linker script in a
# standard location.
diff --git a/ b/
index 89a89f2081..b427a4eed0 100644
--- a/
+++ b/
@@ -233,8 +233,8 @@ endif
# Does this architecture support generic board init?
-$(error Your architecture does not support generic board. Please undefined \
-CONFIG_SYS_GENERIC_BOARD in your board config file)
+CHECK_GENERIC_BOARD = $(error Your architecture does not support generic board. \
+Please undefined CONFIG_SYS_GENERIC_BOARD in your board config file)
OpenPOWER on IntegriCloud