diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-07-04 23:00:43 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-07-18 10:05:06 -0400 |
commit | 26116187dd45fa08b12e486c5833b1bd705edfe0 (patch) | |
tree | 85f5af773457d633640e239daccad20513e72da2 /test | |
parent | 209f4b9e33a79e648d46a53c05ea94f8c1676c5f (diff) | |
download | systemd-26116187dd45fa08b12e486c5833b1bd705edfe0.tar.gz |
test: try to guess the build directory
This will work if $(TOP_SRC_DIR) has exactly one subdirectory with
.ninja_deps. Otherwise, BUILD_DIR has to be specified.
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.guess | 14 | ||||
-rw-r--r-- | test/TEST-01-BASIC/Makefile | 4 | ||||
-rw-r--r-- | test/TEST-13-NSPAWN-SMOKE/Makefile | 4 |
3 files changed, 20 insertions, 2 deletions
diff --git a/test/Makefile.guess b/test/Makefile.guess new file mode 100644 index 0000000000..1916d09a6c --- /dev/null +++ b/test/Makefile.guess @@ -0,0 +1,14 @@ +# Try to guess the build directory: +# we look for subdirectories of ../.. that look like ninja build dirs. + +ifeq ($(BUILD_DIR),) + dirs = $(dir $(wildcard ../../*/.ninja_log)) + ifeq ($(dirs),) + $(error Cannot guess build dir, set BUILD_DIR) + endif + ifneq ($(firstword $(dirs)),$(dirs)) + $(warning Candidates: $(dirs)) + $(error Too many build dirs to pick from, set BUILD_DIR) + endif + BUILD_DIR=$(dirs) +endif diff --git a/test/TEST-01-BASIC/Makefile b/test/TEST-01-BASIC/Makefile index c29fd06763..b895de8bcb 100644 --- a/test/TEST-01-BASIC/Makefile +++ b/test/TEST-01-BASIC/Makefile @@ -1,2 +1,4 @@ +include ../Makefile.guess + all setup clean run: - @basedir=../.. TEST_BASE_DIR=../ ./test.sh --$@ + @basedir=../.. TEST_BASE_DIR=../ BUILD_DIR=$(BUILD_DIR) ./test.sh --$@ diff --git a/test/TEST-13-NSPAWN-SMOKE/Makefile b/test/TEST-13-NSPAWN-SMOKE/Makefile index e58c0d909b..41cca23c7f 100644 --- a/test/TEST-13-NSPAWN-SMOKE/Makefile +++ b/test/TEST-13-NSPAWN-SMOKE/Makefile @@ -1,5 +1,7 @@ +include ../Makefile.guess + all setup run: - @basedir=../.. TEST_BASE_DIR=../ ./test.sh --$@ + @basedir=../.. TEST_BASE_DIR=../ BUILD_DIR=$(BUILD_DIR) ./test.sh --$@ clean: @basedir=../.. TEST_BASE_DIR=../ ./test.sh --clean @rm -f has-overflow |