]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Allow CONFIG_BOARD_SIZE_LIMIT to be specified in hex
authorJoe Hershberger <joe.hershberger@ni.com>
Thu, 8 Nov 2012 10:19:09 +0000 (10:19 +0000)
committerTom Rini <trini@ti.com>
Thu, 6 Dec 2012 20:56:39 +0000 (13:56 -0700)
Use the printf command to convert the number in any valid format into
the expected decimal format.  The resulting errors should be printed to
stderr.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Makefile

index 2132ebf10f23e89b830749d00bbb6f0d71b163cf..de96861ea28b4e7eb22e8bc9357767bbfa720d41 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -390,12 +390,12 @@ __LIBS := $(subst $(obj),,$(LIBS)) $(subst $(obj),,$(LIBBOARD))
 ifneq ($(CONFIG_BOARD_SIZE_LIMIT),)
 BOARD_SIZE_CHECK = \
        @actual=`wc -c $@ | awk '{print $$1}'`; \
-       limit=$(CONFIG_BOARD_SIZE_LIMIT); \
+       limit=`printf "%d" $(CONFIG_BOARD_SIZE_LIMIT)`; \
        if test $$actual -gt $$limit; then \
-               echo "$@ exceeds file size limit:"; \
-               echo "  limit:  $$limit bytes"; \
-               echo "  actual: $$actual bytes"; \
-               echo "  excess: $$((actual - limit)) bytes"; \
+               echo "$@ exceeds file size limit:" >&2 ; \
+               echo "  limit:  $$limit bytes" >&2 ; \
+               echo "  actual: $$actual bytes" >&2 ; \
+               echo "  excess: $$((actual - limit)) bytes" >&2; \
                exit 1; \
        fi
 else