#
# Makefile for kForth
#
# Copyright (c) 1998 Creative Consulting for Research and Education
# Provided under the terms of the GNU General Public License
#
# Last Revised: 6-2-1999
#
# Possible invocations:
#
#	make		creates dynamically linked release executable
#	make clean	remove all object files belonging to this project
#	make debug	create statically linked debug executable
#	make archive	create a compressed tar file
#
# Notes:
#
#   1. If a debug version is being built, always invoke "make clean" 
#      before "make debug".
#
#
# Default debug option creates a release version of the executable.
# Invoke "make debug" if you want to create an executable
# that contains debugging information for the GNU debugger (gdb).

DEBUG = 

CPP = g++ -c
OBJS = kforth.o ForthVM.o ForthCompiler.o vm.o vmc.o

kforth: ${OBJS} 
	g++ -o kforth ${DEBUG} ${OBJS}

clean:
	- rm -f ${OBJS} kforth

archive:
	tar -zcvf kflnx10.tar.gz *.s *.h *.c *.cpp *.4th Makefile README

debug:
	make kforth "DEBUG = -g"

kforth.o: kforth.cpp ForthVM.h ForthCompiler.h
	${CPP} ${DEBUG} kforth.cpp

ForthVM.o: ForthVM.cpp ForthVM.h fbc.h ForthCompiler.h
	${CPP} ${DEBUG} ForthVM.cpp

ForthCompiler.o: ForthCompiler.cpp ForthCompiler.h fbc.h
	${CPP} ${DEBUG} ForthCompiler.cpp

vm.o: vm.s
	as -o vm.o vm.s

vmc.o: vmc.c
	gcc -c ${DEBUG} vmc.c

# end of makefile

