# Copyright (C) 2015  The Bochs Project
#
# 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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA

# Makefile for the cpu/avx component of bochs

.SUFFIXES: .cc

srcdir = .

top_builddir    = ../..
top_srcdir      = ../..

SHELL = /bin/sh



CC       = cl
CFLAGS   = /nologo /MT /W3 /DNDEBUG /DWIN32 /D_WINDOWS /D_CRT_SECURE_NO_WARNINGS /O2 /Gr /EHs-c- 
CXX      = cl
CXXFLAGS = /nologo /MT /W3 /DNDEBUG /DWIN32 /D_WINDOWS /D_CRT_SECURE_NO_WARNINGS /O2 /Gr /EHs-c- 

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

LDFLAGS    = 
LIBS       = 
RANLIB     = echo

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

# Objects which are only used for AVX / EVEX code
AVX_OBJS = \
	avx.o \
	avx_pfp.o \
	avx_cvt.o \
	avx_fma.o \
	avx2.o \
	avx512.o \
	avx512_move.o \
	avx512_pfp.o \
	avx512_rcp14.o \
	avx512_rsqrt14.o \
	avx512_cvt.o \
	avx512_fma.o \
	avx512_mask8.o \
	avx512_mask16.o \
	avx512_mask32.o \
	avx512_mask64.o \
	avx512_conflict.o \
	gather.o \
	tbm32.o \
	tbm64.o \
	xop.o

all: libavx.a

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

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


libavx.a: $(AVX_OBJS)
	-del libavx.a
	lib /nologo /subsystem:console,"5.01" /verbose /out:$@ $(AVX_OBJS)
	$(RANLIB) libavx.a

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

dist-clean: clean
	-del Makefile

###########################################
# dependencies generated by
#  gcc -MM -I.. -I../.. -I../../instrument/stubs *.cc | sed 's/\.cc/.cc/g'
###########################################
avx.o: avx.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../gui/siminterface.h ../../cpudb.h ../../gui/paramtree.h \
 ../../memory/memory.h ../../pc_system.h ../../gui/gui.h \
 ../../instrument/stubs/instrument.h ../cpu.h ../access.h ../cpuid.h ../crregs.h \
 ../descriptor.h ../instr.h ../ia_opcodes.h ../lazy_flags.h ../icache.h \
 ../apic.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h ../fpu/status_w.h \
 ../fpu/control_w.h ../xmm.h ../vmx.h ../svm.h ../stack.h ../simd_int.h
avx_cvt.o: avx_cvt.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../gui/siminterface.h ../../cpudb.h ../../gui/paramtree.h \
 ../../memory/memory.h ../../pc_system.h ../../gui/gui.h \
 ../../instrument/stubs/instrument.h ../cpu.h ../access.h ../cpuid.h ../crregs.h \
 ../descriptor.h ../instr.h ../ia_opcodes.h ../lazy_flags.h ../icache.h \
 ../apic.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h ../fpu/status_w.h \
 ../fpu/control_w.h ../xmm.h ../vmx.h ../svm.h ../stack.h
avx_fma.o: avx_fma.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../gui/siminterface.h ../../cpudb.h ../../gui/paramtree.h \
 ../../memory/memory.h ../../pc_system.h ../../gui/gui.h \
 ../../instrument/stubs/instrument.h ../cpu.h ../access.h ../cpuid.h ../crregs.h \
 ../descriptor.h ../instr.h ../ia_opcodes.h ../lazy_flags.h ../icache.h \
 ../apic.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h ../fpu/status_w.h \
 ../fpu/control_w.h ../xmm.h ../vmx.h ../svm.h ../stack.h ../simd_pfp.h
