From c3ff63ae5f08deb09e8104c509eb47260305e86c Mon Sep 17 00:00:00 2001 From: John Mager Date: Sat, 10 Apr 2021 00:55:57 -0400 Subject: [PATCH] Use absolute path to pass around Idris executable Rather than tracking how far we are from the project root in the various Makefile commands, it's much easier to reference the build target with with an absolute path. --- Makefile | 26 +++++++++++++------------- tests/idris2/pkg002/run | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 6b02b5efa..0ccf3895a 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ export IDRIS2_BOOT ?= idris2 # Idris 2 executable we're building NAME = idris2 -TARGETDIR = build/exec +TARGETDIR = ${CURDIR}/build/exec TARGET = ${TARGETDIR}/${NAME} MAJOR=0 @@ -74,31 +74,31 @@ src/IdrisPaths.idr: FORCE FORCE: prelude: - ${MAKE} -C libs/prelude IDRIS2=../../${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} + ${MAKE} -C libs/prelude IDRIS2=${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} base: prelude - ${MAKE} -C libs/base IDRIS2=../../${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} + ${MAKE} -C libs/base IDRIS2=${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} network: prelude - ${MAKE} -C libs/network IDRIS2=../../${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} + ${MAKE} -C libs/network IDRIS2=${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} contrib: base - ${MAKE} -C libs/contrib IDRIS2=../../${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} + ${MAKE} -C libs/contrib IDRIS2=${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} test-lib: contrib - ${MAKE} -C libs/test IDRIS2=../../${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} + ${MAKE} -C libs/test IDRIS2=${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} libs : prelude base contrib network test-lib testbin: - @${MAKE} -C tests testbin IDRIS2=../${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} IDRIS2_DATA=${IDRIS2_TEST_DATA} IDRIS2_LIBS=${IDRIS2_TEST_LIBS} + @${MAKE} -C tests testbin IDRIS2=${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} IDRIS2_DATA=${IDRIS2_TEST_DATA} IDRIS2_LIBS=${IDRIS2_TEST_LIBS} test: testbin @echo @echo "NOTE: \`${MAKE} test\` does not rebuild Idris or the libraries packaged with it; to do that run \`${MAKE}\`" @if [ ! -x "${TARGET}" ]; then echo "ERROR: Missing IDRIS2 executable. Cannot run tests!\n"; exit 1; fi @echo - @${MAKE} -C tests only=$(only) IDRIS2=../../../${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} IDRIS2_DATA=${IDRIS2_TEST_DATA} IDRIS2_LIBS=${IDRIS2_TEST_LIBS} + @${MAKE} -C tests only=$(only) IDRIS2=${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} IDRIS2_DATA=${IDRIS2_TEST_DATA} IDRIS2_LIBS=${IDRIS2_TEST_LIBS} support: @${MAKE} -C support/c @@ -151,11 +151,11 @@ install-support: @${MAKE} -C support/refc install install-libs: - ${MAKE} -C libs/prelude install IDRIS2?=../../${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} - ${MAKE} -C libs/base install IDRIS2?=../../${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} - ${MAKE} -C libs/contrib install IDRIS2?=../../${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} - ${MAKE} -C libs/network install IDRIS2?=../../${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} - ${MAKE} -C libs/test install IDRIS2?=../../${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} + ${MAKE} -C libs/prelude install IDRIS2?=${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} + ${MAKE} -C libs/base install IDRIS2?=${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} + ${MAKE} -C libs/contrib install IDRIS2?=${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} + ${MAKE} -C libs/network install IDRIS2?=${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} + ${MAKE} -C libs/test install IDRIS2?=${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} .PHONY: bootstrap bootstrap-build bootstrap-racket bootstrap-racket-build bootstrap-test bootstrap-clean diff --git a/tests/idris2/pkg002/run b/tests/idris2/pkg002/run index 1b84da25b..4b6dfd2dd 100755 --- a/tests/idris2/pkg002/run +++ b/tests/idris2/pkg002/run @@ -1,5 +1,5 @@ cd src/Top -../../$1 --find-ipkg --check Dummy.idr +$1 --find-ipkg --check Dummy.idr cd ../.. rm -rf build