From 8a01cd12126252d41640c10429c505f5f2feb384 Mon Sep 17 00:00:00 2001 From: David Ogbeide Date: Fri, 28 Aug 2015 15:49:24 -0400 Subject: [PATCH] libhsakmt: specify build output via variable Makefile currently sends build output a default location. Allow choice of build output location if so desired using a variable. Signed-off-by: David Ogbeide --- src/Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Makefile b/src/Makefile index 5608ab7927..f3bbe91fca 100644 --- a/src/Makefile +++ b/src/Makefile @@ -26,9 +26,16 @@ OBJS = debug.o globals.o memory.o perfctr.o time.o version.o \ # Default target all: lnx lnx64a -BUILD_ROOT = ../build -BUILDDIR = $(BUILD_ROOT)/$(MAKECMDGOALS) +# To relocate build output, set "O=target/dir/" +# otherwise it defaults to a local directory +ifdef O + BUILD_ROOT := $(O) +else + BUILD_ROOT := ../build +endif + +BUILDDIR = $(BUILD_ROOT)/$(MAKECMDGOALS) TARGET = $(addprefix $(BUILDDIR)/,$(OBJS)) $(BUILDDIR)/$(LIB_NAME).$(LIB_MAJOR_VER): $(TARGET)