Makefile: bugfix for handling platform paths
authorAlejandro Cabrera Aldaya <aldaya@gmail.com>
Tue, 22 Nov 2022 10:28:25 +0000 (12:28 +0200)
committerAnup Patel <anup@brainfault.org>
Sun, 4 Dec 2022 15:32:33 +0000 (21:02 +0530)
If the path where this repo is located contains the platform name on
it, the original Makefile replaced its occurrences from the path making
it an invalid path. This commit prevents this behavior replacing only
the last part of the path as intended.

Signed-off-by: Alejandro Cabrera Aldaya <aldaya@gmail.com>
Reviewed-by: Xiang W <wxjstz@126.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Makefile

index 98e42fc17181c2a41957712c375f15da8b83997b..92203c5a2ac04143e5b9feab22e2856015baf8e0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -47,7 +47,7 @@ ifdef PLATFORM_DIR
     platform_parent_dir=$(platform_dir_path)
   else
     PLATFORM=$(shell basename $(platform_dir_path))
-    platform_parent_dir=$(subst $(PLATFORM),,$(platform_dir_path))
+    platform_parent_dir=$(shell realpath ${platform_dir_path}/..)
   endif
 else
  platform_parent_dir=$(src_dir)/platform