diff --git a/.gitignore b/.gitignore index 3693c563d..73011cc27 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ /libs/**/build +/tests/**/build /tests/**/output /tests/**/*.so /tests/**/*.dylib diff --git a/INSTALL.md b/INSTALL.md index 577e36a18..65ed2c727 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -19,7 +19,7 @@ Racket. This will be addressed soon!] 0: Set the PREFIX ----------------- -* Change the `prefix` in `config.mk`. The default is to install in +* Change the `PREFIX` in `config.mk`. The default is to install in `$HOME/.idris2sh` If you have an existing Idris 2, go to step 1b. Otherwise, read on... @@ -27,8 +27,8 @@ If you have an existing Idris 2, go to step 1b. Otherwise, read on... Make sure that: * `$PREFIX/bin` is in your `PATH` -* `$PREFIX/lib` is in your `LD_LIBRARY_PATH` (so that the system knows where - to look for library support code) +* `$PREFIX/lib` is in your `LD_LIBRARY_PATH` or `DYLD_LIBRARY_PATH` if on + `macOS` (so that the system knows where to look for library support code) 1a: Installing without an existing Idris 2 ------------------------------------------ @@ -63,7 +63,7 @@ Idris 2 installation.) 1b: Installing with an existing Idris 2 --------------------------------------- -If you have Idris-2-in-Idris-1 installed: +If you have Idris-2-in-Idris-1 installed: * `make all && make install` diff --git a/Makefile b/Makefile index eb5ea7425..d55ac491d 100644 --- a/Makefile +++ b/Makefile @@ -13,32 +13,30 @@ MINOR=2 PATCH=0 GIT_SHA1= -VER_TAG= ifeq ($(shell git status >/dev/null 2>&1; echo $$?), 0) # inside a git repo ifneq ($(shell git describe --exact-match --tags >/dev/null 2>&1; echo $$?), 0) # not tagged as a released version, so add sha1 of this build in between releases GIT_SHA1 := $(shell git rev-parse --short=9 HEAD) - VER_TAG := -${GIT_SHA1} endif endif -IDRIS2_SUPPORT := libidris2_support${SHLIB_SUFFIX} export IDRIS2_VERSION := ${MAJOR}.${MINOR}.${PATCH} -IDRIS2_VERSION_TAG := ${IDRIS2_VERSION}${VER_TAG} -CG ?= ${IDRIS2_CG} +IDRIS2_SUPPORT := libidris2_support${SHLIB_SUFFIX} +CG ?= ${IDRIS2_CG} ifneq (${CG},racket) IDRIS2_IPKG := idris2.ipkg else IDRIS2_IPKG := idris2rkt.ipkg endif -export SCHEME export IDRIS2_BOOT_PATH = ${CURDIR}/libs/prelude/build/ttc:${CURDIR}/libs/base/build/ttc:${CURDIR}/libs/network/build/ttc -export IDRIS2_CURDIR = ${CURDIR} -.PHONY: all support clean support-clean bootstrap init-bootstrap idris2-exec ${TARGET} +export SCHEME + + +.PHONY: all idris2-exec ${TARGET} support support-clean clean distclean all: support ${TARGET} libs @@ -83,6 +81,7 @@ clean-libs: clean: clean-libs support-clean -${IDRIS2_BOOT} --clean ${IDRIS2_IPKG} + ${MAKE} -C tests clean $(RM) -r build install: install-idris2 install-support install-libs @@ -112,6 +111,9 @@ install-libs: libs ${MAKE} -C libs/network install IDRIS2=../../${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} IDRIS2_VERSION=${IDRIS2_VERSION} ${MAKE} -C libs/contrib install IDRIS2=../../${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} + +.PHONY: bootstrap bootstrap-racket bootstrap-clean + bootstrap: support cp support/c/${IDRIS2_SUPPORT} bootstrap/idris2sh_app sed s/libidris2_support.so/${IDRIS2_SUPPORT}/g bootstrap/idris2sh_app/idris2sh.ss > bootstrap/idris2sh_app/idris2-boot.ss @@ -131,3 +133,15 @@ else sed -i 's|__PREFIX__|${CURDIR}/bootstrap|g' bootstrap/idris2boot.rkt endif sh ./bootstrap-rkt.sh + +bootstrap-clean: + $(RM) -r bootstrap/bin bootstrap/lib bootstrap/idris2-${IDRIS2_VERSION} + $(RM) bootstrap/idris2boot* bootstrap/idris2sh_app/idris2-boot.* bootstrap/idris2sh_app/${IDRIS2_SUPPORT} + + +.PHONY: distclean + +distclean: clean bootstrap-clean + @find . -type f -name '*.ttc' -exec rm -f {} \; + @find . -type f -name '*.ttm' -exec rm -f {} \; + @find . -type f -name '*.ibc' -exec rm -f {} \; diff --git a/tests/Makefile b/tests/Makefile index c345c309a..d125edc75 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,10 +1,12 @@ INTERACTIVE ?= --interactive -test: - $(RM) -rf build +test: clean ${IDRIS2_BOOT} --build tests.ipkg @./build/exec/runtests $(IDRIS2) $(INTERACTIVE) --only $(only) clean: - find . -name '*.ibc' | xargs rm -f - find . -name 'output' | xargs rm -f + $(RM) -r build + @find . -type f -name 'output' -exec rm -rf {} \; + @find . -type f -name '*.ttc' -exec rm -f {} \; + @find . -type f -name '*.ttm' -exec rm -f {} \; + @find . -type f -name '*.ibc' -exec rm -f {} \; diff --git a/tests/chez/chez010/Makefile b/tests/chez/chez010/Makefile index eb85a77f9..0e899b6ea 100644 --- a/tests/chez/chez010/Makefile +++ b/tests/chez/chez010/Makefile @@ -1,4 +1,4 @@ -include $(IDRIS2_CURDIR)/config.mk +include ../../../config.mk TARGET = libcb @@ -22,7 +22,7 @@ $(TARGET)$(SHLIB_SUFFIX): $(OBJS) .PHONY: clean clean : - rm -f $(OBJS) $(TARGET)$(SHLIB_SUFFIX) + $(RM) $(OBJS) $(TARGET)$(SHLIB_SUFFIX) cleandep: clean - rm -f $(DEPS) + $(RM) $(DEPS) diff --git a/tests/chez/chez013/Makefile b/tests/chez/chez013/Makefile index e676e0c79..90ff97c32 100644 --- a/tests/chez/chez013/Makefile +++ b/tests/chez/chez013/Makefile @@ -1,4 +1,4 @@ -include $(IDRIS2_CURDIR)/config.mk +include ../../../config.mk TARGET = libstruct @@ -22,7 +22,7 @@ $(TARGET)$(SHLIB_SUFFIX): $(OBJS) .PHONY: clean clean : - rm -f $(OBJS) $(TARGET)$(SHLIB_SUFFIX) + $(RM) $(OBJS) $(TARGET)$(SHLIB_SUFFIX) cleandep: clean - rm -f $(DEPS) + $(RM) $(DEPS)