diff --git a/common.mk b/common.mk index b702c2557..84758599e 100644 --- a/common.mk +++ b/common.mk @@ -128,11 +128,16 @@ files-that-dont-contain = $(strip $(foreach f, $(1), $(if $(findstring $(2),$(f) # --- Include makefile configuration file -------------------------------------- # +# The path to the directory in which BLIS was built. +ifeq ($(strip $(BUILD_PATH)),) +BUILD_PATH := . +endif + # Define the name of the configuration file. CONFIG_MK_FILE := config.mk # Include the configuration file. --include ./$(CONFIG_MK_FILE) +-include $(BUILD_PATH)/$(CONFIG_MK_FILE) # Detect whether we actually got the configuration file. If we didn't, then # it is likely that the user has not yet generated it (via configure). @@ -160,7 +165,6 @@ CONFIG_DIR := config FRAME_DIR := frame REFKERN_DIR := ref_kernels KERNELS_DIR := kernels -BUILD_DIR := build OBJ_DIR := obj LIB_DIR := lib INCLUDE_DIR := include @@ -212,7 +216,7 @@ RANLIB := ranlib INSTALL := install -c # Script for creating a monolithic header file. -FLATTEN_H := $(DIST_PATH)/$(BUILD_DIR)/flatten-headers.sh +FLATTEN_H := $(DIST_PATH)/build/flatten-headers.sh # Default archiver flags. AR := ar @@ -485,7 +489,7 @@ MK_HEADER_DIR_PATHS := $(dir $(foreach frag_path, \ INCLUDE_PATHS := $(strip $(patsubst %, -I%, $(MK_HEADER_DIR_PATHS))) # Construct the base path for the intermediate include directory. -BASE_INC_PATH := ./$(INCLUDE_DIR)/$(CONFIG_NAME) +BASE_INC_PATH := $(BUILD_PATH)/$(INCLUDE_DIR)/$(CONFIG_NAME) # Isolate the path to blis.h by filtering the file from the list of headers. BLIS_H := blis.h diff --git a/test/3m4m/Makefile b/test/3m4m/Makefile index 761a114dd..9eca21605 100644 --- a/test/3m4m/Makefile +++ b/test/3m4m/Makefile @@ -55,9 +55,10 @@ # --- Distribution path override ----------------------------------------------- # -# Override the DIST_PATH value obtained from config.mk (via common.mk) by -# defining it here (prior to including the common.mk). +# Override the default DIST_PATH and BUILD_PATH values so that make can find +# the source distribution and build location. DIST_PATH := ../.. +BUILD_PATH := ../.. diff --git a/test/Makefile b/test/Makefile index 9906d6668..6a84aee29 100644 --- a/test/Makefile +++ b/test/Makefile @@ -54,9 +54,10 @@ # --- Distribution path override ----------------------------------------------- # -# Override the DIST_PATH value obtained from config.mk (via common.mk) by -# defining it here (prior to including the common.mk). +# Override the default DIST_PATH and BUILD_PATH values so that make can find +# the source distribution and build location. DIST_PATH := .. +BUILD_PATH := .. diff --git a/test/exec_sizes/Makefile b/test/exec_sizes/Makefile index caddb0ef4..7c030891e 100644 --- a/test/exec_sizes/Makefile +++ b/test/exec_sizes/Makefile @@ -54,9 +54,10 @@ # --- Distribution path override ----------------------------------------------- # -# Override the DIST_PATH value obtained from config.mk (via common.mk) by -# defining it here (prior to including the common.mk). +# Override the default DIST_PATH and BUILD_PATH values so that make can find +# the source distribution and build location. DIST_PATH := ../.. +BUILD_PATH := ../.. diff --git a/test/thread_ranges/Makefile b/test/thread_ranges/Makefile index 601a85f62..02a8e961f 100644 --- a/test/thread_ranges/Makefile +++ b/test/thread_ranges/Makefile @@ -54,9 +54,10 @@ # --- Distribution path override ----------------------------------------------- # -# Override the DIST_PATH value obtained from config.mk (via common.mk) by -# defining it here (prior to including the common.mk). +# Override the default DIST_PATH and BUILD_PATH values so that make can find +# the source distribution and build location. DIST_PATH := ../.. +BUILD_PATH := ../.. diff --git a/testsuite/Makefile b/testsuite/Makefile index d7880e2e2..e0bc461f7 100644 --- a/testsuite/Makefile +++ b/testsuite/Makefile @@ -54,9 +54,11 @@ # --- Distribution path override ----------------------------------------------- # -# Override the DIST_PATH value obtained from config.mk (via common.mk) by -# defining it here (prior to including the common.mk). +# Override the default DIST_PATH and BUILD_PATH values so that make can find +# the source distribution and build location. DIST_PATH := .. +BUILD_PATH := .. + # @@ -107,7 +109,7 @@ endif #BLIS_INC_PATH := $(INSTALL_PREFIX)/include/blis # BLIS library. -BLIS_LIB_PATH := $(DIST_PATH)/$(LIB_DIR)/$(CONFIG_NAME) +BLIS_LIB_PATH := $(BUILD_PATH)/$(LIB_DIR)/$(CONFIG_NAME) BLIS_LIB := $(BLIS_LIB_PATH)/libblis.a # BLAS library path(s). This is where the BLAS libraries reside.