include/image.mk: Introduce sanitized profile variable
authorFelix Fietkau <nbd@openwrt.org>
Sat, 31 Oct 2015 09:27:04 +0000 (09:27 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 31 Oct 2015 09:27:04 +0000 (09:27 +0000)
Making common code reusable as there's a lot of duplicate code in imx6,
kirkwood and oxnas archs.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
SVN-Revision: 47307

include/image.mk

index 4e22fa59a0f2f76c2778010e80238699608e8824..3f6556874a5f56dfd6010db2d07964535209e9bc 100644 (file)
@@ -89,6 +89,16 @@ define toupper
 $(shell echo $(1) | tr '[:lower:]' '[:upper:]')
 endef
 
+define tolower
+$(shell echo $(1) | tr '[:upper:]' '[:lower:]')
+endef
+
+define sanitize
+$(shell echo $(call tolower,$(1)) | sed 's/_/-/g')
+endef
+
+PROFILE_SANITIZED := $(call sanitize,$(PROFILE))
+
 define split_args
 $(foreach data, \
        $(subst |,$(space),\