
ROOT = /home/layer/src

ON_WINDOWS = $(shell if test -d "c:/"; then echo yes; else echo no; fi)

LISP_IMAGE = mlisp

ifeq ($(ON_WINDOWS),yes)
mlisp = "/c/Program Files/acl80/$(LISP_IMAGE)" +M +B +cn
else
mlisp = $(LISP_IMAGE)
endif

%.fasl : %.cl
	$(mlisp) -qq -batch -L $(ROOT)/.clinit.cl -W -C $< -kill

copysource: FORCE
ifndef SOURCE_DEST
	@echo SOURCE_DEST not set
	@exit 1
endif
ifndef SOURCE_FILES
ifndef ROOT_SOURCE_FILES
	@echo Neither SOURCE_FILES nor ROOT_SOURCE_FILES are set.
	@exit 1
endif
	@if test -d $(SOURCE_DEST); then \
		echo SOURCE_DEST points to an existing directory.; \
		exit 1; \
	fi
endif
ifdef ROOT_SOURCE_FILES
	tar cf - $(ROOT_SOURCE_FILES) | (cd $(ROOT); tar xvf -)
endif
ifdef SOURCE_FILES
	mkdir $(SOURCE_DEST)
	tar cf - $(SOURCE_FILES) | (cd $(SOURCE_DEST); tar xvf -)
endif
