From b16e14a220fcab19e3145328057e7188f00b6a17 Mon Sep 17 00:00:00 2001 From: Tony Ambardar Date: Sat, 11 Nov 2023 04:29:26 -0800 Subject: image: use helper function for size units Add the make function 'exp_units' for helping evaluate k/m/g size units in expressions, and use this to consistently replace many ad hoc substitutions like '$(subst k,* 1024,$(subst m, * 1024k,$(IMAGE_SIZE)))' in makefiles. Signed-off-by: Tony Ambardar --- target/linux/ramips/image/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'target/linux/ramips') diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index 265e9fb5e0..fdc15aa1ef 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -31,7 +31,7 @@ KERNEL_DTB = kernel-bin | append-dtb | lzma define Build/jcg-header $(STAGING_DIR_HOST)/bin/jcgimage -v $(1) \ - $(if $(JCG_MAXSIZE), -m $$(($(subst k, * 1024,$(JCG_MAXSIZE)))),) \ + $(if $(JCG_MAXSIZE), -m $$(($(call exp_units,$(JCG_MAXSIZE)))),) \ -u $@ -o $@.new mv $@.new $@ endef @@ -142,7 +142,7 @@ endef define Build/trx $(STAGING_DIR_HOST)/bin/trx $(1) \ -o $@ \ - -m $$(($(subst k, * 1024,$(IMAGE_SIZE)))) \ + -m $$(($(call exp_units,$(IMAGE_SIZE)))) \ -f $(IMAGE_KERNEL) \ -a 4 -f $(IMAGE_ROOTFS) endef -- cgit v1.2.3