Idris2-boot/Makefile

61 lines
1.6 KiB
Makefile
Raw Normal View History

2019-07-10 01:45:33 +03:00
PREFIX ?= ${HOME}/.idris2
2019-07-26 17:44:27 +03:00
IDRIS_VERSION := $(shell idris --version)
2019-07-26 21:10:22 +03:00
VALID_IDRIS_VERSION_REGEXP = "1.3.2.*"
export IDRIS2_PATH = ${CURDIR}/libs/prelude/build:${CURDIR}/libs/base/build
export IDRIS2_DATA = ${CURDIR}/support
2019-07-10 01:45:33 +03:00
-include custom.mk
2019-07-26 10:50:54 +03:00
.PHONY: ttimp idris2 prelude test base clean lib_clean check_version
all: idris2 libs test
2019-07-26 10:50:54 +03:00
check_version:
2019-07-26 17:44:27 +03:00
@echo "Using idris version: $(IDRIS_VERSION)"
@if [ $(shell expr $(IDRIS_VERSION) : $(VALID_IDRIS_VERSION_REGEXP)) -eq 0 ]; then echo "Wrong idris version, expected version matching $(VALID_IDRIS_VERSION_REGEXP)"; exit 1; fi
2019-07-26 10:50:54 +03:00
idris2: src/YafflePaths.idr check_version
idris --build idris2.ipkg
src/YafflePaths.idr:
echo 'module YafflePaths; export yprefix : String; yprefix = "${PREFIX}"' > src/YafflePaths.idr
prelude:
make -C libs/prelude IDRIS2=../../idris2
2019-06-15 13:54:22 +03:00
base: prelude
make -C libs/base IDRIS2=../../idris2
2019-06-15 13:54:22 +03:00
libs : prelude base
clean: clean-libs
make -C src clean
make -C tests clean
rm -f runtests
rm -f idris2
clean-libs:
make -C libs/prelude clean
2019-06-15 13:54:22 +03:00
make -C libs/base clean
test:
idris --build tests.ipkg
2019-07-28 19:27:51 +03:00
make -C tests only=$(only)
install: all install-exec install-libs
install-exec: idris2
2019-07-15 09:42:54 +03:00
mkdir -p ${PREFIX}/bin
mkdir -p ${PREFIX}/idris2/lib
2019-07-15 09:42:54 +03:00
mkdir -p ${PREFIX}/idris2/support/chez
mkdir -p ${PREFIX}/idris2/support/chicken
mkdir -p ${PREFIX}/idris2/support/racket
2019-07-12 14:06:25 +03:00
install idris2 ${PREFIX}/bin
install support/chez/* ${PREFIX}/idris2/support/chez
install support/chicken/* ${PREFIX}/idris2/support/chicken
install support/racket/* ${PREFIX}/idris2/support/racket
install-libs: libs
make -C libs/prelude install IDRIS2=../../idris2
2019-06-15 13:54:22 +03:00
make -C libs/base install IDRIS2=../../idris2