avx_pfp.o: avx_pfp.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../gui/siminterface.h ../../cpudb.h ../../gui/paramtree.h \
 ../../memory/memory.h ../../pc_system.h ../../gui/gui.h \
 ../../instrument/stubs/instrument.h ../cpu.h ../access.h ../cpuid.h ../crregs.h \
 ../descriptor.h ../instr.h ../ia_opcodes.h ../lazy_flags.h ../icache.h \
 ../apic.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h ../fpu/status_w.h \
 ../fpu/control_w.h ../xmm.h ../vmx.h ../svm.h ../stack.h \
 ../fpu/softfloat-compare.h ../fpu/softfloat.h ../simd_pfp.h \
 ../simd_int.h
avx2.o: avx2.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../gui/siminterface.h ../../cpudb.h ../../gui/paramtree.h \
 ../../memory/memory.h ../../pc_system.h ../../gui/gui.h \
 ../../instrument/stubs/instrument.h ../cpu.h ../access.h ../cpuid.h ../crregs.h \
 ../descriptor.h ../instr.h ../ia_opcodes.h ../lazy_flags.h ../icache.h \
 ../apic.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h ../fpu/status_w.h \
 ../fpu/control_w.h ../xmm.h ../vmx.h ../svm.h ../stack.h ../simd_int.h \
 ../simd_compare.h
avx512.o: avx512.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../gui/siminterface.h ../../cpudb.h ../../gui/paramtree.h \
 ../../memory/memory.h ../../pc_system.h ../../gui/gui.h \
 ../../instrument/stubs/instrument.h ../cpu.h ../access.h ../cpuid.h ../crregs.h \
 ../descriptor.h ../instr.h ../ia_opcodes.h ../lazy_flags.h ../icache.h \
 ../apic.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h ../fpu/status_w.h \
 ../fpu/control_w.h ../xmm.h ../vmx.h ../svm.h ../stack.h ../simd_int.h \
 ../simd_compare.h
avx512_conflict.o: avx512_conflict.cc ../../bochs.h ../../config.h \
 ../../osdep.h ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../gui/siminterface.h ../../cpudb.h ../../gui/paramtree.h \
 ../../memory/memory.h ../../pc_system.h ../../gui/gui.h \
 ../../instrument/stubs/instrument.h ../cpu.h ../access.h ../cpuid.h ../crregs.h \
 ../descriptor.h ../instr.h ../ia_opcodes.h ../lazy_flags.h ../icache.h \
 ../apic.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h ../fpu/status_w.h \
 ../fpu/control_w.h ../xmm.h ../vmx.h ../svm.h ../stack.h ../simd_int.h \
 ../scalar_arith.h
avx512_cvt.o: avx512_cvt.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../gui/siminterface.h ../../cpudb.h ../../gui/paramtree.h \
 ../../memory/memory.h ../../pc_system.h ../../gui/gui.h \
 ../../instrument/stubs/instrument.h ../cpu.h ../access.h ../cpuid.h ../crregs.h \
 ../descriptor.h ../instr.h ../ia_opcodes.h ../lazy_flags.h ../icache.h \
 ../apic.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h ../fpu/status_w.h \
 ../fpu/control_w.h ../xmm.h ../vmx.h ../svm.h ../stack.h ../simd_int.h
avx512_fma.o: avx512_fma.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../gui/siminterface.h ../../cpudb.h ../../gui/paramtree.h \
 ../../memory/memory.h ../../pc_system.h ../../gui/gui.h \
 ../../instrument/stubs/instrument.h ../cpu.h ../access.h ../cpuid.h ../crregs.h \
 ../descriptor.h ../instr.h ../ia_opcodes.h ../lazy_flags.h ../icache.h \
 ../apic.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h ../fpu/status_w.h \
 ../fpu/control_w.h ../xmm.h ../vmx.h ../svm.h ../stack.h ../simd_int.h \
 ../simd_pfp.h
avx512_mask16.o: avx512_mask16.cc ../../bochs.h ../../config.h \
 ../../osdep.h ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../gui/siminterface.h ../../cpudb.h ../../gui/paramtree.h \
 ../../memory/memory.h ../../pc_system.h ../../gui/gui.h \
 ../../instrument/stubs/instrument.h ../cpu.h ../access.h ../cpuid.h ../crregs.h \
 ../descriptor.h ../instr.h ../ia_opcodes.h ../lazy_flags.h ../icache.h \
 ../apic.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h ../fpu/status_w.h \
 ../fpu/control_w.h ../xmm.h ../vmx.h ../svm.h ../stack.h
