all: test.exe

test.exe: test.c libtest.a
	clang -o test.exe -fuse-ld=lld test.c -nodefaultlibs -nostartfiles libtest.a -Wl,-entry:testentry -target i686-windows -Wl,-subsystem:windows

libtest.a: test.def Makefile
	lld-link -machine:i386 -def:test.def -implib:libtest.a

test: test.exe
	winedump -j import test.exe |grep TestFunc

clean:
	rm -f libtest.a test.exe
