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