# Makefile.in for kaffevm - a Java(tm) compatible virtual machine.
#
# Copyright (c) 1996, 1997
#	Transvirtual Technologies, Inc.  All rights reserved.
#
# See the file "license.terms" for information on usage and redistribution 
# of this file. 

@VPATHOPT@=	@srcdir@@VPATHSEP@@srcdir@/@with_engine@@VPATHSEP@@srcdir@/../../config/@host_cpu@/@host_os@@VPATHSEP@@srcdir@/../../config/@host_cpu@@VPATHSEP@@srcdir@/systems/@THREAD_SYSTEM@:@VPATHSEP@@srcdir@/mem
srcdir=		@srcdir@
prefix=		@prefix@
exec_prefix=	@exec_prefix@
libdir=		@libdir@
INSTROOT=	@INSTROOT@
INSTALL=	@INSTALL@
INSTALL_DATA=	@INSTALL_DATA@
MKDIR=		@MKDIR@
LN=		@LN_S@
CC=		@CC@
LD=		@LD@
AR=		@AR@
RANLIB=		@RANLIB@
DLLTOOL=	@DLLTOOL@
DEPTOOL=	@DEPTOOL@
PIC=		@PICVM@
LDFLAGS=	@LIBSHARE@ @LDFLAGS@
LIBS=		@LIBS@
LDTAIL=		@LDTAIL@ @NET_LIBRARIES@ @STD_LIBRARIES@ @VM_LIBRARIES@
KVER=		@KVER@
OBJEXT=		@OBJEXT@
LIBEXT=		@LIBVMEXT@

INCLUDES=	-I. -I$(srcdir) -I$(srcdir)/../../config -I../../config -I../../include -I$(srcdir)/../../include -I../../libraries/clib
CPPFLAGS=	@CPPFLAGS@
CFLAGS=		@CFLAGS@
ALL_CFLAGS=	$(INCLUDES) $(CPPFLAGS) $(CFLAGS) @KAFFEVMFLAGS@ $(ENGINE_CFLAGS) -DKVER=\"$(KVER)\" $(EXTRA_CFLAGS)

LIBNAME=	libkaffevm
LIB=		$(LIBNAME)$(LIBEXT).$(KVER)
LLIB=		$(LIBNAME)$(LIBEXT)

COMMON=\
		code$(OBJEXT) \
		lookup$(OBJEXT) \
		external$(OBJEXT) \
		constants$(OBJEXT) \
		classMethod$(OBJEXT) \
		readClass$(OBJEXT) \
		findInJar$(OBJEXT) \
		baseClasses$(OBJEXT) \
		object$(OBJEXT) \
		itypes$(OBJEXT) \
		gc$(OBJEXT) \
		gc-mem$(OBJEXT) \
		thread$(OBJEXT) \
		locks$(OBJEXT) \
		support$(OBJEXT) \
		soft$(OBJEXT) \
		string$(OBJEXT) \
		verify$(OBJEXT) \
		code-analyse$(OBJEXT) \
		exception$(OBJEXT) \
		stackTrace$(OBJEXT) \
		jar$(OBJEXT) \
		inflate$(OBJEXT) \
		debug$(OBJEXT) \
		jni$(OBJEXT) \
		md$(OBJEXT)

all:		mkkaffevm

@engine_frag@
@cpu_frag@
@cpu_os_frag@
@threads_frag@

OBJECT=		$(COMMON) $(THREAD) $(ENGINE_OBJECTS) $(CPU_OBJECTS) $(CPUOS_OBJECTS)

DEPENDS=       $(OBJECT:@OBJEXT@=.d)

mkkaffevm:	$(LLIB)

$(LLIB):	$(LIB)
		rm -f $(LLIB)
		$(LN) $(LIB) $(LLIB)

$(LIB):		$(OBJECT) lib.exp
		@LINKVMLIB@

.c$(OBJEXT):
		$(CC) $(ALL_CFLAGS) -c $(PIC) $< -o $@

.SUFFIXES: .d

.c.d: 
		$(DEPTOOL) $(ALL_CFLAGS) $< > $@

clean:
		rm -f $(LIB) $(LLIB) $(OBJECT) lib.exp
		rm -f $(DEPENDS)
		rm -f .depend
		touch .depend

distclean:	clean
		rm -f md.c jit.def icode.h trampolines.c
		rm -f thread-native.h locks-native.h
		rm -f Makefile .depend

install:
		test -d $(INSTROOT)$(libdir) || $(MKDIR) $(INSTROOT)$(libdir)
		$(INSTALL_DATA) $(LIB) $(INSTROOT)$(libdir)/$(LIB)
		rm -f $(INSTROOT)$(libdir)/$(LLIB)
		$(LN) $(LIB) $(INSTROOT)$(libdir)/$(LLIB)

derived-files:

depend:         $(DEPENDS)
		rm -f .depend
		cat $(DEPENDS) > .depend

lib.exp:
		$(DLLTOOL) --def $(srcdir)/$(LIBNAME).def --output-exp lib.exp --output-lib $(LIBNAME).a --dllname $(LLIB)
		touch lib.exp

@INC_DEPEND@
