# Makefile for the CLISP binaries
# DO NOT EDIT! GENERATED AUTOMATICALLY!
# This file was created on host linuix.mathematik.uni-karlsruhe.de as the output of the command:
# ./makemake win32gcc gcc

# -------------- Start of configurable section --------------------

# Directories used by "make install":
prefix = /usr/local
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
mandir = $(exec_prefix)/man
libdir = $(exec_prefix)/lib
lisplibdir = $(libdir)/lisp
datadir = $(prefix)/share
localedir = $(datadir)/locale

# List of add-on modules:
# stdwin               the stdwin library as a separate module
# queens               the queens function as a separate module
# clx/mit-clx          classical X11 interface
# clx/new-clx          faster X11 interface (replaces clx/mit-clx)
MODULES = 

# Programs used by "make":
CC = gcc
CFLAGS = -W -Wswitch -Wcomment -Wpointer-arith -Wimplicit -Wreturn-type -fomit-frame-pointer -O2
CPP = gcc -E
CLFLAGS =  -x none
LIBS = libintl.a libreadline.a  -ltermcap
X_LIBS = 

MAKE = make
RM = rm -f
CP = cp -p
LN = ln -s
MV = mv
CAT = cat
TOUCH = touch
GREP = grep
AR = ar
RANLIB = ranlib

# Programs used by "make install":
INSTALL = cp -p
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL)

# Programs used by "make distrib":

LIBGCC = `$(CC) -print-libgcc-file-name` # something like /usr/somewhere/libgcc.a
# formatter for manual page
ROFF_MAN = nroff -man # try "groff -Tascii -mandoc" or "nroff -man"
ROFF_DVI =  # try "groff -Tdvi -mandoc"

# -------------- End of configurable section --------------------

# 
#                       Requirements for add-on modules
#                       -------------------------------
# 
# The general layout of add-on modules is described in ../doc/module.txt.
# The requirements made there (i.e. the existence of a "link.sh" file
# which defines certain variables) make sure that such an add-on module
# can be distributed with CLISP.
# 
# If you want an add-on module to be _built_ automatically with CLISP,
# the following additional requirements have to be obeyed.
# 
#   1. The module must be located in a subdirectory of clisp's source
#      directory.
#      Examples: clisp/src/ wildcard/
#                clisp/src/ bindings/linux/
# 
#   2. If the module contains a file called "configure", it is assumed
#      to be a GNU autoconf generated configuration file, and is called
#      with a "--cache-file=..." argument. It should generate platform
#      dependent header files, Makefiles and the like.
# 
#   3. The module should contain a Makefile (maybe generated by requirement 2),
#      which defines the following targets:
# 
#        clisp-module
# 
#           This target builds the file mentioned by the link.sh file.
#           The following makefile variables can be used:
#             CC                 the C compiler used to compile the CLISP source
#             CFLAGS             the C compiler flags
#             INCLUDES           a directory containing CLISP header files
#             LISPBIBL_INCLUDES  if you #include "lispbibl.c", put this onto
#                                the dependency line
#             CLFLAGS            the C compiler flags when linking an executable
#             LIBS               the libraries used when linking an executable
#             RANLIB             the name of the "ranlib" command
#             CLISP              a command which calls the already built
#                                "base" clisp.
#           Typically, you will have rules like this in your Makefile:
#               foo.o : foo.c
#                       $(CC) $(CFLAGS) -I$(INCLUDES) -c foo.c
#               foo.fas : foo.lsp
#                       $(CLISP) -c foo.lsp
# 
#        clisp-module-wide
# 
#           This target does the same as clisp-module, plus it builds the
#           object files in wide mode as well.
#           Typically, you will have rules like this in your Makefile:
#               wfoo.o : foo.c
#                       $(CC) $(CFLAGS) -DWIDE -I$(INCLUDES) -c foo.c -o wfoo.o
# 
#        clisp-module-distrib
# 
#           This target copies the module into a temporary distribution
#           directory, on the same disk.
#           The following makefile variables can be used:
#             distribdir       the name of temporary distribution directory
#             LN               command to make hard links (works also for
#                              symbolic links)
#           Typically, this target will look like this:
#
#               DISTRIBFILES = <the non-wide NEW_FILES mentioned in link.sh> \
#                              <doc files>
#               clisp-module-distrib : clisp-module force
#                       $(LN) $(DISTRIBFILES) $(distribdir)
# 
#        clisp-module-distrib-wide
# 
#           This target does the same as clisp-module-distrib, but including
#           the wide mode object files.
#           Typically, this target will look like this:
#
#               WDISTRIBFILES = $(DISTRIBFILES) <the wide NEW_FILES in link.sh>
#               clisp-module-distrib-wide : clisp-module-wide force
#                       $(LN) $(WDISTRIBFILES) $(distribdir)
# 
# If these requirements are obeyed, this Makefile will automatically build
# the add-on module and make it part of the "full" distribution -- all you
# need to do is to add its name to the MODULES definition line above.
# 

SHELL = /bin/sh

COMMENT5 = ./comment5
ANSIDECL = ./ansidecl
TXT2C = ./txt2c -I'../'

DFILES = \
spvw.d \
spvwtabf.d \
spvwtabs.d \
spvwtabo.d \
eval.d \
control.d \
pathname.d \
stream.d \
socket.d \
io.d \
array.d \
hashtabl.d \
list.d \
package.d \
record.d \
sequence.d \
charstrg.d \
debug.d \
error.d \
misc.d \
time.d \
predtype.d \
symbol.d \
lisparit.d \
graph.d \
unixaux.d \
lispbibl.d \
fsubr.d \
subr.d \
pseudofun.d \
constsym.d \
constobj.d \
unix.d \
constpack.d \
avl.d \
sort.d \
subrkw.d \
bytecode.d \
errunix.d \
aridecl.d \
arilev0.d \
arilev1.d \
intelem.d \
intlog.d \
intplus.d \
intcomp.d \
intbyte.d \
intmal.d \
intdiv.d \
intgcd.d \
int2adic.d \
intsqrt.d \
intprint.d \
intread.d \
rational.d \
sfloat.d \
ffloat.d \
dfloat.d \
lfloat.d \
flo_konv.d \
flo_rest.d \
realelem.d \
realrand.d \
realtran.d \
compelem.d \
comptran.d \
arilev1c.d \
arilev1e.d \
arilev1i.d \
genclisph.d \
modules.d \
noreadline.d

CFILES = \
spvw.c \
spvwtabf.c \
spvwtabs.c \
spvwtabo.c \
eval.c \
control.c \
pathname.c \
stream.c \
socket.c \
io.c \
array.c \
hashtabl.c \
list.c \
package.c \
record.c \
sequence.c \
charstrg.c \
debug.c \
error.c \
misc.c \
time.c \
predtype.c \
symbol.c \
lisparit.c \
graph.c \
unixaux.c \
lispbibl.c \
fsubr.c \
subr.c \
pseudofun.c \
constsym.c \
constobj.c \
unix.c \
constpack.c \
avl.c \
sort.c \
subrkw.c \
bytecode.c \
errunix.c \
aridecl.c \
arilev0.c \
arilev1.c \
intelem.c \
intlog.c \
intplus.c \
intcomp.c \
intbyte.c \
intmal.c \
intdiv.c \
intgcd.c \
int2adic.c \
intsqrt.c \
intprint.c \
intread.c \
rational.c \
sfloat.c \
ffloat.c \
dfloat.c \
lfloat.c \
flo_konv.c \
flo_rest.c \
realelem.c \
realrand.c \
realtran.c \
compelem.c \
comptran.c \
arilev1c.c \
arilev1e.c \
arilev1i.c \
genclisph.c \
modules.c \
noreadline.c

OBJECTS = \
spvw.o \
spvwtabf.o \
spvwtabs.o \
spvwtabo.o \
eval.o \
control.o \
pathname.o \
stream.o \
socket.o \
io.o \
array.o \
hashtabl.o \
list.o \
package.o \
record.o \
sequence.o \
charstrg.o \
debug.o \
error.o \
misc.o \
time.o \
predtype.o \
symbol.o \
lisparit.o \
graph.o \
unixaux.o

