Skip to content

Commit e186ad7

Browse files
authored
Use firstword instead of lastword to locate current Makefile path (#29)
When `include` lines are used in Makefile, the newly included Makefile path will be appended to MAKEFILE_LIST. And using `lastword` to fetch current Makefile path would fail. This change alter the code to use firstword so as to fetch the top level Makefile path.
1 parent bd74c94 commit e186ad7

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

atomics-contract/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# We cannot use $(shell pwd), which will return unix path format on Windows,
22
# making it hard to use.
3-
cur_dir = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
3+
cur_dir = $(dir $(abspath $(firstword $(MAKEFILE_LIST))))
44

55
TOP := $(cur_dir)
66
# RUSTFLAGS that are likely to be tweaked by developers. For example,

contract/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# We cannot use $(shell pwd), which will return unix path format on Windows,
22
# making it hard to use.
3-
cur_dir = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
3+
cur_dir = $(dir $(abspath $(firstword $(MAKEFILE_LIST))))
44

55
TOP := $(cur_dir)
66
# RUSTFLAGS that are likely to be tweaked by developers. For example,

stack-reorder-contract/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# We cannot use $(shell pwd), which will return unix path format on Windows,
22
# making it hard to use.
3-
cur_dir = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
3+
cur_dir = $(dir $(abspath $(firstword $(MAKEFILE_LIST))))
44

55
TOP := $(cur_dir)
66
# RUSTFLAGS that are likely to be tweaked by developers. For example,

standalone-contract/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# We cannot use $(shell pwd), which will return unix path format on Windows,
22
# making it hard to use.
3-
cur_dir = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
3+
cur_dir = $(dir $(abspath $(firstword $(MAKEFILE_LIST))))
44

55
TOP := $(cur_dir)
66
# RUSTFLAGS that are likely to be tweaked by developers. For example,

workspace/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# We cannot use $(shell pwd), which will return unix path format on Windows,
22
# making it hard to use.
3-
cur_dir = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
3+
cur_dir = $(dir $(abspath $(firstword $(MAKEFILE_LIST))))
44

55
TOP := $(cur_dir)
66
# RUSTFLAGS that are likely to be tweaked by developers. For example,

0 commit comments

Comments
 (0)