Skip to content

Commit

Permalink
Don't use PWD in the makefile. (#52)
Browse files Browse the repository at this point in the history
Rather compute the Makefile path and use that instead.
  • Loading branch information
floitsch authored May 21, 2024
1 parent 2f69bd6 commit 3f86f21
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tools/main.toit
Original file line number Diff line number Diff line change
Expand Up @@ -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.
// This doesn't work if the paths contain '"' characters.
// Should be pretty rare.
file.write-content --path="$dir/Makefile" """
SOURCE_DIR := \$(dir \$(realpath \$(lastword \$(MAKEFILE_LIST))))
SHELL := bash
.SHELLFLAGS += -e
Expand Down

0 comments on commit 3f86f21

Please sign in to comment.