1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
SHELL := /bin/bash
FILES = package.lisp iterate.lisp iterate-test.lisp iterate-pg.lisp iterate.asd
TEXFILES = doc/iter-man.tex doc/iter-bare.tex doc/aimemo.sty doc/GNUmakefile
PDFFILES = doc/iter-man.pdf doc/iter-bare.pdf
defaultLisps = abcl allegro ccl clasp clisp cmucl ecl lispworks sbcl
ifdef ITERATE_TEST_LISPS
lisps ?= ${ITERATE_TEST_LISPS}
else
lisps ?= ${defaultLisps}
endif
# If you need to sudo in order to use docker, modify this.
DOCKER ?= docker
sourceDirectory := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
l ?= sbcl
ABCL ?= abcl
ALLEGRO ?= alisp
ALLEGROMODERN ?= mlisp
CCL ?= ccl
CLISP ?= clisp
CLASP ?= clasp
CMUCL ?= cmucl
ECL ?= ecl
GCL ?= gcl
LISPWORKS ?= lispworks
MKCL ?= mkcl
SBCL ?= sbcl
SCL ?= scl
XCL ?= xcl
ifeq ($(l), abcl)
command ?= ${ABCL}
loadfile = --noinit --nosystem --noinform --load
else ifeq ($(l), allegro)
command ?= ${ALLEGRO}
loadfile = -q -L
else ifeq ($(l), ccl)
loadfile = --no-init --quiet --load
command ?= ${CCL}
else ifeq ($(l), clasp)
command ?= ${CLASP}
loadfile = --norc --load
else ifeq ($(l), clisp)
command ?= ${CLISP}
loadfile = -norc --silent -ansi
else ifeq ($(l), cmucl)
command ?= ${CMUCL}
loadfile = -noinit -batch -load
else ifeq ($(l), ecl)
command ?= ${ECL}
loadfile = --norc --load
else ifeq ($(l), lispworks)
command ?= ${LISPWORKS} # this is just a convention...
loadfile = -siteinit - -init - -load
else ifeq ($(l), sbcl)
command ?= ${SBCL}
loadfile = --no-userinit --no-sysinit --load
else
$(error Don\'t know how to operate on implementation $(l))
endif
.PHONY: test clear-cache test-all-lisps test-docker-repl test-docker-lisp
distrib:
tar czf iterate.tgz $(FILES) $(TEXFILES) $(PDFFILES)
clear-cache:
rm -rf test/cache
test: clear-cache
mkdir -p test
set -o pipefail ; \
$(command) $(loadfile) test.lisp | tee test/${l}.text ; \
exit ${PIPESTATUS[0]}
# Useful for reproducing test failures with Docker.
test-docker-repl: clear-cache
@${DOCKER} run --rm -i -t --pull always -u $(shell id -u):$(shell id -g) -v $(sourceDirectory):$(sourceDirectory) -w $(sourceDirectory)/test clfoundation/${l}:latest
test-docker-lisp: clear-cache
@${DOCKER} run --rm -i -t --pull always -u $(shell id -u):$(shell id -g) -v $(sourceDirectory):$(sourceDirectory) -w $(sourceDirectory) clfoundation/${l}:latest make test l=${l} t=${t}
test-all-lisps:
@for lisp in ${lisps} ; do ${MAKE} test l=$$lisp t=${t}|| { echo "$${lisp} failed" ; exit 1 ; } ; done
|