From 8e357ce9680df1e4d932e3ae542dee09ff03c62c Mon Sep 17 00:00:00 2001 From: Florian Loitsch Date: Fri, 17 May 2024 17:24:33 +0200 Subject: [PATCH] Don't use PWD in the makefile. Rather compute the Makefile path and use that instead. --- tools/main.toit | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/main.toit b/tools/main.toit index 2c02b4e..35b3145 100644 --- a/tools/main.toit +++ b/tools/main.toit @@ -319,14 +319,16 @@ create-makefile_ dir/string --toit-root/string --build-path/string --chip/string makefile-toit-root := to-makefile-path --relative-to=dir toit-root idf-path := "$makefile-toit-root/third_party/esp-idf" if not fs.is-absolute idf-path: - // Use the Makefile $PWD to make the path absolute. - idf-path = "\$(PWD)/$idf-path" + // Use the Makefile-path to make the path absolute. + idf-path = "\$(SOURCE_DIR)/$idf-path" makefile-build-path := to-makefile-path --relative-to=dir build-path // This doesn't work if the paths '"' characters. // Should be pretty rare. file.write-content --path="$dir/Makefile" """ + SOURCE_DIR := \$(dir \$(realpath \$(lastword \$(MAKEFILE_LIST)))) + SHELL := bash .SHELLFLAGS += -e