From aca9a45bd4a755a4496a27d6fac18524be1985b0 Mon Sep 17 00:00:00 2001 From: Ramya Subramanyam Date: Thu, 10 Oct 2024 17:05:51 +0530 Subject: [PATCH] mtb-libs/Makefile: Replace backslash in MTB tools path with forward slash. Signed-off-by: Ramya Subramanyam --- mtb-libs/Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mtb-libs/Makefile b/mtb-libs/Makefile index b57a409..1086800 100644 --- a/mtb-libs/Makefile +++ b/mtb-libs/Makefile @@ -173,12 +173,20 @@ CY_GETLIBS_SHARED_NAME=mtb_shared # software provided compiler by default). CY_COMPILER_GCC_ARM_DIR= +# Replace backward slashes with forward slashes in a path +define replace_backslashes +$(subst \,/,$(1)) +endef + +# Define a new path with backward slashes replaced by forward slashes +CY_TOOLS_PATHS_NEW=$(call replace_backslashes,$(CY_TOOLS_PATHS)) + # Default to the newest installed tools folder, or the users override (if it's # found). -CY_TOOLS_DIR=$(lastword $(sort $(wildcard $(CY_TOOLS_PATHS)))) +CY_TOOLS_DIR=$(lastword $(sort $(wildcard $(CY_TOOLS_PATHS_NEW)))) ifeq ($(CY_TOOLS_DIR),) -$(error Unable to find any of the available CY_TOOLS_PATHS -- $(CY_TOOLS_PATHS). On Windows, use forward slashes.) +$(error Unable to find any of the available CY_TOOLS_PATHS -- $(CY_TOOLS_PATHS_NEW). On Windows, use forward slashes.) endif $(info Tools Directory: $(CY_TOOLS_DIR))