stepA_mal)
endef
+LISP ?= sbcl
+ABCL ?= abcl
+
+STANDALONE_EXE = sbcl clisp ccl ecl cmucl
+
ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
SOURCES_LISP := src/env.lisp src/core.lisp src/stepA_mal.lisp
SOURCES := src/utils.lisp src/types.lisp src/reader.lisp src/printer.lisp $(SOURCES_LISP)
-LISP ?= sbcl
-ABCL ?= abcl
# Record the Common Lisp implementation used for all steps built in this
# invocation This is used in the targets to rebuild the step if the
# image even if invoked from some directory different from where it
# currently resides
step% : src/step%.lisp src/utils.lisp src/types.lisp src/env.lisp src/printer.lisp src/reader.lisp src/core.lisp hist/%_impl
-ifeq ($(LISP),abcl)
+
+ifeq ($(LISP),clisp)
+ @echo "=============================================================="
+ @echo "WARNING: This build might fail since GNU Clisp does not have bundled version of asdf (yet)"
+ @echo "Please do something like below to make it work"
+ @echo "(mkdir -p ~/common-lisp/ && cd ~/common-lisp && git clone -b release https://gitlab.common-lisp.net/asdf/asdf.git && cd asdf && make)"
+ @echo "=============================================================="
+endif
+
+ifneq ($(filter $(LISP),$(STANDALONE_EXE)),)
+ cl-launch --wrap 'if [ -z "$$CL_LAUNCH_VERSION" ] ; then cd "$$(dirname $$CL_LAUNCH_FILE)" ; fi' --verbose --lisp $(LISP) --source-registry $(ROOT_DIR) --system $@ --dump '!' -o $@ --entry 'mal:main'
+else ifeq ($(LISP),abcl)
echo -n '#!/bin/sh\ncd `dirname $$0` ; $(ABCL) --noinform --noinit --nosystem --load run-abcl.lisp -- $@ $$@' > $@
chmod +x $@
else