Skip to content

Commit cb00b54

Browse files
committed
unix/make: Allow out-of-tree build.
This allows out-of-tree build like: ```sh $ make -C ports/unix/ BUILD=/tmp/aaa MICROPY_MPYCROSS=~/bin/mpy-cross test ``` Signed-off-by: Yanfeng Liu <[email protected]>
1 parent 616f35f commit cb00b54

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ports/unix/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $(error Invalid VARIANT specified: $(VARIANT_DIR))
1414
endif
1515

1616
# If the build directory is not given, make it reflect the variant name.
17-
BUILD ?= build-$(VARIANT)
17+
BUILD ?= $(abspath ./build-$(VARIANT))
1818

1919
include ../../py/mkenv.mk
2020
-include mpconfigport.mk
@@ -258,7 +258,7 @@ include $(TOP)/py/mkrules.mk
258258

259259
test: $(BUILD)/$(PROG) $(TOP)/tests/run-tests.py
260260
$(eval DIRNAME=ports/$(notdir $(CURDIR)))
261-
cd $(TOP)/tests && MICROPY_MICROPYTHON=../$(DIRNAME)/$(BUILD)/$(PROG) ./run-tests.py
261+
cd $(TOP)/tests && MICROPY_MICROPYTHON=$(BUILD)/$(PROG) ./run-tests.py
262262

263263
test//%: $(BUILD)/$(PROG) $(TOP)/tests/run-tests.py
264264
$(eval DIRNAME=ports/$(notdir $(CURDIR)))

0 commit comments

Comments
 (0)