Skip to content

Commit

Permalink
Use an already existing K_HOME environment variable. (#36)
Browse files Browse the repository at this point in the history
* find-k.mak: Accept an already existing K_HOME variable

* Use `which kompile` to set K_HOME as last resort.

* More explicit path resolution
  • Loading branch information
gtrepta authored Oct 8, 2024
1 parent 1321a53 commit 052e81e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion find-k.mak
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
MAKEFILE_PATH := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
ifneq (,$(wildcard ${MAKEFILE_PATH}/../../../include/kframework/ktest.mak))
ifneq (,${K_HOME})
else ifneq (,$(wildcard ${MAKEFILE_PATH}/../../../include/kframework/ktest.mak))
export K_HOME?=${MAKEFILE_PATH}/../../../
else ifneq (,$(wildcard ${MAKEFILE_PATH}/../include/kframework/ktest.mak))
export K_HOME?=${MAKEFILE_PATH}/..
else ifneq (,$(wildcard /usr/include/kframework/ktest.mak))
export K_HOME?=/usr
else ifneq (,$(wildcard /usr/local/include/kframework/ktest.mak))
export K_HOME?=/usr/local
else ifneq (,$(shell which kompile))
export K_HOME?=$(abspath $(dir $(shell which kompile))/..)
else
$(error "Could not find installation of K. Please set K_HOME environment variable to your K installation.")
endif

0 comments on commit 052e81e

Please sign in to comment.