default:
	make win32 

all:
	make clean
	make win32

win32:
	wine cmd.exe /c build.bat

t:
	nasm -f elf state_tools.asm -o state_tools.o
	/compat/linux/usr/bin/c++ -m32 -g state_test.cpp state_tools.o -o state_test.out
	rm -f state.dat
	./state_test.out
	./state_test.out
	c++ -g reload.cpp -o reload.out

unix:
	c++ -O2 var_test.cpp -o var_test
	c++ -O2 d_alloc.cpp d_db.cpp int_test.cpp -o int_test
	c++ -O2 d_alloc.cpp d_db.cpp d_test.cpp -o d_test
	c++ -O2 tcp_stream.cpp wget.cpp -o wget
	c++ -O2 tftp.cpp -o tftp
	c++ -O2 str_test.cpp -o str_test
	c++ -O2 tcp_stream.cpp wget.cpp -o wget
	c++ -O2 tcp_stream.cpp smtp_test.cpp -o smtp_test
	c++ -O2 shell_test.cpp -o shell_test

test:
	wine cmd /c str_test.exe
	wine cmd /c var_test.exe
	wine cmd /c int_test.exe -init
	wine cmd /c d_test.exe -init
	wine cmd /c d_test.exe 
	wine cmd /c wget http://www.google.com/
	wine cmd /c smtp_test 25 matthewcoan1976@hotmail.com
	wine cmd /c tftp GET 192.168.1.1 hello.txt
	wine cmd /c sparse_matrix
	wine cmd /c shell_test
	wine cmd /c test_dh

clean:
	rm -rf *.o core *.core