LSPFILES = \
init.lsp \
defseq.lsp \
backquot.lsp \
defmacro.lsp \
macros1.lsp \
macros2.lsp \
defs1.lsp \
timezone.lsp \
places.lsp \
floatpri.lsp \
type.lsp \
defstruc.lsp \
format.lsp \
user1.lsp \
user2.lsp \
trace.lsp \
macros3.lsp \
config.lsp \
compiler.lsp \
disassem.lsp \
defs2.lsp \
loop.lsp \
clos.lsp \
conditio.lsp \
defs3.lsp \
gstream.lsp \
foreign1.lsp \
screen.lsp \
rexx1.lsp \
editor.lsp \
spanish.lsp

FASFILES = \
init.fas \
defseq.fas \
backquot.fas \
defmacro.fas \
macros1.fas \
macros2.fas \
defs1.fas \
timezone.fas \
places.fas \
floatpri.fas \
type.fas \
defstruc.fas \
format.fas \
user1.fas \
user2.fas \
trace.fas \
macros3.fas \
config.fas \
compiler.fas \
disassem.fas \
defs2.fas \
loop.fas \
clos.fas \
conditio.fas \
defs3.fas \
gstream.fas \
foreign1.fas \
screen.fas \
rexx1.fas \
editor.fas \
spanish.fas

TXTFILES = \
LISP-tutorial.txt \
CLOS-guide.txt \
cltl2.txt \
editors.txt

TESTLSPFILES = \
stage/init.lsp \
stage/defseq.lsp \
stage/backquot.lsp \
stage/defmacro.lsp \
stage/macros1.lsp \
stage/macros2.lsp \
stage/defs1.lsp \
stage/timezone.lsp \
stage/places.lsp \
stage/floatpri.lsp \
stage/type.lsp \
stage/defstruc.lsp \
stage/format.lsp \
stage/user1.lsp \
stage/user2.lsp \
stage/trace.lsp \
stage/macros3.lsp \
stage/config.lsp \
stage/compiler.lsp \
stage/disassem.lsp \
stage/defs2.lsp \
stage/loop.lsp \
stage/clos.lsp \
stage/conditio.lsp \
stage/defs3.lsp \
stage/gstream.lsp \
stage/foreign1.lsp \
stage/screen.lsp \
stage/rexx1.lsp \
stage/editor.lsp \
stage/spanish.lsp

TESTFASFILES = \
stage/init.fas \
stage/defseq.fas \
stage/backquot.fas \
stage/defmacro.fas \
stage/macros1.fas \
stage/macros2.fas \
stage/defs1.fas \
stage/timezone.fas \
stage/places.fas \
stage/floatpri.fas \
stage/type.fas \
stage/defstruc.fas \
stage/format.fas \
stage/user1.fas \
stage/user2.fas \
stage/trace.fas \
stage/macros3.fas \
stage/config.fas \
stage/compiler.fas \
stage/disassem.fas \
stage/defs2.fas \
stage/loop.fas \
stage/clos.fas \
stage/conditio.fas \
stage/defs3.fas \
stage/gstream.fas \
stage/foreign1.fas \
stage/screen.fas \
stage/rexx1.fas \
stage/editor.fas \
stage/spanish.fas


all : init allc allo lisp.run interpreted.mem halfcompiled.mem lispinit.mem manual modular $(MODULES) full clisp.c


init : intparam.h comment5 ansidecl txt2c ccmp2c $(DFILES) modules.h
	test -d linkkit || $(LN) . linkkit
	test -d base || $(LN) . base
	test -d bindings || mkdir bindings

intparam.h : intparam.c
	$(CC) $(CFLAGS) $(CLFLAGS) intparam.c -o intparam
	./intparam > intparam.h
	$(RM) intparam

comment5 : ../utils/comment5.c
	$(CC) $(CFLAGS) $(CLFLAGS) ../utils/comment5.c -o comment5

ansidecl : ../utils/ansidecl.d comment5
	$(LN) ../utils/ansidecl.d ansidecl.d
	$(COMMENT5) ansidecl.d ansidecl.c
	$(RM) ansidecl.d
	$(CC) $(CFLAGS) $(CLFLAGS) ansidecl.c -o ansidecl
	$(RM) ansidecl.c

txt2c : ../utils/txt2c.c ansidecl
	$(ANSIDECL) < ../utils/txt2c.c > txt2c.c
	$(CC) $(CFLAGS) $(CLFLAGS) txt2c.c -o txt2c
	$(RM) txt2c.c

ccmp2c : ../utils/ccmp2c.d comment5 ansidecl
	$(COMMENT5) ../utils/ccmp2c.d | $(ANSIDECL) > ccmp2c.c
	$(CC) $(CFLAGS) $(CLFLAGS) -I. ccmp2c.c -o ccmp2c
	$(RM) ccmp2c.c


version.h : VERSION
	cd ../ && $(MAKE) -f Makefile.devel src/version.h

allc : init $(CFILES)

spvw.c : spvw.d comment5 ansidecl
	$(COMMENT5) spvw.d | $(ANSIDECL) > spvw.c

spvwtabf.c : spvwtabf.d comment5 ansidecl
	$(COMMENT5) spvwtabf.d | $(ANSIDECL) > spvwtabf.c

spvwtabs.c : spvwtabs.d comment5 ansidecl
	$(COMMENT5) spvwtabs.d | $(ANSIDECL) > spvwtabs.c

spvwtabo.c : spvwtabo.d comment5 ansidecl
	$(COMMENT5) spvwtabo.d | $(ANSIDECL) > spvwtabo.c

eval.c : eval.d comment5 ansidecl
	$(COMMENT5) eval.d | $(ANSIDECL) > eval.c

control.c : control.d comment5 ansidecl
	$(COMMENT5) control.d | $(ANSIDECL) > control.c

pathname.c : pathname.d comment5 ansidecl
	$(COMMENT5) pathname.d | $(ANSIDECL) > pathname.c

stream.c : stream.d comment5 ansidecl
	$(COMMENT5) stream.d | $(ANSIDECL) > stream.c

socket.c : socket.d comment5 ansidecl
	$(COMMENT5) socket.d | $(ANSIDECL) > socket.c

io.c : io.d comment5 ansidecl
	$(COMMENT5) io.d | $(ANSIDECL) > io.c

array.c : array.d comment5 ansidecl
	$(COMMENT5) array.d | $(ANSIDECL) > array.c

hashtabl.c : hashtabl.d comment5 ansidecl
	$(COMMENT5) hashtabl.d | $(ANSIDECL) > hashtabl.c

list.c : list.d comment5 ansidecl
	$(COMMENT5) list.d | $(ANSIDECL) > list.c

package.c : package.d comment5 ansidecl
	$(COMMENT5) package.d | $(ANSIDECL) > package.c

record.c : record.d comment5 ansidecl
	$(COMMENT5) record.d | $(ANSIDECL) > record.c

sequence.c : sequence.d comment5 ansidecl
	$(COMMENT5) sequence.d | $(ANSIDECL) > sequence.c

charstrg.c : charstrg.d comment5 ansidecl
	$(COMMENT5) charstrg.d | $(ANSIDECL) > charstrg.c

debug.c : debug.d comment5 ansidecl
	$(COMMENT5) debug.d | $(ANSIDECL) > debug.c

error.c : error.d comment5 ansidecl
	$(COMMENT5) error.d | $(ANSIDECL) > error.c

misc.c : misc.d comment5 ansidecl
	$(COMMENT5) misc.d | $(ANSIDECL) > misc.c

time.c : time.d comment5 ansidecl
	$(COMMENT5) time.d | $(ANSIDECL) > time.c

predtype.c : predtype.d comment5 ansidecl
	$(COMMENT5) predtype.d | $(ANSIDECL) > predtype.c

symbol.c : symbol.d comment5 ansidecl
	$(COMMENT5) symbol.d | $(ANSIDECL) > symbol.c

lisparit.c : lisparit.d comment5 ansidecl
	$(COMMENT5) lisparit.d | $(ANSIDECL) > lisparit.c

graph.c : graph.d comment5 ansidecl
	$(COMMENT5) graph.d | $(ANSIDECL) > graph.c

