systemd/test/Makefile.guess
Zbigniew Jędrzejewski-Szmek 26116187dd 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.
2017-07-18 10:05:06 -04:00

15 lines
494 B
Makefile

# 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