Skip to content

Commit

Permalink
Don't use PWD in the makefile.
Browse files Browse the repository at this point in the history
Rather compute the Makefile path and use that instead.
  • Loading branch information
floitsch committed May 17, 2024
1 parent 59ca5bc commit 8e357ce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 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.
// 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 8e357ce

Please sign in to comment.