From 6b739bb138db055383eaeb74992d4401f4745b4e Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Fri, 21 Aug 2020 19:47:22 +0200 Subject: [PATCH] Fix "make -C tests/data_files" It wasn't working when invoking programs/x509/cert_write or programs/x509/cert_req due to relying on the current directory rather than the location of the makefile. Signed-off-by: Gilles Peskine --- tests/data_files/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/data_files/Makefile b/tests/data_files/Makefile index 0429bddd1..1f9389b93 100644 --- a/tests/data_files/Makefile +++ b/tests/data_files/Makefile @@ -13,8 +13,10 @@ ## Tools OPENSSL ?= openssl FAKETIME ?= faketime -MBEDTLS_CERT_WRITE ?= $(PWD)/../../programs/x509/cert_write -MBEDTLS_CERT_REQ ?= $(PWD)/../../programs/x509/cert_req + +TOP_DIR = $(dir $(firstword $(MAKEFILE_LIST)))/../.. +MBEDTLS_CERT_WRITE ?= $(TOP_DIR)/programs/x509/cert_write +MBEDTLS_CERT_REQ ?= $(TOP_DIR)/programs/x509/cert_req ## Build the generated test data. Note that since the final outputs ## are committed to the repository, this target should do nothing on a