#****************************************************************************#
#*                                                                          *#
#* Copyright 1997-1999 University of Cambridge and University of Edinburgh  *#
#*                                                                          *#
#*                           All rights reserved.                           *#
#*                                                                          *#
#****************************************************************************#

#****************************************************************************#
#* FILE          : Makefile                                                 *#
#* DESCRIPTION   : Makefile for generating specialised Clam and HOL         *#
#*                 processes for use in a HOL/Clam interface.               *#
#*                                                                          *#
#* AUTHOR        : R.J.Boulton                                              *#
#* DATE          : 25th April 1997                                          *#
#*                                                                          *#
#* LAST MODIFIED : R.J.Boulton                                              *#
#* DATE          : 30th November 1999                                       *#
#****************************************************************************#

#-------------------------------------------------------------------------
# parameters
#-------------------------------------------------------------------------

CLAM=clam
HOL90=hol90.10
SICSTUS_DIR=sp-runtime

HOL_TARGET=hol-heap

#-------------------------------------------------------------------------
# computed macros
#-------------------------------------------------------------------------

#-------------------------------------------------------------------------
# all
#-------------------------------------------------------------------------

all: clam hol

#-------------------------------------------------------------------------
# Generate specialised Clam executable
#-------------------------------------------------------------------------

clam: socket_server.pl hol-clam.pl
	echo "consult('socket_server')."\
	     "consult('hol-clam')."\
	| $(CLAM)

#-------------------------------------------------------------------------
# Generate specialised HOL executable
#-------------------------------------------------------------------------

hol: Q.sig Q.sml clam.ast.sml clam.lex.sml clam.grm.sig clam.grm.sml\
	clam.parse.sml clam.pp.sml clam.print.sml socket_server.sml\
	hol_to_clam.sml Btree.sig Btree.sml Fact.sig Fact.sml\
	vistactic.sig vistactic.sml clam_to_hol.sig clam_to_hol.sml\
	clam2client.sig plan2tactic.sig plan2tactic.sml database.sml\
	call_clam.sml ei.sig ei.sml basic_logic.sml definitions.sml\
	schemes.sml load.sml
	echo 'use "load.sml";'\
	     'save_hol "$(HOL_TARGET)";'\
	| $(HOL90)

#-------------------------------------------------------------------------
# Generate a Clam engine (Shouldn't be required by end users)
#-------------------------------------------------------------------------

clam-engine: sockets.so system.so clam-engine.c hol-clam
	$(SICSTUS_DIR)/spmkrs \
	-S clam-engine +c clam-engine.c +r sockets.so system.so

sockets.so:
	ln -s sp-runtime/sockets.so

system.so:
	ln -s sp-runtime/system.so
