From 70b6c0f5e58d5a8e488519af9d7ecf70fc10894c Mon Sep 17 00:00:00 2001 From: John Bachan Date: Thu, 7 Jul 2022 11:42:21 +0200 Subject: [PATCH] Changed top-level Makefile behavior so that BUILDDIR is interpreted as relative to top-level directory. This done is by abspath'ing it before passing it to subdirectory Makefile's. The old behavior had two cases: with and without BUILDDIR being set by the user. With BUILDDIR not set, the build dir would be named "build" in the top-level directory. If BUILDDIR was set, then the build dir would be placed at "src/${BUILDDIR}". The new behavior is simpler, if BUILDDIR is not set then it defaults to "build", and the directory holding the final build is always at just "${BUILDDIR}" in the top level. [ROCm/rccl-tests commit: bc5f7cfb0aad52af4388f5b4cc6214baf1e1a8ed] --- projects/rccl-tests/Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/projects/rccl-tests/Makefile b/projects/rccl-tests/Makefile index 29409a8422..43729f897a 100644 --- a/projects/rccl-tests/Makefile +++ b/projects/rccl-tests/Makefile @@ -4,6 +4,9 @@ # See LICENCE.txt for license information # +BUILDDIR ?= build +override BUILDDIR := $(abspath $(BUILDDIR)) + .PHONY : all clean default : src.build @@ -14,7 +17,7 @@ all: ${TARGETS:%=%.build} clean: ${TARGETS:%=%.clean} %.build: - ${MAKE} -C $* build + ${MAKE} -C $* build BUILDDIR=${BUILDDIR} %.clean: - ${MAKE} -C $* clean + ${MAKE} -C $* clean BUILDDIR=${BUILDDIR}