# Copyright (C) 2001  MandrakeSoft S.A.
#
#   MandrakeSoft S.A.
#   43, rue d'Aboukir
#   75002 Paris - France
#   http://www.linux-mandrake.com/
#   http://www.mandrakesoft.com/
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA

.SUFFIXES: .cpp

srcdir = .


SHELL = /bin/sh



CC       = cl
CFLAGS   = /nologo /G6 /MT /W3 /GX /DNDEBUG /DWIN32 /D_WINDOWS /O2
CXX      = cl
CXXFLAGS = /nologo /G6 /MT /W3 /GX /DNDEBUG /DWIN32 /D_WINDOWS /O2

#CFLAGS  = -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strict-aliasing -pipe -fno-strength-reduce -mpreferred-stack-boundary=2 -DCPU=686 -march=i686

LDFLAGS    = 
LIBS       = 
X_LIBS     = 
X_PRE_LIBS = 
RANLIB     = echo

#DEBUG	 = -DDEBUGGING
PARANOID = -DPARANOID

L_TARGET = libfpu.a


BX_INCDIRS = -I.. -I$(srcdir)/.. -I../instrument/stubs -I$(srcdir)/../instrument/stubs -I. -I$(srcdir)/. -I./stubs -I$(srcdir)/./stubs

FPU_FLAGS = -DUSE_WITH_CPU_SIM $(PARANOID) $(DEBUG) -DNO_ASSEMBLER
FPU_GLUE_OBJ = wmFPUemu_glue.o

# From 'C' language sources:
C_OBJS = fpu_entry.o errors.o reg_ld_str.o load_store.o \
	fpu_arith.o fpu_aux.o fpu_etc.o fpu_tags.o fpu_trig.o \
	poly_atan.o poly_l2.o poly_2xm1.o poly_sin.o poly_tan.o \
	reg_add_sub.o reg_compare.o reg_constant.o reg_convert.o \
	reg_divide.o reg_mul.o

# From 80x86 assembler sources:
A_OBJS =reg_u_add.o reg_u_div.o reg_u_mul.o reg_u_sub.o \
	div_small.o reg_norm.o reg_round.o \
	wm_shrx.o wm_sqrt.o \
	div_Xsig.o polynom_Xsig.o round_Xsig.o \
	shr_Xsig.o mul_Xsig.o

L_OBJS = $(C_OBJS) $(A_OBJS)

OBJS = \
	fpu.o \
	$(FPU_GLUE_OBJ) \
	$(L_OBJS)


BX_INCLUDES = ../bochs.h ../config.h


.cpp.o:
	$(CXX) /c $(CXXFLAGS) $(FPU_FLAGS) $(BX_INCDIRS) /Tp$< /Fo$@

.S.o:
	$(CC) -I./stubs -D__ASSEMBLY__ $(PARANOID) -c $<

.c.o:
	$(CC) /c $(CFLAGS) $(FPU_FLAGS) $(BX_INCDIRS) $< /Fo$@


libfpu.a: $(OBJS)
	-del libfpu.a
	lib.exe /nologo /subsystem:console /machine:I386 /verbose /out:$@ $(OBJS)
	$(RANLIB) libfpu.a

$(OBJS): $(BX_INCLUDES)

clean:
	-del *.o
	-del *.a

dist-clean: clean
	-del Makefile

###########################################
# dependencies generated by
#  gcc -MM -I. -I.. -I../instrument/stubs -Istubs *.c  *.cc | sed 's/\.cc/.cpp/g'
###########################################
div_Xsig.o: div_Xsig.c exception.h fpu_emu.h fpu_system.h fpu_proto.h \
 poly.h
div_small.o: div_small.c fpu_emu.h fpu_system.h fpu_proto.h
errors.o: errors.c fpu_emu.h fpu_system.h fpu_proto.h exception.h \
 status_w.h control_w.h reg_constant.h version.h
fpu_arith.o: fpu_arith.c fpu_system.h fpu_emu.h fpu_proto.h \
 control_w.h status_w.h
fpu_aux.o: fpu_aux.c fpu_system.h exception.h fpu_emu.h fpu_proto.h \
 status_w.h control_w.h
fpu_entry.o: fpu_entry.c fpu_system.h fpu_emu.h fpu_proto.h \
 exception.h control_w.h status_w.h
fpu_etc.o: fpu_etc.c fpu_system.h exception.h fpu_emu.h fpu_proto.h \
 status_w.h reg_constant.h
fpu_tags.o: fpu_tags.c fpu_emu.h fpu_system.h fpu_proto.h exception.h
fpu_trig.o: fpu_trig.c fpu_system.h exception.h fpu_emu.h fpu_proto.h \
 status_w.h control_w.h reg_constant.h
get_address.o: get_address.c fpu_system.h exception.h fpu_emu.h \
 fpu_proto.h
load_store.o: load_store.c fpu_system.h exception.h fpu_emu.h \
 fpu_proto.h status_w.h control_w.h
mul_Xsig.o: mul_Xsig.c fpu_emu.h fpu_system.h fpu_proto.h poly.h
poly_2xm1.o: poly_2xm1.c exception.h fpu_emu.h fpu_system.h \
 fpu_proto.h reg_constant.h control_w.h poly.h
