# Makefile.in for kaffevm - a Java(tm) compatible virtual machine.
# for MSVC
# 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>, February 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@

LINK32=link.exe

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

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

OBJECT=	TinyEventThreadStub$(OBJEXT) \
		TinyEventThread$(OBJEXT) \
		TinyFontMetricsStub$(OBJEXT) \
		TinyFontMetrics$(OBJEXT) \
		TinyGraphicsStub$(OBJEXT) \
		TinyGraphics$(OBJEXT) \
		TinyInputThreadStub$(OBJEXT) \
		TinyInputThread$(OBJEXT) \
		TinyToolkitStub$(OBJEXT) \
		TinyToolkit$(OBJEXT) \
		TinyWindowStub$(OBJEXT) \
		TinyWindow$(OBJEXT)

all:	links $(LLIB)

{$(srcdir)/sun.awt.tiny}.c$(OBJEXT):
		$(CC) $(CFLAGS) -c $(PIC) $<

{$(srcdir)/sun.awt.tiny.stubs}.c$(OBJEXT):
		$(CC) $(CFLAGS) -c $(PIC) $<

{.}.c$(OBJEXT):
		$(CC) $(CFLAGS) -c $(PIC) $<

LINK32_FLAGS=../../kaffevm/libkaffe_vm.lib kernel32.lib user32.lib gdi32.lib winspool.lib\
 comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib\
 odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /incremental:yes\
 /pdb:$(LIBNAME).pdb /debug /machine:I386 /def:$(LIBNAME).def\
 /out:$(LLIB) /implib:$(LIBNAME).lib 
DEF_FILE= \
	$(LIBNAME).def

$(LLIB) : $(DEF_FILE) $(OBJECT)
    $(LINK32) @<<
  $(LINK32_FLAGS) $(OBJECT)
<<


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

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

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

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


clean:
		del *.obj
		del *.lib
		del *.dll
	-@erase $(LIBNAME).dll
	-@erase $(LIBNAME).exp
	-@erase $(LIBNAME).ilk
	-@erase $(LIBNAME).lib
	-@erase $(LIBNAME).pdb
	-@erase vc40.idb
	-@erase vc40.pdb
	-@erase vc41.pch

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

install:
        if not exist "$(libdir)/$(NULL)" mkdir "$(libdir)"
		$(INSTALL_DATA) $(LLIB) $(libdir)/$(LLIB)
		del $(libdir)/$(LLIB)
