From 86136e2bc348835bc88fb3c7e3e9eddbe4aa3743 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 31 Oct 2015 09:27:04 +0000 Subject: include/image.mk: Introduce sanitized profile variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Making common code reusable as there's a lot of duplicate code in imx6, kirkwood and oxnas archs. Signed-off-by: Petr Štetiar SVN-Revision: 47307 --- include/image.mk | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/image.mk') diff --git a/include/image.mk b/include/image.mk index 4e22fa59a0..3f6556874a 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),\ -- cgit v1.2.3