include/image.mk: Introduce sanitized profile variable
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sat, 31 Oct 2015 09:27:04 +0000 (09:27 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
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>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47307 3c298f89-4303-0410-b956-a3cf2f4a3e73

include/image.mk

index 4e22fa5..3f65568 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),\