unixaux.c : unixaux.d comment5 ansidecl
	$(COMMENT5) unixaux.d | $(ANSIDECL) > unixaux.c

lispbibl.c : lispbibl.d comment5 ansidecl
	$(COMMENT5) lispbibl.d | $(ANSIDECL) > lispbibl.c

fsubr.c : fsubr.d comment5 ansidecl
	$(COMMENT5) fsubr.d | $(ANSIDECL) > fsubr.c

subr.c : subr.d comment5 ansidecl
	$(COMMENT5) subr.d | $(ANSIDECL) > subr.c

pseudofun.c : pseudofun.d comment5 ansidecl
	$(COMMENT5) pseudofun.d | $(ANSIDECL) > pseudofun.c

constsym.c : constsym.d comment5 ansidecl
	$(COMMENT5) constsym.d | $(ANSIDECL) > constsym.c

constobj.c : constobj.d comment5 ansidecl
	$(COMMENT5) constobj.d | $(ANSIDECL) > constobj.c

unix.c : unix.d comment5 ansidecl
	$(COMMENT5) unix.d | $(ANSIDECL) > unix.c

constpack.c : constpack.d comment5 ansidecl
	$(COMMENT5) constpack.d | $(ANSIDECL) > constpack.c

avl.c : avl.d comment5 ansidecl
	$(COMMENT5) avl.d | $(ANSIDECL) > avl.c

sort.c : sort.d comment5 ansidecl
	$(COMMENT5) sort.d | $(ANSIDECL) > sort.c

subrkw.c : subrkw.d comment5 ansidecl
	$(COMMENT5) subrkw.d | $(ANSIDECL) > subrkw.c

bytecode.c : bytecode.d comment5 ansidecl
	$(COMMENT5) bytecode.d | $(ANSIDECL) > bytecode.c

errunix.c : errunix.d comment5 ansidecl
	$(COMMENT5) errunix.d | $(ANSIDECL) > errunix.c

aridecl.c : aridecl.d comment5 ansidecl
	$(COMMENT5) aridecl.d | $(ANSIDECL) > aridecl.c

arilev0.c : arilev0.d comment5 ansidecl
	$(COMMENT5) arilev0.d | $(ANSIDECL) > arilev0.c

arilev1.c : arilev1.d comment5 ansidecl
	$(COMMENT5) arilev1.d | $(ANSIDECL) > arilev1.c

intelem.c : intelem.d comment5 ansidecl
	$(COMMENT5) intelem.d | $(ANSIDECL) > intelem.c

intlog.c : intlog.d comment5 ansidecl
	$(COMMENT5) intlog.d | $(ANSIDECL) > intlog.c

intplus.c : intplus.d comment5 ansidecl
	$(COMMENT5) intplus.d | $(ANSIDECL) > intplus.c

intcomp.c : intcomp.d comment5 ansidecl
	$(COMMENT5) intcomp.d | $(ANSIDECL) > intcomp.c

intbyte.c : intbyte.d comment5 ansidecl
	$(COMMENT5) intbyte.d | $(ANSIDECL) > intbyte.c

intmal.c : intmal.d comment5 ansidecl
	$(COMMENT5) intmal.d | $(ANSIDECL) > intmal.c

intdiv.c : intdiv.d comment5 ansidecl
	$(COMMENT5) intdiv.d | $(ANSIDECL) > intdiv.c

intgcd.c : intgcd.d comment5 ansidecl
	$(COMMENT5) intgcd.d | $(ANSIDECL) > intgcd.c

int2adic.c : int2adic.d comment5 ansidecl
	$(COMMENT5) int2adic.d | $(ANSIDECL) > int2adic.c

intsqrt.c : intsqrt.d comment5 ansidecl
	$(COMMENT5) intsqrt.d | $(ANSIDECL) > intsqrt.c

intprint.c : intprint.d comment5 ansidecl
	$(COMMENT5) intprint.d | $(ANSIDECL) > intprint.c

intread.c : intread.d comment5 ansidecl
	$(COMMENT5) intread.d | $(ANSIDECL) > intread.c

rational.c : rational.d comment5 ansidecl
	$(COMMENT5) rational.d | $(ANSIDECL) > rational.c

sfloat.c : sfloat.d comment5 ansidecl
	$(COMMENT5) sfloat.d | $(ANSIDECL) > sfloat.c

ffloat.c : ffloat.d comment5 ansidecl
	$(COMMENT5) ffloat.d | $(ANSIDECL) > ffloat.c

dfloat.c : dfloat.d comment5 ansidecl
	$(COMMENT5) dfloat.d | $(ANSIDECL) > dfloat.c

lfloat.c : lfloat.d comment5 ansidecl
	$(COMMENT5) lfloat.d | $(ANSIDECL) > lfloat.c

flo_konv.c : flo_konv.d comment5 ansidecl
	$(COMMENT5) flo_konv.d | $(ANSIDECL) > flo_konv.c

flo_rest.c : flo_rest.d comment5 ansidecl
	$(COMMENT5) flo_rest.d | $(ANSIDECL) > flo_rest.c

realelem.c : realelem.d comment5 ansidecl
	$(COMMENT5) realelem.d | $(ANSIDECL) > realelem.c

realrand.c : realrand.d comment5 ansidecl
	$(COMMENT5) realrand.d | $(ANSIDECL) > realrand.c

realtran.c : realtran.d comment5 ansidecl
	$(COMMENT5) realtran.d | $(ANSIDECL) > realtran.c

compelem.c : compelem.d comment5 ansidecl
	$(COMMENT5) compelem.d | $(ANSIDECL) > compelem.c

comptran.c : comptran.d comment5 ansidecl
	$(COMMENT5) comptran.d | $(ANSIDECL) > comptran.c

arilev1c.c : arilev1c.d comment5 ansidecl
	$(COMMENT5) arilev1c.d | $(ANSIDECL) > arilev1c.c

arilev1e.c : arilev1e.d comment5 ansidecl
	$(COMMENT5) arilev1e.d | $(ANSIDECL) > arilev1e.c

arilev1i.c : arilev1i.d comment5 ansidecl
	$(COMMENT5) arilev1i.d | $(ANSIDECL) > arilev1i.c

genclisph.c : genclisph.d comment5 ansidecl
	$(COMMENT5) genclisph.d | $(ANSIDECL) > genclisph.c

modules.c : modules.d comment5 ansidecl
	$(COMMENT5) modules.d | $(ANSIDECL) > modules.c

noreadline.c : noreadline.d comment5 ansidecl
	$(COMMENT5) noreadline.d | $(ANSIDECL) > noreadline.c

allo : allc spvw.o spvwtabf.o spvwtabs.o spvwtabo.o eval.o control.o pathname.o stream.o socket.o io.o array.o hashtabl.o list.o package.o record.o sequence.o charstrg.o debug.o error.o misc.o time.o predtype.o symbol.o lisparit.o graph.o unixaux.o

alls : allc spvw.s spvwtabf.s spvwtabs.s spvwtabo.s eval.s control.s pathname.s stream.s socket.s io.s array.s hashtabl.s list.s package.s record.s sequence.s charstrg.s debug.s error.s misc.s time.s predtype.s symbol.s lisparit.s graph.s unixaux.s

# Normally not used (just for debugging).
alli : allc spvw.i spvwtabf.i spvwtabs.i spvwtabo.i eval.i control.i pathname.i stream.i socket.i io.i array.i hashtabl.i list.i package.i record.i sequence.i charstrg.i debug.i error.i misc.i time.i predtype.i symbol.i lisparit.i graph.i unixaux.i

spvw.i : spvw.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c constpack.c avl.c sort.c subrkw.c arilev0.c aridecl.c libintl.h version.h
	$(CPP) $(CFLAGS) spvw.c > spvw.i

spvw.s : spvw.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c constpack.c avl.c sort.c subrkw.c arilev0.c aridecl.c libintl.h version.h
	$(CC) $(CFLAGS) -S spvw.c

spvw.o : spvw.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c constpack.c avl.c sort.c subrkw.c arilev0.c aridecl.c libintl.h version.h
	$(CC) $(CFLAGS) -c spvw.c

spvwtabf.i : spvwtabf.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CPP) $(CFLAGS) spvwtabf.c > spvwtabf.i

spvwtabf.s : spvwtabf.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -S spvwtabf.c

spvwtabf.o : spvwtabf.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -c spvwtabf.c

spvwtabs.i : spvwtabs.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CPP) $(CFLAGS) spvwtabs.c > spvwtabs.i

spvwtabs.s : spvwtabs.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -S spvwtabs.c

spvwtabs.o : spvwtabs.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -c spvwtabs.c

spvwtabo.i : spvwtabo.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CPP) $(CFLAGS) spvwtabo.c > spvwtabo.i

spvwtabo.s : spvwtabo.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -S spvwtabo.c

spvwtabo.o : spvwtabo.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -c spvwtabo.c

eval.i : eval.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c bytecode.c libintl.h
	$(CPP) $(CFLAGS) eval.c > eval.i

eval.s : eval.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c bytecode.c libintl.h
	$(CC) $(CFLAGS) -S eval.c

eval.o : eval.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c bytecode.c libintl.h
	$(CC) $(CFLAGS) -c eval.c

control.i : control.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CPP) $(CFLAGS) control.c > control.i

control.s : control.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -S control.c

control.o : control.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -c control.c

pathname.i : pathname.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CPP) $(CFLAGS) pathname.c > pathname.i

pathname.s : pathname.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -S pathname.c

pathname.o : pathname.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -c pathname.c

stream.i : stream.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c arilev0.c libintl.h
	$(CPP) $(CFLAGS) -Ireadline stream.c > stream.i

stream.s : stream.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c arilev0.c libintl.h
	$(CC) $(CFLAGS) -Ireadline -S stream.c

stream.o : stream.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c arilev0.c libintl.h
	$(CC) $(CFLAGS) -Ireadline -c stream.c

socket.i : socket.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CPP) $(CFLAGS) socket.c > socket.i

socket.s : socket.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -S socket.c

socket.o : socket.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -c socket.c

io.i : io.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c arilev0.c libintl.h
	$(CPP) $(CFLAGS) io.c > io.i

io.s : io.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c arilev0.c libintl.h
	$(CC) $(CFLAGS) -S io.c

io.o : io.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c arilev0.c libintl.h
	$(CC) $(CFLAGS) -c io.c

array.i : array.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c arilev0.c libintl.h
	$(CPP) $(CFLAGS) array.c > array.i

array.s : array.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c arilev0.c libintl.h
	$(CC) $(CFLAGS) -S array.c

array.o : array.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c arilev0.c libintl.h
	$(CC) $(CFLAGS) -c array.c

hashtabl.i : hashtabl.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c arilev0.c aridecl.c libintl.h
	$(CPP) $(CFLAGS) hashtabl.c > hashtabl.i

hashtabl.s : hashtabl.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c arilev0.c aridecl.c libintl.h
	$(CC) $(CFLAGS) -S hashtabl.c

hashtabl.o : hashtabl.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c arilev0.c aridecl.c libintl.h
	$(CC) $(CFLAGS) -c hashtabl.c

list.i : list.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CPP) $(CFLAGS) list.c > list.i

list.s : list.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -S list.c

list.o : list.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -c list.c

package.i : package.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c constpack.c arilev0.c libintl.h
	$(CPP) $(CFLAGS) package.c > package.i

package.s : package.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c constpack.c arilev0.c libintl.h
	$(CC) $(CFLAGS) -S package.c

package.o : package.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c constpack.c arilev0.c libintl.h
	$(CC) $(CFLAGS) -c package.c

record.i : record.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CPP) $(CFLAGS) record.c > record.i

record.s : record.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -S record.c

record.o : record.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -c record.c

sequence.i : sequence.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CPP) $(CFLAGS) sequence.c > sequence.i

sequence.s : sequence.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -S sequence.c

sequence.o : sequence.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -c sequence.c

charstrg.i : charstrg.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CPP) $(CFLAGS) charstrg.c > charstrg.i

charstrg.s : charstrg.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -S charstrg.c

charstrg.o : charstrg.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -c charstrg.c

debug.i : debug.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CPP) $(CFLAGS) debug.c > debug.i

debug.s : debug.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -S debug.c

debug.o : debug.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -c debug.c

error.i : error.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c errunix.c libintl.h
	$(CPP) $(CFLAGS) error.c > error.i

error.s : error.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c errunix.c libintl.h
	$(CC) $(CFLAGS) -S error.c

error.o : error.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c errunix.c libintl.h
	$(CC) $(CFLAGS) -c error.c

misc.i : misc.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CPP) $(CFLAGS) misc.c > misc.i

misc.s : misc.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -S misc.c

misc.o : misc.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -c misc.c

time.i : time.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c arilev0.c libintl.h
	$(CPP) $(CFLAGS) time.c > time.i

time.s : time.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c arilev0.c libintl.h
	$(CC) $(CFLAGS) -S time.c

time.o : time.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c arilev0.c libintl.h
	$(CC) $(CFLAGS) -c time.c

predtype.i : predtype.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c avl.c libintl.h
	$(CPP) $(CFLAGS) predtype.c > predtype.i

predtype.s : predtype.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c avl.c libintl.h
	$(CC) $(CFLAGS) -S predtype.c

predtype.o : predtype.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c avl.c libintl.h
	$(CC) $(CFLAGS) -c predtype.c

symbol.i : symbol.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CPP) $(CFLAGS) symbol.c > symbol.i

symbol.s : symbol.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -S symbol.c

symbol.o : symbol.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -c symbol.c

lisparit.i : lisparit.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c aridecl.c arilev0.c arilev1.c intelem.c intlog.c intplus.c intcomp.c intbyte.c intmal.c intdiv.c intgcd.c int2adic.c intsqrt.c intprint.c intread.c rational.c sfloat.c ffloat.c dfloat.c lfloat.c flo_konv.c flo_rest.c realelem.c realrand.c realtran.c compelem.c comptran.c arilev1c.c arilev1e.c arilev1i.c libintl.h
	$(CPP) $(CFLAGS) lisparit.c > lisparit.i

lisparit.s : lisparit.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c aridecl.c arilev0.c arilev1.c intelem.c intlog.c intplus.c intcomp.c intbyte.c intmal.c intdiv.c intgcd.c int2adic.c intsqrt.c intprint.c intread.c rational.c sfloat.c ffloat.c dfloat.c lfloat.c flo_konv.c flo_rest.c realelem.c realrand.c realtran.c compelem.c comptran.c arilev1c.c arilev1e.c arilev1i.c libintl.h
	$(CC) $(CFLAGS) -S lisparit.c

lisparit.o : lisparit.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c aridecl.c arilev0.c arilev1.c intelem.c intlog.c intplus.c intcomp.c intbyte.c intmal.c intdiv.c intgcd.c int2adic.c intsqrt.c intprint.c intread.c rational.c sfloat.c ffloat.c dfloat.c lfloat.c flo_konv.c flo_rest.c realelem.c realrand.c realtran.c compelem.c comptran.c arilev1c.c arilev1e.c arilev1i.c libintl.h
	$(CC) $(CFLAGS) -c lisparit.c

graph.i : graph.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c arilev0.c libintl.h
	$(CPP) $(CFLAGS)  graph.c > graph.i

graph.s : graph.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c arilev0.c libintl.h
	$(CC) $(CFLAGS)  -S graph.c

graph.o : graph.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c arilev0.c libintl.h
	$(CC) $(CFLAGS)  -c graph.c

unixaux.i : unixaux.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CPP) $(CFLAGS) unixaux.c > unixaux.i

unixaux.s : unixaux.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -S unixaux.c

unixaux.o : unixaux.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -c unixaux.c

genclisph.i : genclisph.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CPP) $(CFLAGS) genclisph.c > genclisph.i

genclisph.s : genclisph.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -O0 -S genclisph.c

genclisph.o : genclisph.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -O0 -c genclisph.c

modules.i : modules.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h clisp.h modules.h
	$(CPP) $(CFLAGS) modules.c > modules.i

modules.s : modules.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h clisp.h modules.h
	$(CC) $(CFLAGS) -S modules.c

modules.o : modules.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h clisp.h modules.h
	$(CC) $(CFLAGS) -c modules.c

noreadline.i : noreadline.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CPP) $(CFLAGS) -Ireadline noreadline.c > noreadline.i

noreadline.s : noreadline.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -Ireadline -S noreadline.c

noreadline.o : noreadline.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	$(CC) $(CFLAGS) -Ireadline -c noreadline.c

lisp.a : $(OBJECTS) modules.o
	ld -r -o lisp.o $(OBJECTS)
	chmod a-x lisp.o
	if test -f $(LIBGCC) ; then mkdir libgcc ; (cd libgcc ; $(AR) xv $(LIBGCC)) ; $(AR) rcv lisp.a lisp.o modules.o libgcc/*.o ; $(RM) -r libgcc ; else $(AR) rcv lisp.a lisp.o modules.o ; fi
	$(RM) lisp.o
	$(RANLIB) lisp.a

libnoreadline.a : noreadline.o
	$(AR) rcv libnoreadline.a noreadline.o
	$(RANLIB) libnoreadline.a

readline/libreadline.a :
	cd readline && $(MAKE) -r CC='$(CC)' CFLAGS='$(CFLAGS) -DCLISP' RANLIB='$(RANLIB)'

libreadline.a : readline/libreadline.a
	-$(LN) readline/libreadline.a libreadline.a


libintl.h :
	-$(LN) gettext/intl/intlh.inst libintl.h

gettext/intl/libintl.a :
	cd gettext/intl && $(MAKE) -r CC='$(CC)' CFLAGS='$(CFLAGS)' RANLIB='$(RANLIB)'

libintl.a : gettext/intl/libintl.a
	-$(LN) gettext/intl/libintl.a libintl.a

locale :
	if test -d locale; then rm -rf locale; fi
	mkdir locale
	(cd gettext/po && $(MAKE) && $(MAKE) install datadir=../.. localedir='$$(datadir)/locale' INSTALL_DATA=ln) || (rm -rf locale ; exit 1)


lisp.run : $(OBJECTS) modules.o  libreadline.a libintl.a locale  
	$(CC) $(CFLAGS) $(CLFLAGS) $(OBJECTS) modules.o $(LIBS) $(X_LIBS) -o lisp.run
	-sync


alllsp : $(LSPFILES)

config.lsp : cfgunix.lsp
	$(CP) cfgunix.lsp config.lsp

interpreted.mem : lisp.run $(LSPFILES)
	./lisp.run -m 750KW -N locale -x "(load \"init.lsp\") (sys::%saveinitmem) (exit)"
	$(MV) lispimag.mem interpreted.mem

init.fas : init.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c init.lsp

defseq.fas : defseq.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c defseq.lsp

backquot.fas : backquot.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c backquot.lsp

defmacro.fas : defmacro.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c defmacro.lsp

macros1.fas : macros1.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c macros1.lsp

macros2.fas : macros2.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c macros2.lsp

defs1.fas : defs1.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c defs1.lsp

timezone.fas : timezone.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c timezone.lsp

places.fas : places.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c places.lsp

floatpri.fas : floatpri.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c floatpri.lsp

type.fas : type.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c type.lsp

defstruc.fas : defstruc.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c defstruc.lsp

format.fas : format.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c format.lsp

user1.fas : user1.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c user1.lsp

user2.fas : user2.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c user2.lsp

trace.fas : trace.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c trace.lsp

macros3.fas : macros3.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c macros3.lsp

config.fas : config.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c config.lsp

compiler.fas : compiler.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c compiler.lsp

disassem.fas : disassem.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c disassem.lsp

defs2.fas : defs2.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c defs2.lsp

loop.fas : loop.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c loop.lsp

clos.fas : clos.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c clos.lsp

conditio.fas : conditio.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c conditio.lsp

defs3.fas : defs3.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c defs3.lsp

gstream.fas : gstream.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c gstream.lsp

foreign1.fas : foreign1.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c foreign1.lsp

screen.fas : screen.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c screen.lsp

rexx1.fas : rexx1.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c rexx1.lsp

editor.fas : editor.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c editor.lsp

spanish.fas : spanish.lsp lisp.run interpreted.mem
	./lisp.run -m 1000KW -M interpreted.mem -N locale -q -c spanish.lsp

halfcompiled.mem : lisp.run $(LSPFILES) compiler.fas
	./lisp.run -m 750KW -N locale -x "(load \"init.lsp\") (sys::%saveinitmem) (exit)"
	$(MV) lispimag.mem interpreted.mem
	$(TOUCH) interpreted.mem
	$(TOUCH) compiler.fas
	$(TOUCH) halfcompiled.mem

lispinit.mem : lisp.run $(FASFILES)
	./lisp.run -N locale -x "(load \"init.fas\") (sys::%saveinitmem) (exit)"
	$(MV) lispimag.mem lispinit.mem


# Perform self-tests.
check : test testsuite

# Test: recompile $(LSPFILES) and compare their contents.
test : lispinit.mem stage $(TESTLSPFILES) $(TESTFASFILES)
	cmp -s init.fas stage/init.fas || (echo "Test failed." ; exit 1)
	cmp -s defseq.fas stage/defseq.fas || (echo "Test failed." ; exit 1)
	cmp -s backquot.fas stage/backquot.fas || (echo "Test failed." ; exit 1)
	cmp -s defmacro.fas stage/defmacro.fas || (echo "Test failed." ; exit 1)
	cmp -s macros1.fas stage/macros1.fas || (echo "Test failed." ; exit 1)
	cmp -s macros2.fas stage/macros2.fas || (echo "Test failed." ; exit 1)
	cmp -s defs1.fas stage/defs1.fas || (echo "Test failed." ; exit 1)
	cmp -s timezone.fas stage/timezone.fas || (echo "Test failed." ; exit 1)
	cmp -s places.fas stage/places.fas || (echo "Test failed." ; exit 1)
	cmp -s floatpri.fas stage/floatpri.fas || (echo "Test failed." ; exit 1)
	cmp -s type.fas stage/type.fas || (echo "Test failed." ; exit 1)
	cmp -s defstruc.fas stage/defstruc.fas || (echo "Test failed." ; exit 1)
	cmp -s format.fas stage/format.fas || (echo "Test failed." ; exit 1)
	cmp -s user1.fas stage/user1.fas || (echo "Test failed." ; exit 1)
	cmp -s user2.fas stage/user2.fas || (echo "Test failed." ; exit 1)
	cmp -s trace.fas stage/trace.fas || (echo "Test failed." ; exit 1)
	cmp -s macros3.fas stage/macros3.fas || (echo "Test failed." ; exit 1)
	cmp -s config.fas stage/config.fas || (echo "Test failed." ; exit 1)
	cmp -s compiler.fas stage/compiler.fas || (echo "Test failed." ; exit 1)
	cmp -s disassem.fas stage/disassem.fas || (echo "Test failed." ; exit 1)
	cmp -s defs2.fas stage/defs2.fas || (echo "Test failed." ; exit 1)
	cmp -s loop.fas stage/loop.fas || (echo "Test failed." ; exit 1)
	cmp -s clos.fas stage/clos.fas || (echo "Test failed." ; exit 1)
	cmp -s conditio.fas stage/conditio.fas || (echo "Test failed." ; exit 1)
	cmp -s defs3.fas stage/defs3.fas || (echo "Test failed." ; exit 1)
	cmp -s gstream.fas stage/gstream.fas || (echo "Test failed." ; exit 1)
	cmp -s foreign1.fas stage/foreign1.fas || (echo "Test failed." ; exit 1)
	cmp -s screen.fas stage/screen.fas || (echo "Test failed." ; exit 1)
	cmp -s rexx1.fas stage/rexx1.fas || (echo "Test failed." ; exit 1)
	cmp -s editor.fas stage/editor.fas || (echo "Test failed." ; exit 1)
	cmp -s spanish.fas stage/spanish.fas || (echo "Test failed." ; exit 1)
	echo "Test passed."

stage :
	-mkdir stage

stage/init.lsp : init.lsp
	cd stage && $(LN) ../init.lsp init.lsp

stage/defseq.lsp : defseq.lsp
	cd stage && $(LN) ../defseq.lsp defseq.lsp

stage/backquot.lsp : backquot.lsp
	cd stage && $(LN) ../backquot.lsp backquot.lsp

stage/defmacro.lsp : defmacro.lsp
	cd stage && $(LN) ../defmacro.lsp defmacro.lsp

stage/macros1.lsp : macros1.lsp
	cd stage && $(LN) ../macros1.lsp macros1.lsp

stage/macros2.lsp : macros2.lsp
	cd stage && $(LN) ../macros2.lsp macros2.lsp

stage/defs1.lsp : defs1.lsp
	cd stage && $(LN) ../defs1.lsp defs1.lsp

stage/timezone.lsp : timezone.lsp
	cd stage && $(LN) ../timezone.lsp timezone.lsp

stage/places.lsp : places.lsp
	cd stage && $(LN) ../places.lsp places.lsp

stage/floatpri.lsp : floatpri.lsp
	cd stage && $(LN) ../floatpri.lsp floatpri.lsp

stage/type.lsp : type.lsp
	cd stage && $(LN) ../type.lsp type.lsp

stage/defstruc.lsp : defstruc.lsp
	cd stage && $(LN) ../defstruc.lsp defstruc.lsp

stage/format.lsp : format.lsp
	cd stage && $(LN) ../format.lsp format.lsp

stage/user1.lsp : user1.lsp
	cd stage && $(LN) ../user1.lsp user1.lsp

stage/user2.lsp : user2.lsp
	cd stage && $(LN) ../user2.lsp user2.lsp

stage/trace.lsp : trace.lsp
	cd stage && $(LN) ../trace.lsp trace.lsp

stage/macros3.lsp : macros3.lsp
	cd stage && $(LN) ../macros3.lsp macros3.lsp

stage/config.lsp : config.lsp
	cd stage && $(LN) ../config.lsp config.lsp

stage/compiler.lsp : compiler.lsp
	cd stage && $(LN) ../compiler.lsp compiler.lsp

stage/disassem.lsp : disassem.lsp
	cd stage && $(LN) ../disassem.lsp disassem.lsp

stage/defs2.lsp : defs2.lsp
	cd stage && $(LN) ../defs2.lsp defs2.lsp

stage/loop.lsp : loop.lsp
	cd stage && $(LN) ../loop.lsp loop.lsp

stage/clos.lsp : clos.lsp
	cd stage && $(LN) ../clos.lsp clos.lsp

stage/conditio.lsp : conditio.lsp
	cd stage && $(LN) ../conditio.lsp conditio.lsp

stage/defs3.lsp : defs3.lsp
	cd stage && $(LN) ../defs3.lsp defs3.lsp

stage/gstream.lsp : gstream.lsp
	cd stage && $(LN) ../gstream.lsp gstream.lsp

stage/foreign1.lsp : foreign1.lsp
	cd stage && $(LN) ../foreign1.lsp foreign1.lsp

stage/screen.lsp : screen.lsp
	cd stage && $(LN) ../screen.lsp screen.lsp

stage/rexx1.lsp : rexx1.lsp
	cd stage && $(LN) ../rexx1.lsp rexx1.lsp

stage/editor.lsp : editor.lsp
	cd stage && $(LN) ../editor.lsp editor.lsp

stage/spanish.lsp : spanish.lsp
	cd stage && $(LN) ../spanish.lsp spanish.lsp

stage/init.fas : stage/init.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/init.lsp

stage/defseq.fas : stage/defseq.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/defseq.lsp

stage/backquot.fas : stage/backquot.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/backquot.lsp

stage/defmacro.fas : stage/defmacro.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/defmacro.lsp

stage/macros1.fas : stage/macros1.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/macros1.lsp

stage/macros2.fas : stage/macros2.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/macros2.lsp

stage/defs1.fas : stage/defs1.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/defs1.lsp

stage/timezone.fas : stage/timezone.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/timezone.lsp

stage/places.fas : stage/places.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/places.lsp

stage/floatpri.fas : stage/floatpri.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/floatpri.lsp

stage/type.fas : stage/type.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/type.lsp

stage/defstruc.fas : stage/defstruc.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/defstruc.lsp

stage/format.fas : stage/format.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/format.lsp

stage/user1.fas : stage/user1.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/user1.lsp

stage/user2.fas : stage/user2.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/user2.lsp

stage/trace.fas : stage/trace.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/trace.lsp

stage/macros3.fas : stage/macros3.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/macros3.lsp

stage/config.fas : stage/config.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/config.lsp

stage/compiler.fas : stage/compiler.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/compiler.lsp

stage/disassem.fas : stage/disassem.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/disassem.lsp

stage/defs2.fas : stage/defs2.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/defs2.lsp

stage/loop.fas : stage/loop.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/loop.lsp

stage/clos.fas : stage/clos.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/clos.lsp

stage/conditio.fas : stage/conditio.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/conditio.lsp

stage/defs3.fas : stage/defs3.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/defs3.lsp

stage/gstream.fas : stage/gstream.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/gstream.lsp

stage/foreign1.fas : stage/foreign1.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/foreign1.lsp

stage/screen.fas : stage/screen.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/screen.lsp

stage/rexx1.fas : stage/rexx1.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/rexx1.lsp

stage/editor.fas : stage/editor.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/editor.lsp

stage/spanish.fas : stage/spanish.lsp lisp.run lispinit.mem
	./lisp.run -M lispinit.mem -N locale -q -c stage/spanish.lsp

lispinit2.mem : lisp.run $(TESTFASFILES)
	./lisp.run -N locale -x "(cd \"stage/\") (load \"init.fas\") (cd \"../\") (sys::%saveinitmem) (exit)"
	-$(RM) lispinit2.mem
	$(MV) lispimag.mem lispinit2.mem


testsuite : suite lisp.run lispinit.mem
	LISP="`pwd`/lisp.run -M `pwd`/lispinit.mem -N `pwd`/locale"; export LISP; cd suite; $(MAKE) LISP="$$LISP"

suite :
	-mkdir suite
	cd suite && $(LN) ../../tests/Makefile .
	cd suite && $(LN) ../../tests/*.lsp .
	cd suite && $(LN) ../../tests/*.tst .


lispbibl.h : lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h
	(($(CPP) $(CFLAGS) -P lispbibl.c | $(GREP) -v "^ *$$") ; ($(CPP) $(CFLAGS) -P -dM lispbibl.c | sort) ) > lispbibl.h


clisp.h : genclisph.o unixconf.h intparam.h
	$(CC) $(CFLAGS) $(CLFLAGS) genclisph.o -o genclisph
	(echo '#ifndef _CLISP_H' ; echo '#define _CLISP_H' ; echo ; grep '^#' unixconf.h ; echo ; grep '^#' intparam.h ; echo ; ./genclisph ; echo ; echo '#endif /* _CLISP_H */') > clisp.h
	$(RM) genclisph


modular : lisp.a libnoreadline.a libreadline.a libintl.a clisp-link modules.d modules.c clisp.h modules.h makevars

makevars :
	(echo 'CC='"'"'$(CC)'"'" ; echo 'CFLAGS='"'"'$(CFLAGS)'"'" ; echo 'CLFLAGS='"'"'$(CLFLAGS)'"'" ; echo 'LIBS='"'"'lisp.a $(LIBS)'"'" ; echo 'WLIBS='"'"'wlisp.a $(LIBS)'"'" ; echo 'X_LIBS='"'"'$(X_LIBS)'"'" ; echo 'RANLIB='"'"'$(RANLIB)'"'" ; echo 'FILES='"'"'lisp.a libnoreadline.a libreadline.a libintl.a'"'") > makevars

clisp-link : clisp-link.in
	cat clisp-link.in > clisp-link
	chmod a+x clisp-link

anymodule $(MODULES) : lisp.run lispinit.mem force
	test -d $@ || lndir ../modules/$@ $@
	if test -f $@/configure -a '!' -f $@/config.status ; then cd $@ ; ./configure --cache-file=`echo $@/ | sed -e 's,[^/][^/]*//*,../,g'`config.cache ; fi
	CLISP="`pwd`/lisp.run -M `pwd`/lispinit.mem -N `pwd`/locale" ; cd $@ ; dots=`echo $@/ | sed -e 's,[^/][^/]*//*,../,g'` ; $(MAKE) clisp-module CC="$(CC)" CFLAGS="$(CFLAGS)" INCLUDES="$$dots" LISPBIBL_INCLUDES=" $${dots}lispbibl.c $${dots}fsubr.c $${dots}subr.c $${dots}pseudofun.c $${dots}constsym.c $${dots}constobj.c $${dots}unix.c $${dots}libintl.h" CLFLAGS="$(CLFLAGS)" LIBS="$(LIBS)" RANLIB="$(RANLIB)" CLISP="$$CLISP -q"

full : modular $(MODULES)
	test -d full || CLISP_LINKKIT=. ./clisp-link add-module-sets base full $(MODULES) || ($(RM) -r full ; exit 1)

READMES = ANNOUNCE COPYRIGHT GNU-GPL SUMMARY NEWS README README.de README.en README.es MAGIC.add
MANUALS = clisp.1 clisp.html impnotes.txt $(TXTFILES) clreadline.3 clreadline.html clreadline.dvi readline.dvi

manual : $(READMES) $(MANUALS)

manualx : manual clisp.man clreadline.man

ANNOUNCE : ../ANNOUNCE
	-$(LN) ../ANNOUNCE ANNOUNCE

COPYRIGHT : ../COPYRIGHT
	-$(LN) ../COPYRIGHT COPYRIGHT

GNU-GPL : ../GNU-GPL
	-$(LN) ../GNU-GPL GNU-GPL

SUMMARY : ../SUMMARY
	-$(LN) ../SUMMARY SUMMARY

MAGIC.add : ../unix/MAGIC.add
	-$(LN) ../unix/MAGIC.add MAGIC.add

README : _README lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h _README.de _README.en txt2c 
	$(TXT2C) < _README > txt.c
	$(CC) $(CFLAGS) $(CLFLAGS) -O0 txt.c -o txt
	./txt > README
	$(RM) txt.c
	$(RM) txt

README.de : _README.de lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h txt2c 
	$(TXT2C) < _README.de > txt.c
	$(CC) $(CFLAGS) $(CLFLAGS) -O0 txt.c -o txt
	./txt > README.de
	$(RM) txt.c
	$(RM) txt

README.en : _README.en lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h txt2c 
	$(TXT2C) < _README.en > txt.c
	$(CC) $(CFLAGS) $(CLFLAGS) -O0 txt.c -o txt
	./txt > README.en
	$(RM) txt.c
	$(RM) txt

README.es : _README.es lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h txt2c 
	$(TXT2C) < _README.es > txt.c
	$(CC) $(CFLAGS) $(CLFLAGS) -O0 txt.c -o txt
	./txt > README.es
	$(RM) txt.c
	$(RM) txt

clisp.1 : _clisp.1 lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h txt2c 
	$(TXT2C) < _clisp.1 > txt.c
	$(CC) $(CFLAGS) $(CLFLAGS) -O0 txt.c -o txt
	./txt | $(GREP) -v '^ *$$' > clisp.1
	$(RM) txt.c
	$(RM) txt

clisp.html : _clisp.html lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h txt2c 
	$(TXT2C) < _clisp.html > txt.c
	$(CC) $(CFLAGS) $(CLFLAGS) -O0 txt.c -o txt
	./txt > clisp.html
	$(RM) txt.c
	$(RM) txt

impnotes.txt : _impnotes.txt lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h txt2c 
	$(TXT2C) < _impnotes.txt > txt.c
	$(CC) $(CFLAGS) $(CLFLAGS) -O0 txt.c -o txt
	./txt > impnotes.txt
	$(RM) txt.c
	$(RM) txt

clisp.c : _clisp.c lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h txt2c 
	$(TXT2C) < _clisp.c > txt.c
	$(CC) $(CFLAGS) $(CLFLAGS) -O0 txt.c -o txt
	./txt > clisp.c
	$(RM) txt.c
	$(RM) txt

distmakefile : _distmakefile lispbibl.c fsubr.c subr.c pseudofun.c constsym.c constobj.c unix.c libintl.h txt2c 
	$(TXT2C) < _distmakefile > txt.c
	$(CC) $(CFLAGS) $(CLFLAGS) -O0 txt.c -o txt
	./txt | (libs=''; for f in lisp.a $(LIBS); do case $$f in -*) libs="$$libs $$f";; *) libs="$$libs"' base/'"$$f";; esac; done; wlibs=''; for f in wlisp.a $(LIBS); do case $$f in -*) wlibs="$$wlibs $$f";; *) wlibs="$$wlibs"' base/'"$$f";; esac; done; files=''; for f in lisp.a libnoreadline.a libreadline.a libintl.a; do files="$$files"' base/'"$$f"; done; sed -e 's%@DATADIRNAME@%share%g' -e "s,@@BASE_LIBS@@,$$libs,g" -e "s,@@BASE_WLIBS@@,$$wlibs,g" -e "s,@@BASE_FILES@@,$$files,g") > distmakefile
	$(RM) txt.c
	$(RM) txt

clreadline.3 : readline/doc/clreadline.3
	-$(LN) readline/doc/clreadline.3 clreadline.3

clreadline.html : readline/doc/clreadline.html
	-$(LN) readline/doc/clreadline.html clreadline.html

clreadline.dvi : readline/doc/clreadline.dvi
	-$(LN) readline/doc/clreadline.dvi clreadline.dvi

clisp.man : clisp.1
	$(ROFF_MAN) clisp.1 > clisp.man

clisp.dvi : clisp.1
	$(ROFF_DVI) clisp.1 > clisp.dvi

clreadline.man : clreadline.3
	$(ROFF_MAN) clreadline.3 > clreadline.man

LISP-tutorial.txt : ../doc/LISP-tutorial.txt
	-$(LN) ../doc/LISP-tutorial.txt LISP-tutorial.txt

CLOS-guide.txt : ../doc/CLOS-guide.txt
	-$(LN) ../doc/CLOS-guide.txt CLOS-guide.txt

cltl2.txt : ../doc/cltl2.txt
	-$(LN) ../doc/cltl2.txt cltl2.txt

editors.txt : ../doc/editors.txt
	-$(LN) ../doc/editors.txt editors.txt

readline/doc/rluserman.dvi :
	cd readline/doc && $(MAKE) rluserman.dvi

readline.dvi : readline/doc/rluserman.dvi
	-$(LN) readline/doc/rluserman.dvi readline.dvi


install : install-bin install-man

installdirs : force
	if [ ! -d $(libdir) ] ; then mkdir $(libdir) ; fi
	if [ ! -d $(lisplibdir) ] ; then mkdir $(lisplibdir) ; fi
	if [ ! -d $(bindir) ] ; then mkdir $(bindir) ; fi
	cd gettext/po && $(MAKE) installdirs prefix='$(prefix)' exec_prefix='$(exec_prefix)'
	if [ ! -d $(mandir) ] ; then mkdir $(mandir) ; fi
	if [ ! -d $(mandir)/man1 ] ; then mkdir $(mandir)/man1 ; fi
	if [ ! -d $(mandir)/man3 ] ; then mkdir $(mandir)/man3 ; fi
	if [ ! -d $(mandir)/html ] ; then mkdir $(mandir)/html ; fi

install-bin : lisp.run lispinit.mem clisp.c force
	if [ ! -d $(libdir) ] ; then mkdir $(libdir) ; fi
	if [ ! -d $(lisplibdir) ] ; then mkdir $(lisplibdir) ; fi
	$(INSTALL_PROGRAM) lisp.run $(lisplibdir)/lisp.run
	$(RM) $(lisplibdir)/lispinit.mem
	$(INSTALL_DATA) lispinit.mem $(lisplibdir)/lispinit.mem
	cd gettext/po && $(MAKE) install prefix='$(prefix)' exec_prefix='$(exec_prefix)'
	if [ ! -d $(bindir) ] ; then mkdir $(bindir) ; fi
	$(CC) $(CFLAGS) $(CLFLAGS) -DLISPLIBDIR='"$(lisplibdir)"' -DLOCALEDIR='"$(localedir)"' clisp.c -o $(bindir)/clisp