avx512_mask32.o: avx512_mask32.cc ../../bochs.h ../../config.h \
 ../../osdep.h ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../gui/siminterface.h ../../cpudb.h ../../gui/paramtree.h \
 ../../memory/memory.h ../../pc_system.h ../../gui/gui.h \
 ../../instrument/stubs/instrument.h ../cpu.h ../access.h ../cpuid.h ../crregs.h \
 ../descriptor.h ../instr.h ../ia_opcodes.h ../lazy_flags.h ../icache.h \
 ../apic.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h ../fpu/status_w.h \
 ../fpu/control_w.h ../xmm.h ../vmx.h ../svm.h ../stack.h
avx512_mask64.o: avx512_mask64.cc ../../bochs.h ../../config.h \
 ../../osdep.h ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../gui/siminterface.h ../../cpudb.h ../../gui/paramtree.h \
 ../../memory/memory.h ../../pc_system.h ../../gui/gui.h \
 ../../instrument/stubs/instrument.h ../cpu.h ../access.h ../cpuid.h ../crregs.h \
 ../descriptor.h ../instr.h ../ia_opcodes.h ../lazy_flags.h ../icache.h \
 ../apic.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h ../fpu/status_w.h \
 ../fpu/control_w.h ../xmm.h ../vmx.h ../svm.h ../stack.h
avx512_mask8.o: avx512_mask8.cc ../../bochs.h ../../config.h \
 ../../osdep.h ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../gui/siminterface.h ../../cpudb.h ../../gui/paramtree.h \
 ../../memory/memory.h ../../pc_system.h ../../gui/gui.h \
 ../../instrument/stubs/instrument.h ../cpu.h ../access.h ../cpuid.h ../crregs.h \
 ../descriptor.h ../instr.h ../ia_opcodes.h ../lazy_flags.h ../icache.h \
 ../apic.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h ../fpu/status_w.h \
 ../fpu/control_w.h ../xmm.h ../vmx.h ../svm.h ../stack.h
avx512_move.o: avx512_move.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../gui/siminterface.h ../../cpudb.h ../../gui/paramtree.h \
 ../../memory/memory.h ../../pc_system.h ../../gui/gui.h \
 ../../instrument/stubs/instrument.h ../cpu.h ../access.h ../cpuid.h ../crregs.h \
 ../descriptor.h ../instr.h ../ia_opcodes.h ../lazy_flags.h ../icache.h \
 ../apic.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h ../fpu/status_w.h \
 ../fpu/control_w.h ../xmm.h ../vmx.h ../svm.h ../stack.h ../simd_int.h
avx512_pfp.o: avx512_pfp.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../gui/siminterface.h ../../cpudb.h ../../gui/paramtree.h \
 ../../memory/memory.h ../../pc_system.h ../../gui/gui.h \
 ../../instrument/stubs/instrument.h ../cpu.h ../access.h ../cpuid.h ../crregs.h \
 ../descriptor.h ../instr.h ../ia_opcodes.h ../lazy_flags.h ../icache.h \
 ../apic.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h ../fpu/status_w.h \
 ../fpu/control_w.h ../xmm.h ../vmx.h ../svm.h ../stack.h \
 ../fpu/softfloat-compare.h ../fpu/softfloat.h ../simd_int.h \
 ../simd_pfp.h ../fpu/softfloat-specialize.h
