diff mbox

[U-Boot,v2] Makefile: Add a 'checkthumb' rule

Message ID 1331915675-25541-1-git-send-email-trini@ti.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Tom Rini March 16, 2012, 4:34 p.m. UTC
This rule confirms that if we're on ARM and we have enabled THUMB builds
that we have a new enough toolchain to produce a working binary.

Changes in v2:
- Switch to ALL-$(CONFIG_SYS_THUMB_BUILD) in arch/arm/config.mk (Mike F)
- Simplfy checkthumb test after doing the above

Signed-off-by: Tom Rini <trini@ti.com>
---
 Makefile           |    7 +++++++
 arch/arm/config.mk |    1 +
 2 files changed, 8 insertions(+), 0 deletions(-)

Comments

Mike Frysinger March 16, 2012, 7:40 p.m. UTC | #1
On Friday 16 March 2012 12:34:35 Tom Rini wrote:
> --- a/Makefile
> +++ b/Makefile
> 
> +checkthumb:
> +	@if test $(call cc-version) -lt 0404; then \
> +		echo -n '*** Your GCC does not produce working '; \

fwiw, `echo -n` isn't portable.  `printf` is.

> +		echo 'binaries in THUMB mode.'; \
> +		echo '*** Your board is configured for THUMB mode.'; \
> +		false; \
> +	fi

would be nice if we could refactor our .mk's somehow to keep arch and board 
specific ones out of the top level Makefile.  but we can't today :(.

Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 11aac21..5af4ced 100644
--- a/Makefile
+++ b/Makefile
@@ -548,6 +548,13 @@  SYSTEM_MAP = \
 $(obj)System.map:	$(obj)u-boot
 		@$(call SYSTEM_MAP,$<) > $(obj)System.map
 
+checkthumb:
+	@if test $(call cc-version) -lt 0404; then \
+		echo -n '*** Your GCC does not produce working '; \
+		echo 'binaries in THUMB mode.'; \
+		echo '*** Your board is configured for THUMB mode.'; \
+		false; \
+	fi
 #
 # Auto-generate the autoconf.mk file (which is included by all makefiles)
 #
diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index d4fa1f8..367baa2 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -43,6 +43,7 @@  else
 PF_CPPFLAGS_ARM := $(call cc-option,-marm,) \
 		$(call cc-option,-mno-thumb-interwork,)
 endif
+ALL-$(CONFIG_SYS_THUMB_BUILD)	+= checkthumb
 
 # Try if EABI is supported, else fall back to old API,
 # i. e. for example: