From 203e9027a6b87b914be2447a533ab2232f40c45a Mon Sep 17 00:00:00 2001 From: q-posev Date: Fri, 30 Apr 2021 14:12:23 +0200 Subject: [PATCH] fix paths --- src/Makefile.in | 2 +- tools/build_trexio.sh | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Makefile.in b/src/Makefile.in index a54c4be..7cec99f 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -90,7 +90,7 @@ cppcheck.out: $(HEADER_FILES) $(SOURCE_FILES) trexio.c trexio_f.f90 trexio.h: $(ORG_FILES) - ./build_trexio.sh + cd ../tools && ./build_trexio.sh && cd ../src test_c: libtrexio.so test.c diff --git a/tools/build_trexio.sh b/tools/build_trexio.sh index 5c1b9ac..2eeee42 100755 --- a/tools/build_trexio.sh +++ b/tools/build_trexio.sh @@ -6,8 +6,13 @@ if [[ $(basename $PWD) != "tools" ]] ; then exit -1 fi +TREXIO_ROOT=$(dirname "${PWD}../") + +# First define readonly global variables. +readonly SRC=${TREXIO_ROOT}/src + # Go to src directory -cd ../src +cd ${SRC} # We want the script to crash on the 1st error: set -e @@ -80,5 +85,3 @@ source build.sh cp trexio* ../ cd .. -# Come back to the TREXIO root directory -cd ..