prefix = /usr/local
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
lisplibdir = $(libdir)/gcl-1.0

LISP = gcl

ALLLISP = attributes.lisp buffer.lisp bufmac.lisp clx.lisp depdefs.lisp \
          dependent.lisp describe.lisp display.lisp fonts.lisp gcontext.lisp \
          graphics.lisp image.lisp input.lisp keysyms.lisp macros.lisp manager.lisp \
          package.lisp requests.lisp resource.lisp text.lisp trace.lisp

ALLO =    attributes.o buffer.o bufmac.o clx.o depdefs.o \
          dependent.o describe.o display.o fonts.o gcontext.o \
          graphics.o image.o input.o keysyms.o macros.o manager.o \
          package.o requests.o resource.o text.o trace.o

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

all: defsystem.o stamp.o $(ALLO) gclx

defsystem.o : defsystem.lisp
	echo '(compile-file "defsystem")' | $(LISP)

$(ALLO) : stamp.o

stamp.o : $(ALLLISP) defsystem.o
	echo '(load "defsystem") (compile-clx)' | $(LISP)
	touch stamp.o

gclx : defsystem.o $(ALLO)
	echo '(load "defsystem") (load-clx "" :macrosp t) (si::save-system "gclx")' | $(LISP)

install : gclx
	cp gclx $(lisplibdir)/unixport/gclx
	(echo '#!/bin/sh' ; echo 'exec $(lisplibdir)/unixport/gclx -dir $(lisplibdir)/unixport/ -libdir $(lisplibdir)/') > $(bindir)/clx
	chmod a+x $(bindir)/clx

clean: force
	-rm -f *.o *.data gclx

force:

