# $Id: Makefile.in,v 1.1 1996/08/02 17:41:03 kehr Exp $
#----------------------------------------------------------------------
#
# This makefile is intended to be used only in a <platform>-directory.
#
# The following targets are supported:
#
#   compile    :  compiles the xindy-system
#   xindy.mem  :  creates the dumped version of xindy
#   xindy      :  created the defaults startup-script
#   gzipped    :  created a gzipped version of the mem-file
#   clean      :  cleans unnecessary stuff
#


TOPDIR = /opt/xindy

# Where the modules are found at runtime.
# We use the same directory as the autoconf source distribution, even
# though I don't like the extraneous directories.
MODULEDIR = $(TOPDIR)/lib/xindy/modules

#
# Installation only paths
#
# Use a different path here if for some reason the installation must
# be somewhere else and not directly stored into TOPDIR.
INSTTOPDIR = $(TOPDIR)

# Where xindy.mem should be installed.
INSTLIBDIR = $(INSTTOPDIR)/lib/xindy


# Do not change the following section!

FAS        = base.fas ordrules.fas locref.fas idxstyle.fas index.fas version.fas markup.fas
DEFAULTS   = defaults.xdy
DUMP_XINDY = dump-xindy.lsp
MEMFILE    = xindy.mem
CLISP      = clisp -q -E iso-8859-1

# End of section


# Target section

all:: xindy.mem

xindy.mem: $(DEFAULTS) $(DUMP_XINDY) $(FAS)
	rm -f $(MEMFILE)
	$(CLISP) $(DUMP_XINDY)
	gzip $(MEMFILE)
	mv $(MEMFILE).gz $(MEMFILE)

$(DEFAULTS):
	@$(RM) $(DEFAULTS)
	@echo "Creating file $(DEFAULTS)..."
	@echo "(setq *load-paths* (list "         > $(DEFAULTS)
	@echo "  (pathname \".\")"               >> $(DEFAULTS)
	@echo "  (pathname \"$(MODULEDIR)\")))"  >> $(DEFAULTS)
	@echo "Finished $(DEFAULTS)."

.SUFFIXES: .lsp .fas

.lsp.fas:
	$(CLISP) -c $<

install: $(MEMFILE)
	mkdir -p $(INSTLIBDIR)
	cp $(MEMFILE) $(INSTLIBDIR)

clean::
	$(RM) *.fas *.lib
	$(RM) $(DEFAULTS) $(MEMFILE)

