ALLLSP = clue.lsp clx-patch.lsp window-doc.lsp event-parse.lsp defcontact.lsp \
         intrinsics.lsp caches.lsp resource.lsp gray.lsp cursor.lsp \
         events.lsp virtual.lsp shells.lsp root-gmgmt.lsp package.lsp

ALLFAS = clue.fas clx-patch.fas window-doc.fas event-parse.fas defcontact.fas \
         intrinsics.fas caches.fas resource.fas gray.fas cursor.fas \
         events.fas virtual.fas shells.fas root-gmgmt.fas package.fas

# Name of directory for CLUE and CLX
CLXDIR = ../../clx/
CLUEDIR = ./
CLUEEXAMPLESDIR = examples/
CLUEDEMODIR = demo/

INIT = "(defvar *clx-directory* \"${CLXDIR}\") (defvar *clue-directory* \"${CLUEDIR}\") (defvar *clue-examples-directory* \"${CLUEEXAMPLESDIR}\") (defvar *clue-demo-directory* \"${CLUEDEMODIR}\") (load \"$(CLUEDIR)defsystem\")"


# Choose one of the packers:

# Standard Unix packer. Requires GNU tar.
PACK = tar
PACKOPT = cvfhz
PACKEXT = .tar.Z

# The one with the best performance.
#PACK = lha
#PACKOPT = a
#PACKEXT = .lzh

# Popular DOS packer.
#PACK = zip
#PACKOPT = -r
#PACKEXT = .zip

# Popular Atari packer.
#PACK = zoo
#PACKOPT = -add
#PACKEXT = .zoo


# defaults 
all : clue
clue : defsystem.fas stamp.fas $(ALLFAS) clue.mem

defsystem.fas defsystem.lib : defsystem.lsp
	clisp -q -c defsystem

$(ALLFAS) : stamp.fas

stamp.fas : compile-clue

compile-clue : $(ALLLSP) defsystem.fas
	clisp -M ../../clx.mem -m 5MB -q -x $(INIT)' (compile-clue)'
	touch stamp.fas

clue.mem : load-clue

load-clue : defsystem.fas $(ALLFAS)
	clisp -M ../../clx.mem -m 5MB -q -x $(INIT)' (load-clue) (saveinitmem)'
	mv lispinit.mem clue.mem

clean: force
	-rm -f *.fas *.lib *.mem

force:

