diff options
author | Tony Ambardar <itugrok@yahoo.com> | 2023-11-11 04:29:26 -0800 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2023-11-26 18:37:20 +0100 |
commit | b16e14a220fcab19e3145328057e7188f00b6a17 (patch) | |
tree | 7412f17f418fa7c01575843d11563790242e4742 /target/linux/ramips | |
parent | c66511bc488c3665d47dd60baf981ca1c385c221 (diff) |
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 <itugrok@yahoo.com>
Diffstat (limited to 'target/linux/ramips')
-rw-r--r-- | target/linux/ramips/image/Makefile | 4 |
1 files changed, 2 insertions, 2 deletions
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 |