avx512_rcp14.o: avx512_rcp14.cc ../../bochs.h ../../config.h \
 ../../osdep.h ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../gui/siminterface.h ../../cpudb.h ../../gui/paramtree.h \
 ../../memory/memory.h ../../pc_system.h ../../gui/gui.h \
 ../../instrument/stubs/instrument.h ../cpu.h ../access.h ../cpuid.h ../crregs.h \
 ../descriptor.h ../instr.h ../ia_opcodes.h ../lazy_flags.h ../icache.h \
 ../apic.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h ../fpu/status_w.h \
 ../fpu/control_w.h ../xmm.h ../vmx.h ../svm.h ../stack.h \
 ../fpu/softfloat-specialize.h ../fpu/softfloat.h \
 ../fpu/softfloat-round-pack.h ../simd_int.h
avx512_rsqrt14.o: avx512_rsqrt14.cc ../../bochs.h ../../config.h \
 ../../osdep.h ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../gui/siminterface.h ../../cpudb.h ../../gui/paramtree.h \
 ../../memory/memory.h ../../pc_system.h ../../gui/gui.h \
 ../../instrument/stubs/instrument.h ../cpu.h ../access.h ../cpuid.h ../crregs.h \
 ../descriptor.h ../instr.h ../ia_opcodes.h ../lazy_flags.h ../icache.h \
 ../apic.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h ../fpu/status_w.h \
 ../fpu/control_w.h ../xmm.h ../vmx.h ../svm.h ../stack.h \
 ../fpu/softfloat-specialize.h ../fpu/softfloat.h \
 ../fpu/softfloat-round-pack.h ../simd_int.h
gather.o: gather.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../gui/siminterface.h ../../cpudb.h ../../gui/paramtree.h \
 ../../memory/memory.h ../../pc_system.h ../../gui/gui.h \
 ../../instrument/stubs/instrument.h ../cpu.h ../access.h ../cpuid.h ../crregs.h \
 ../descriptor.h ../instr.h ../ia_opcodes.h ../lazy_flags.h ../icache.h \
 ../apic.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h ../fpu/status_w.h \
 ../fpu/control_w.h ../xmm.h ../vmx.h ../svm.h ../stack.h
tbm32.o: tbm32.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../gui/siminterface.h ../../cpudb.h ../../gui/paramtree.h \
 ../../memory/memory.h ../../pc_system.h ../../gui/gui.h \
 ../../instrument/stubs/instrument.h ../cpu.h ../access.h ../cpuid.h ../crregs.h \
 ../descriptor.h ../instr.h ../ia_opcodes.h ../lazy_flags.h ../icache.h \
 ../apic.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h ../fpu/status_w.h \
 ../fpu/control_w.h ../xmm.h ../vmx.h ../svm.h ../stack.h \
 ../scalar_arith.h
tbm64.o: tbm64.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../gui/siminterface.h ../../cpudb.h ../../gui/paramtree.h \
 ../../memory/memory.h ../../pc_system.h ../../gui/gui.h \
 ../../instrument/stubs/instrument.h ../cpu.h ../access.h ../cpuid.h ../crregs.h \
 ../descriptor.h ../instr.h ../ia_opcodes.h ../lazy_flags.h ../icache.h \
 ../apic.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h ../fpu/status_w.h \
 ../fpu/control_w.h ../xmm.h ../vmx.h ../svm.h ../stack.h \
 ../scalar_arith.h
xop.o: xop.cc ../../bochs.h ../../config.h ../../osdep.h \
 ../../bx_debug/debug.h ../../config.h ../../osdep.h \
 ../../gui/siminterface.h ../../cpudb.h ../../gui/paramtree.h \
 ../../memory/memory.h ../../pc_system.h ../../gui/gui.h \
 ../../instrument/stubs/instrument.h ../cpu.h ../access.h ../cpuid.h ../crregs.h \
 ../descriptor.h ../instr.h ../ia_opcodes.h ../lazy_flags.h ../icache.h \
 ../apic.h ../i387.h ../fpu/softfloat.h ../fpu/tag_w.h ../fpu/status_w.h \
 ../fpu/control_w.h ../xmm.h ../vmx.h ../svm.h ../stack.h ../simd_int.h \
 ../simd_compare.h
