Fixed testsuite Makefile brokenness from 9091a207.

Details:
- Fixed a makefile error encountered when building the testsuite directly
  in its directory (as opposed to indirectly via 'make test'). The fix
  involves introducing a new variable, BUILD_PATH, alongside the existing
  DIST_PATH variable. By default, BUILD_PATH is set to the current
  directory, and is overridden by other Makefiles used by, for example,
  the testsuite and standalone test drivers in testsuite or test,
  respectively.
- Some files/directories in common.mk were redefined in terms of
  BUILD_DIR, such as the locations of config.mk file and the intermediate
  include directory.
This commit is contained in:
Field G. Van Zee
2017-12-14 15:47:41 -06:00
parent 6a3a8924c0
commit 86cd23b737
6 changed files with 25 additions and 15 deletions

View File

@@ -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

View File

@@ -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 := ../..

View File

@@ -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 := ..

View File

@@ -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 := ../..

View File

@@ -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 := ../..

View File

@@ -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.