default:
	make runcoff.exe
	make test_program.obj

all:
	make clean	
	make runcoff.exe
	make test_program.obj

go:
	nasm -f win32 coff.asm -o coff.obj
	golink /mix /console coff.obj /entry:main msvcrt.dll
	coff

win:
	nasm -f win32 coff.asm -o coff.obj
	cl coff.obj /link /entry:main msvcrt.lib
	coff

gnu:
	c++ -static -O2 runcoff.cpp -o runcoff.exe
	strip runcoff.exe

runcoff.exe:runcoff.obj
	cl runcoff.obj /Feruncoff.exe

runcoff.obj:runcoff.cpp
	cl /EHsc /c runcoff.cpp

test_program.obj:test_program.asm
	nasm -f coff test_program.asm -o test_program.obj
	nasm -f coff hello.asm -o hello.obj
	nasm -f coff hello3.asm -o hello3.obj
	nasm -f coff array.asm -o array.obj

array:
	nasm -f coff array.asm -o array.obj
	runcoff array.obj msvcrt.dll

b:
	nasm -f coff addr.asm -o addr.obj
	runcoff addr.obj msvcrt.dll

bin:
	cl /GX get_bytes.cpp
	nasm -f bin static.asm -o static.bin
	get_bytes static.bin

coff:
	nasm -f coff coff.asm -o coff.obj
	runcoff coff.obj msvcrt.dll

my:
	nasm -f coff myhello.asm -o myhello.obj
	runcoff myhello.obj msvcrt.dll

test:test_program.obj hello.obj hello3.obj runcoff.exe
	runcoff test_program.obj hello.obj hello3.obj msvcrt.dll
	runcoff array.obj msvcrt.dll

link.exe:link.obj
	cl link.obj

link.obj:link.cpp
	cl /c link.cpp

clean:
	del /Q *.obj
	del /Q runcoff.exe
	del /Q link.exe
