# 
# /**********************************************************************
# *									*
# * The SB-Prolog System						*
# * Copyright SUNY at Stony Brook, 1986; University of Arizona, 1987	*
# *									*
# ***********************************************************************/
# 
# /*-----------------------------------------------------------------
# SB-Prolog is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY.  No author or distributor
# accepts responsibility to anyone for the consequences of using it
# or for whether it serves any particular purpose or works at all,
# unless he says so in writing.  Refer to the SB-Prolog General Public
# License for full details.
# 
# Everyone is granted permission to copy, modify and redistribute
# SB-Prolog, but only under the conditions described in the
# SB-Prolog General Public License.   A copy of this license is
# supposed to have been given to you along with SB-Prolog so you
# can know your rights and responsibilities.  It should be in a
# file named COPYING.  Among other things, the copyright notice
# and this notice must be preserved on all copies. 
# ------------------------------------------------------------------ */
CFLAGS = -c -O
#CC     = /usr/local/gcc
CC     = cc
OBJ1   = aux.o dis.o dispatch.o evalexp.o float.o init.o io.o load_work.o 
OBJ2   = loader.o main.o parse_oprnd.o print_inst.o sub_inst.o unify.o gc.o
OBJS   = $(OBJ1) $(OBJ2)

sbprolog : $(OBJS) builtin/builtin
	$(CC) -o sbprolog $(OBJS) builtin/builtin
clean :
	rm $(OBJS)
aux.o   : aux.c sim.h
	$(CC) $(CFLAGS) aux.c 
dis.o   : dis.c aux.h inst.h sim.h 
	$(CC) $(CFLAGS) dis.c 
dispatch.o : dispatch.c inst.h
	$(CC) $(CFLAGS) dispatch.c 
evalexp.o : evalexp.c aux.h sim.h
	$(CC) $(CFLAGS) evalexp.c 
float.o : float.c aux.h sim.h
	$(CC) $(CFLAGS) float.c
init.o  : init.c aux.h inst.h sim.h
	$(CC) $(CFLAGS) init.c
io.o    : io.c aux.h sim.h 
	$(CC) $(CFLAGS) io.c 
load_work.o : load_work.c aux.h sim.h
	$(CC) $(CFLAGS) load_work.c 
loader.o : loader.c aux.h sim.h inst.h 
	$(CC) $(CFLAGS) loader.c 
main.o  : main.c aux.h inst.h simdef.h sim.h
	$(CC) $(CFLAGS) main.c
parse_oprnd.o : parse_oprnd.c inst.h sim.h
	$(CC) $(CFLAGS) parse_oprnd.c 
print_inst.o : print_inst.c inst.h sim.h
	$(CC) $(CFLAGS) print_inst.c 
sub_inst.o : sub_inst.c aux.h sim.h 
	$(CC) $(CFLAGS) sub_inst.c 
unify.o : unify.c aux.h sim.h
	$(CC) $(CFLAGS) unify.c 
gc.o    : gc.c aux.h simdef.h sim.h
	$(CC) $(CFLAGS) gc.c 

builtin/builtin : aux.h sim.h
	cd builtin;	make
