[OpenWrt-Devel] [PATCH 1/8] include/image.mk: Introduce sanitized profile variable

Petr Štetiar ynezz at true.cz
Fri Oct 30 19:52:28 EDT 2015


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

Signed-off-by: Petr Štetiar <ynezz at true.cz>
---
 include/image.mk |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/image.mk b/include/image.mk
index 4e22fa5..3f65568 100644
--- a/include/image.mk
+++ b/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),\
-- 
1.7.9.5
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list