# Makefile.in for kaffevm - a Java(tm) compatible virtual machine.
# Borland
# Copyright (c) 1996 Systems Architecture Research Centre,
#		   City University, London, UK.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# Written by Tim Wilkinson <tim@sarc.city.ac.uk>, May 1996.

srcdir=		@srcdir@
prefix=		@prefix@
exec_prefix=	@exec_prefix@
libdir=		@libdir@
INSTALL=	@INSTALL@
INSTALL_DATA=	@INSTALL_DATA@
CC=		@CC@
PIC=		@PIC@
LDFLAGS=	@LIBSHARE@
LDTAIL=		@LDTAIL@
KVER=		@KVER@
OBJEXT=@OBJEXT@
LIBEXT=@LIBEXT@

CFLAGS=		@CFLAGS@ -I$(srcdir) -I..\support -I$(srcdir)\..\support \
 -I..\..\config -I$(srcdir)\..\..\config -I..\..\kaffevm

LIBNAME=	libkaffe_native
LIBX=		$(LIBNAME)$(LIBEXT).$(KVER)
LLIB=		$(LIBNAME)$(LIBEXT)

OBJECT_IO=	FileDescriptorStub$(OBJEXT) \
		FileDescriptor$(OBJEXT) \
		FileInputStreamStub$(OBJEXT) \
		FileInputStream$(OBJEXT) \
		FileOutputStreamStub$(OBJEXT) \
		FileOutputStream$(OBJEXT) \
		FileStub$(OBJEXT) \
		File$(OBJEXT) \
		RandomAccessFileStub$(OBJEXT) \
		RandomAccessFile$(OBJEXT)

OBJECT_LANG=	ClassLoaderStub$(OBJEXT) \
		ClassLoader$(OBJEXT) \
		ClassStub$(OBJEXT) \
		Class$(OBJEXT) \
		CompilerStub$(OBJEXT) \
		Compiler$(OBJEXT) \
		DoubleStub$(OBJEXT) \
		Double$(OBJEXT) \
		FloatStub$(OBJEXT) \
		Float$(OBJEXT) \
		MathStub$(OBJEXT) \
		Math$(OBJEXT) \
		ObjectStub$(OBJEXT) \
		Object$(OBJEXT) \
		ProcessReaperStub$(OBJEXT) \
		ProcessReaper$(OBJEXT) \
		RuntimeStub$(OBJEXT) \
		Runtime$(OBJEXT) \
		SecurityManagerStub$(OBJEXT) \
		SecurityManager$(OBJEXT) \
		SystemStub$(OBJEXT) \
		System$(OBJEXT) \
		ThreadStub$(OBJEXT) \
		Thread$(OBJEXT) \
		ThrowableStub$(OBJEXT) \
		Throwable$(OBJEXT) \
		UNIXProcessStub$(OBJEXT) \
		UNIXProcess$(OBJEXT)

OBJECT_UTIL=	DateStub$(OBJEXT) \
		Date$(OBJEXT)

OBJECT=	$(OBJECT_LANG) $(OBJECT_IO) $(OBJECT_UTIL)

all:		links $(LLIB)

.path.c=	$(srcdir)\java.io;$(srcdir)java.lang;$(srcdir)\java.util;$(srcdir)\java.io.stubs;$(srcdir)\java.lang.stubs;$(srcdir)\java.util.stubs


$(LLIB):		$(OBJECT) $(LIBNAME).def
		tlink32 -Tpd -v c0d32 @&&!
$(OBJECT)
!,$(LLIB),NUL,cw32 import32 ..\..\kaffevm\libkaffe_vm,$(LIBNAME).def,
		implib $(LIBNAME) $(LLIB)

.c.obj:
		$(CC) @&&!
$(CFLAGS)
! -c $(PIC) $<

links:		..\support\jtypes.h $(LIBNAME).def ..\..\config\config.h

..\support\jtypes.h:	..\..\..\config\i386\win32\bc\jtypes.h
		copy ..\..\..\config\i386\win32\bc\jtypes.h ..\support\jtypes.h

$(LIBNAME).def: ..\..\..\config\i386\win32\bc\$(LIBNAME).def
		copy ..\..\..\config\i386\win32\bc\$(LIBNAME).def $(LIBNAME).def

..\..\config\config.h:	..\..\..\config\i386\win32\bc\config.h
		copy ..\..\..\config\i386\win32\bc\config.h ..\..\config\config.h

clean:
		del *.obj
		del *.dll
		del *.lib

distclean:	clean
		del ..\support\jtypes.h
		del $(LIBNAME).def
		del ..\..\config\config.h
		del Makefile

install:
		$(INSTALL_DATA) $(LIB) $(libdir)\$(LIB)
