CC	= cl
CFLAGS	= /O2 /Iinclude\libxmp-lite /Isrc /DBUILDING_DLL /DWIN32 \
          /Dinline=__inline /D_USE_MATH_DEFINES /DLIBXMP_CORE_PLAYER
LD	= link
LDFLAGS	= /DLL /RELEASE /OUT:$(DLL)
DLL	= libxmp-lite.dll

OBJS	= src\virtual.obj src\format.obj src\period.obj src\player.obj src\read_event.obj src\dataio.obj src\lfo.obj src\scan.obj src\control.obj src\filter.obj src\effects.obj src\mixer.obj src\mix_all.obj src\load_helpers.obj src\load.obj src\hio.obj src\smix.obj src\memio.obj src\loaders\common.obj src\loaders\itsex.obj src\loaders\sample.obj src\loaders\xm_load.obj src\loaders\mod_load.obj src\loaders\s3m_load.obj src\loaders\it_load.obj

TEST	= test\md5.obj test\test.obj

.c.obj:
	$(CC) /c $(CFLAGS) /Fo$*.obj $<

all: $(DLL)

$(DLL): $(OBJS)
	$(LD) $(LDFLAGS) $(OBJS)

clean:
	del $(OBJS) $(DLL) *.lib *.exp

check: $(TEST)
	$(LD) /RELEASE /OUT:test\libxmp-lite-test.exe $(TEST) libxmp-lite.lib
	copy libxmp-lite.dll test
	cd test & libxmp-lite-test