install-man : clisp.1 clisp.html clreadline.3 clreadline.html force
	if [ ! -d $(mandir) ] ; then mkdir $(mandir) ; fi
	if [ ! -d $(mandir)/man1 ] ; then mkdir $(mandir)/man1 ; fi
	$(INSTALL_DATA) clisp.1 $(mandir)/man1/clisp.1
	if [ ! -d $(mandir)/man3 ] ; then mkdir $(mandir)/man3 ; fi
	$(INSTALL_DATA) clreadline.3 $(mandir)/man3/clreadline.3
	if [ ! -d $(mandir)/html ] ; then mkdir $(mandir)/html ; fi
	$(INSTALL_DATA) clisp.html $(mandir)/html/clisp.html
	$(INSTALL_DATA) clreadline.html $(mandir)/html/clreadline.html


installcheck : suite force
	cd suite && $(MAKE) LISP="$(bindir)/clisp"


uninstall : uninstall-bin uninstall-man

uninstall-bin : force
	$(RM) $(lisplibdir)/lisp.run
	$(RM) $(lisplibdir)/lispinit.mem
	$(RM) $(bindir)/clisp
	cd gettext/po && $(MAKE) uninstall prefix='$(prefix)' exec_prefix='$(exec_prefix)'

uninstall-man : force
	$(RM) $(mandir)/man1/clisp.1
	$(RM) $(mandir)/man3/clreadline.3
	$(RM) $(mandir)/html/clisp.html
	$(RM) $(mandir)/html/clreadline.html


# Choose one of the packers:

# Standard Unix packer. Compress afterwards.
#PACK = tar
#PACKOPT = -cvf
#PACKEXT = .tar

# GNU tar together with compress.
#PACK = tar
#PACKOPT = cvfhz
#PACKEXT = .tar.Z

# GNU tar together with GNU gzip. Excellent performance.
PACK = tar
PACKOPT = cvfhz
PACKEXT = .tar.gz

# Popular Amiga packer. Good 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

# Temporary directory for packing
PACKDIR = /tmp

# The distribution's top directory
TOPDIR=clisp-1997-09-24

distrib : force all modular manualx clisp.c distmakefile
	$(RM) $(PACKDIR)/clisp$(PACKEXT)
	mkdir $(TOPDIR)
	ln ANNOUNCE COPYRIGHT GNU-GPL SUMMARY NEWS README README.de README.es MAGIC.add $(TOPDIR)
	. full/makevars ; full_files='' ; for f in modules.o $$FILES ; do full_files="$$full_files"' full/'"$$f" ; done ; full_libs='' ; for f in modules.o $$LIBS ; do case $$f in -*) full_libs="$$full_libs $$f";; *) full_libs="$$full_libs"' full/'"$$f";; esac ; done ; full_wlibs='' ; for f in wmodules.o $$WLIBS ; do case $$f in -*) full_wlibs="$$full_wlibs $$f";; *) full_wlibs="$$full_wlibs"' full/'"$$f";; esac ; done ; sed -e "s,@@FULL_FILES@@,$$full_files," -e "s,@@FULL_LIBS@@,$$full_libs," -e "s,@@FULL_WLIBS@@,$$full_wlibs," < distmakefile > $(TOPDIR)/Makefile
	mkdir $(TOPDIR)/base
	ln lisp.a libnoreadline.a libreadline.a libintl.a modules.h makevars lispinit.mem  $(TOPDIR)/base
	for f in `find locale -type d -print`; do mkdir $(TOPDIR)/$$f; done
	for f in `find locale -type f -print`; do ln $$f $(TOPDIR)/$$f; done
	mkdir $(TOPDIR)/doc
	ln clisp.1 clisp.man clisp.html impnotes.txt $(TXTFILES) clreadline.3 clreadline.html clreadline.dvi readline.dvi clreadline.man $(TOPDIR)/doc
	mkdir $(TOPDIR)/emacs
	ln ../emacs/*.el $(TOPDIR)/emacs
	mkdir $(TOPDIR)/src
	ln $(LSPFILES) $(FASFILES) $(TOPDIR)/src
	ln clisp.c $(TOPDIR)/src
	ln clisp-link $(TOPDIR)
	mkdir $(TOPDIR)/linkkit
	ln modules.d modules.c clisp.h $(TOPDIR)/linkkit
	for module in '' $(MODULES); do if test -n "$$module"; then \
	  (dir=$(TOPDIR)/ ; for subdir in `echo $$module/ | sed -e 's,/, ,g'` ; do dir=$${dir}$${subdir} ; test -d $${dir} || mkdir $${dir} ; dir=$${dir}/ ; done ; cd $$module ; dots=`echo $$module/ | sed -e 's,[^/][^/]*//*,../,g'` ; $(MAKE) clisp-module-distrib distribdir=$${dots}$(TOPDIR)/$$module LN=ln) \
	fi; done
	mkdir $(TOPDIR)/full
	ln `. full/makevars ; for f in $$FILES modules.o modules.h makevars lispinit.mem  ; do echo full/$$f ; done` $(TOPDIR)/full
	chmod a+r $(TOPDIR) $(TOPDIR)/* $(TOPDIR)/*/*
	chmod a+x $(TOPDIR)/. $(TOPDIR)/*/.
	$(PACK) $(PACKOPT) $(PACKDIR)/clisp$(PACKEXT) $(TOPDIR)
	$(RM) -r $(TOPDIR)


# clean0 is harmless: removes only superfluous things: temporary files.
clean0 : force
	-$(RM) core ansidecl.c ccmp2c.c genclisph wgenclisph linkkit txt.c txt

# clean1 removes everything that becomes obsolete once lisp.run is recompiled
# without changing the bytecode format and the tables in
# constobj.d, constpack.d, constsym.d, subr.d, fsubr.d, pseudofun.d.
clean1 : clean0
	-$(RM) lispbibl.h wlispbibl.h clisp.h *.i *.s *.o *.a lisp.run wlisp.run clisp-link makevars stage/* suite/* wstage/* wsuite/*
	-rmdir stage
	-rmdir suite
	-rmdir wstage
	-rmdir wsuite
	-$(RM) README README.de README.en README.es clisp.1 clisp.man clisp.html impnotes.txt clisp.c distmakefile $(TXTFILES) clreadline.3 clreadline.man clreadline.html clreadline.dvi readline.dvi

# clean2 removes everything that becomes obsolete once lisp.run is recompiled
# without changing the bytecode format.
clean2 : clean1
	-$(RM) interpreted.mem halfcompiled.mem lispinit.mem lispinit2.mem wlispinit.mem wlispinit2.mem

# clean3 removes everything that becomes obsolete once lisp.run is recompiled.
# It leaves everything generated by "make allc".
clean3 : clean2
	-$(RM) $(FASFILES) *.lib

# clean4 removes everything that becomes obsolete
# when switching to a new version of the C compiler.
# It leaves everything generated by "make init".
clean4 : clean3
	-$(RM) $(CFILES)
	cd readline && $(MAKE) clean
	cd gettext/intl && $(MAKE) clean
	cd gettext/po && $(MAKE) clean
	-$(RM) -r locale

# clean5 even undoes "make init".
clean5 : clean4
	-$(RM) config.lsp
	-$(RM) comment5 ansidecl ccpaux deelif deerror dedefined traddecl deema mergestrings txt2c

# clean6 lets us go back to "makemake > Makefile".
clean6 : clean5
	-$(RM) Makefile

# clean7 lets us go back to the main "configure".
clean7 : clean6
	-$(RM) config.status config.log config.cache intparam.h unixconf.h makemake
	cd readline && $(MAKE) distclean
	cd gettext/intl && $(MAKE) distclean
	cd gettext/po && $(MAKE) distclean
	-$(RM) -r locale

# clean8 moreover cleans up the SRCDIR.
clean8 : clean7

# The normal "start over" command:
mostlyclean : clean4

# Clear all files that are built by "make ...":
clean : clean5

# Make "clear for distribution":
distclean : clean7

# Remove everything that can be generated otherwise:
maintainer-clean : clean8


.SUFFIXES:

force:

