summaryrefslogtreecommitdiffstats
path: root/core/definitions.mk
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2011-02-09 17:24:27 -0800
committerYing Wang <wangying@google.com>2011-02-09 17:24:27 -0800
commit4a2ecaf5dc7434dd06a1fbcf14c56e6a7c7b383b (patch)
tree858b1f0930bfb4f805f17031a7e7c78c7be8b3a3 /core/definitions.mk
parentbfaf531e05b3f024dc758ab5211ef9b067f60754 (diff)
downloadbuild-4a2ecaf5dc7434dd06a1fbcf14c56e6a7c7b383b.zip
build-4a2ecaf5dc7434dd06a1fbcf14c56e6a7c7b383b.tar.gz
build-4a2ecaf5dc7434dd06a1fbcf14c56e6a7c7b383b.tar.bz2
Fix the case image-size-from-data-size returns 0.
This time with correct escaping. Change-Id: I660887ac62425e9960e266391b52979a7dff4617
Diffstat (limited to 'core/definitions.mk')
-rw-r--r--core/definitions.mk6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/definitions.mk b/core/definitions.mk
index 6fd4b99..f0de65e 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -1833,8 +1833,10 @@ endif
# spare area for each page).
# $(1): the partition data size
define image-size-from-data-size
-$(shell echo $$(($(1) / $(BOARD_NAND_PAGE_SIZE) * \
- ($(BOARD_NAND_PAGE_SIZE)+$(BOARD_NAND_SPARE_SIZE)))))
+$(strip $(eval _isfds_value := $$(shell echo $$$$(($(1) / $(BOARD_NAND_PAGE_SIZE) * \
+ ($(BOARD_NAND_PAGE_SIZE)+$(BOARD_NAND_SPARE_SIZE))))))\
+$(if $(filter 0, $(_isfds_value)),$(shell echo $$(($(BOARD_NAND_PAGE_SIZE)+$(BOARD_NAND_SPARE_SIZE)))),$(_isfds_value))\
+$(eval _isfds_value :=))
endef
# $(1): The file(s) to check (often $@)