Explorar o código

include/image.mk: Introduce sanitized profile variable

Making common code reusable as there's a lot of duplicate code in imx6,
kirkwood and oxnas archs.

Signed-off-by: Petr Štetiar <[email protected]>

SVN-Revision: 47307
Felix Fietkau %!s(int64=10) %!d(string=hai) anos
pai
achega
86136e2bc3
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      include/image.mk

+ 10 - 0
include/image.mk

@@ -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),\