2019-09-04 18:20:26 +03:00
|
|
|
IDRIS2_VERSION := 0.0
|
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.*"
|
2019-09-04 14:41:16 +03:00
|
|
|
export IDRIS2_PATH = ${CURDIR}/libs/prelude/build/ttc:${CURDIR}/libs/base/build/ttc
|
2019-05-07 17:06:00 +03:00
|
|
|
export IDRIS2_DATA = ${CURDIR}/support
|
2019-05-07 12:42:45 +03:00
|
|
|
|
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
|
2019-05-07 12:42:45 +03:00
|
|
|
|
2019-07-09 10:31:35 +03:00
|
|
|
all: idris2 libs test
|
2019-05-07 12:42:45 +03:00
|
|
|
|
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
|
2019-06-09 13:58:29 +03:00
|
|
|
idris --build idris2.ipkg
|
2019-05-07 12:42:45 +03:00
|
|
|
|
|
|
|
src/YafflePaths.idr:
|
2019-09-04 18:20:26 +03:00
|
|
|
echo 'module YafflePaths; export version : String; version = "${IDRIS2_VERSION}";' > src/YafflePaths.idr
|
|
|
|
echo 'export yprefix : String; yprefix = "${PREFIX}"' >> src/YafflePaths.idr
|
2019-05-07 12:42:45 +03:00
|
|
|
|
2019-06-13 18:50:24 +03:00
|
|
|
prelude:
|
|
|
|
make -C libs/prelude IDRIS2=../../idris2
|
2019-05-07 12:42:45 +03:00
|
|
|
|
2019-06-15 13:54:22 +03:00
|
|
|
base: prelude
|
|
|
|
make -C libs/base IDRIS2=../../idris2
|
2019-05-07 12:42:45 +03:00
|
|
|
|
2019-07-22 18:21:38 +03:00
|
|
|
network: prelude
|
2019-09-04 18:20:26 +03:00
|
|
|
make -C libs/network IDRIS2_VERSION=${IDRIS2_VERSION} IDRIS2=../../idris2
|
|
|
|
make -C libs/network test IDRIS2_VERSION=${IDRIS2_VERSION} IDRIS2=../../idris2
|
2019-07-22 18:21:38 +03:00
|
|
|
|
|
|
|
libs : prelude base network
|
2019-05-07 12:42:45 +03:00
|
|
|
|
2019-07-14 13:23:58 +03:00
|
|
|
clean: clean-libs
|
2019-05-07 12:42:45 +03:00
|
|
|
make -C src clean
|
|
|
|
make -C tests clean
|
|
|
|
rm -f runtests
|
2019-06-09 13:58:29 +03:00
|
|
|
rm -f idris2
|
2019-05-07 12:42:45 +03:00
|
|
|
|
2019-07-14 13:23:58 +03:00
|
|
|
clean-libs:
|
2019-06-13 18:50:24 +03:00
|
|
|
make -C libs/prelude clean
|
2019-06-15 13:54:22 +03:00
|
|
|
make -C libs/base clean
|
2019-07-22 18:21:38 +03:00
|
|
|
make -C libs/network clean
|
2019-05-07 12:42:45 +03:00
|
|
|
|
|
|
|
test:
|
|
|
|
idris --build tests.ipkg
|
2019-07-28 21:14:11 +03:00
|
|
|
@make -C tests only=$(only)
|
2019-05-07 12:42:45 +03:00
|
|
|
|
2019-07-14 13:23:58 +03:00
|
|
|
install: all install-exec install-libs
|
|
|
|
|
|
|
|
install-exec: idris2
|
2019-07-15 09:42:54 +03:00
|
|
|
mkdir -p ${PREFIX}/bin
|
2019-09-04 18:20:26 +03:00
|
|
|
mkdir -p ${PREFIX}/idris2-${IDRIS2_VERSION}/lib
|
|
|
|
mkdir -p ${PREFIX}/idris2-${IDRIS2_VERSION}/support/chez
|
|
|
|
mkdir -p ${PREFIX}/idris2-${IDRIS2_VERSION}/support/chicken
|
|
|
|
mkdir -p ${PREFIX}/idris2-${IDRIS2_VERSION}/support/racket
|
2019-07-12 14:06:25 +03:00
|
|
|
install idris2 ${PREFIX}/bin
|
2019-09-04 18:20:26 +03:00
|
|
|
install support/chez/* ${PREFIX}/idris2-${IDRIS2_VERSION}/support/chez
|
|
|
|
install support/chicken/* ${PREFIX}/idris2-${IDRIS2_VERSION}/support/chicken
|
|
|
|
install support/racket/* ${PREFIX}/idris2-${IDRIS2_VERSION}/support/racket
|
2019-07-12 14:04:36 +03:00
|
|
|
|
|
|
|
install-libs: libs
|
2019-06-13 18:50:24 +03:00
|
|
|
make -C libs/prelude install IDRIS2=../../idris2
|
2019-06-15 13:54:22 +03:00
|
|
|
make -C libs/base install IDRIS2=../../idris2
|
2019-09-04 18:20:26 +03:00
|
|
|
make -C libs/network install IDRIS2=../../idris2 IDRIS2_VERSION=${IDRIS2_VERSION}
|