poly_atan.o: poly_atan.c exception.h fpu_emu.h fpu_system.h \
 fpu_proto.h reg_constant.h status_w.h control_w.h poly.h
poly_l2.o: poly_l2.c exception.h fpu_emu.h fpu_system.h fpu_proto.h \
 reg_constant.h control_w.h poly.h
poly_sin.o: poly_sin.c exception.h fpu_emu.h fpu_system.h fpu_proto.h \
 reg_constant.h control_w.h poly.h
poly_tan.o: poly_tan.c exception.h fpu_emu.h fpu_system.h fpu_proto.h \
 reg_constant.h control_w.h poly.h
polynom_Xsig.o: polynom_Xsig.c fpu_emu.h fpu_system.h fpu_proto.h \
 poly.h
reg_add_sub.o: reg_add_sub.c exception.h fpu_emu.h fpu_system.h \
 fpu_proto.h reg_constant.h control_w.h
reg_compare.o: reg_compare.c fpu_system.h exception.h fpu_emu.h \
 fpu_proto.h control_w.h status_w.h
reg_constant.o: reg_constant.c fpu_system.h fpu_emu.h fpu_proto.h \
 status_w.h reg_constant.h control_w.h
reg_convert.o: reg_convert.c exception.h fpu_emu.h fpu_system.h \
 fpu_proto.h
reg_divide.o: reg_divide.c exception.h fpu_emu.h fpu_system.h \
 fpu_proto.h reg_constant.h
reg_ld_str.o: reg_ld_str.c fpu_emu.h fpu_system.h fpu_proto.h \
 exception.h reg_constant.h control_w.h status_w.h
reg_mul.o: reg_mul.c fpu_emu.h fpu_system.h fpu_proto.h exception.h \
 reg_constant.h
reg_norm.o: reg_norm.c fpu_emu.h fpu_system.h fpu_proto.h
reg_round.o: reg_round.c fpu_emu.h fpu_system.h fpu_proto.h \
 exception.h control_w.h
reg_u_add.o: reg_u_add.c exception.h fpu_emu.h fpu_system.h \
 fpu_proto.h control_w.h
reg_u_div.o: reg_u_div.c exception.h fpu_emu.h fpu_system.h \
 fpu_proto.h control_w.h
reg_u_mul.o: reg_u_mul.c exception.h fpu_emu.h fpu_system.h \
 fpu_proto.h control_w.h
reg_u_sub.o: reg_u_sub.c exception.h fpu_emu.h fpu_system.h \
 fpu_proto.h control_w.h
round_Xsig.o: round_Xsig.c fpu_emu.h fpu_system.h fpu_proto.h poly.h
shr_Xsig.o: shr_Xsig.c fpu_emu.h fpu_system.h fpu_proto.h poly.h
wm_shrx.o: wm_shrx.c fpu_emu.h fpu_system.h fpu_proto.h
wm_sqrt.o: wm_sqrt.c exception.h fpu_emu.h fpu_system.h fpu_proto.h
fpu.o: fpu.cpp ../bochs.h ../config.h ../osdep.h ../debug/debug.h \
 ../bxversion.h ../gui/siminterface.h ../state_file.h ../cpu/cpu.h \
 ../cpu/lazy_flags.h ../memory/memory.h ../pc_system.h ../gui/gui.h \
 ../gui/control.h ../iodev/iodev.h ../iodev/pci.h ../iodev/vga.h \
 ../iodev/cmos.h ../iodev/dma.h ../iodev/floppy.h ../iodev/harddrv.h \
 ../iodev/keyboard.h ../iodev/parallel.h ../iodev/pic.h ../iodev/pit.h \
 ../iodev/pit_wrap.h ../iodev/pit82c54.h ../iodev/serial.h \
 ../iodev/unmapped.h ../iodev/eth.h ../iodev/ne2k.h \
 ../iodev/guest2host.h ../iodev/slowdown_timer.h \
 ../instrument/stubs/instrument.h
wmFPUemu_glue.o: wmFPUemu_glue.cpp ../bochs.h ../config.h ../osdep.h \
 ../debug/debug.h ../bxversion.h ../gui/siminterface.h ../state_file.h \
 ../cpu/cpu.h ../cpu/lazy_flags.h ../memory/memory.h ../pc_system.h \
 ../gui/gui.h ../gui/control.h ../iodev/iodev.h ../iodev/pci.h \
 ../iodev/vga.h ../iodev/cmos.h ../iodev/dma.h ../iodev/floppy.h \
 ../iodev/harddrv.h ../iodev/keyboard.h ../iodev/parallel.h \
 ../iodev/pic.h ../iodev/pit.h ../iodev/pit_wrap.h ../iodev/pit82c54.h \
 ../iodev/serial.h ../iodev/unmapped.h ../iodev/eth.h ../iodev/ne2k.h \
 ../iodev/guest2host.h ../iodev/slowdown_timer.h \
 ../instrument/stubs/instrument.h fpu_emu.h fpu_system.h fpu_proto.h \
 stubs/linux/signal.h
