# Set this to the directory containing perl includes and libraries
PERLDIR = c:\perl\5.6.0\lib\MSWin32-x86\CORE

CC = cl -c
CFLAGS = -DWIN32 -D_X86_ -D__i386__ -I$(PERLDIR)
PERLLIB = -libpath:$(PERLDIR) perl56.lib
PERLMAKE = $(MAKE) /fMakefile.perl "DEFINE=$(CFLAGS)"

OBJS = winetest.obj wine.obj

all: winetest.exe

winetest.exe: $(OBJS)
	link -out:$@ $(LDFLAGS) $(OBJS) $(PERLLIB)

winetest.obj: winetest.c
	$(CC) $(CFLAGS) winetest.c

wine.obj: wine.xs Makefile.perl
	$(PERLMAKE) wine.obj

Makefile.perl: Makefile.PL
	perl Makefile.PL

clean: Makefile.perl
	del winetest.exe $(OBJS)
	$(PERLMAKE) realclean
