Commit 2db2c250 authored by Michael Ellerman's avatar Michael Ellerman

selftests/powerpc: Fix standalone powerpc build

The changes to enable building with a separate output directory, in
commit a8ba798b ("selftests: enable O and KBUILD_OUTPUT") broke
building the powerpc selftests on their own, eg:

 $ cd tools/testing/selftests/powerpc; make

It was partially fixed in commit e53aff45 ("selftests: lib.mk Fix
individual test builds"), which defined OUTPUT for standalone tests. But
that only defines OUTPUT within the Makefile, the value is not exported
so sub-shells can't see it. We could export OUTPUT, but it's actually
cleaner to just expand the value of OUTPUT before we invoke the shell.

Fixes: a8ba798b ("selftests: enable O and KBUILD_OUTPUT")
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent cc638a48
...@@ -34,34 +34,34 @@ endif ...@@ -34,34 +34,34 @@ endif
all: $(SUB_DIRS) all: $(SUB_DIRS)
$(SUB_DIRS): $(SUB_DIRS):
BUILD_TARGET=$$OUTPUT/$@; mkdir -p $$BUILD_TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -k -C $@ all BUILD_TARGET=$(OUTPUT)/$@; mkdir -p $$BUILD_TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -k -C $@ all
include ../lib.mk include ../lib.mk
override define RUN_TESTS override define RUN_TESTS
@for TARGET in $(SUB_DIRS); do \ @for TARGET in $(SUB_DIRS); do \
BUILD_TARGET=$$OUTPUT/$$TARGET; \ BUILD_TARGET=$(OUTPUT)/$$TARGET; \
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests;\ $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests;\
done; done;
endef endef
override define INSTALL_RULE override define INSTALL_RULE
@for TARGET in $(SUB_DIRS); do \ @for TARGET in $(SUB_DIRS); do \
BUILD_TARGET=$$OUTPUT/$$TARGET; \ BUILD_TARGET=$(OUTPUT)/$$TARGET; \
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET install;\ $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET install;\
done; done;
endef endef
override define EMIT_TESTS override define EMIT_TESTS
@for TARGET in $(SUB_DIRS); do \ @for TARGET in $(SUB_DIRS); do \
BUILD_TARGET=$$OUTPUT/$$TARGET; \ BUILD_TARGET=$(OUTPUT)/$$TARGET; \
$(MAKE) OUTPUT=$$BUILD_TARGET -s -C $$TARGET emit_tests;\ $(MAKE) OUTPUT=$$BUILD_TARGET -s -C $$TARGET emit_tests;\
done; done;
endef endef
clean: clean:
@for TARGET in $(SUB_DIRS); do \ @for TARGET in $(SUB_DIRS); do \
BUILD_TARGET=$$OUTPUT/$$TARGET; \ BUILD_TARGET=$(OUTPUT)/$$TARGET; \
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean; \ $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean; \
done; done;
rm -f tags rm -f tags
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment