TARGET = iem_adaptfilt

all: ..\$(TARGET).dll

VIS_CPP_COMP = cl
VIS_CPP_LINK = link
VIS_CPP_PATH = "$(PROGRAMFILES)\Microsoft Visual Studio 11.0\VC"
VIS_SDK_PATH = "$(PROGRAMFILES)\Windows Kits\8.1"
PD_INST_PATH = "$(PROGRAMFILES)\pd-0.48-1"
PD_WIN_INCLUDE_PATH = /I. /I$(PD_INST_PATH)\src /I$(VIS_CPP_PATH)\include /I..\include
PD_WIN_C_FLAGS = /nologo /W3 /WX /DMSW /DNT /DPD /DWIN32 /DWINDOWS /Ox -D_CRT_SECURE_NO_WARNINGS
PD_WIN_L_FLAGS = /nologo

PD_WIN_LIB = /NODEFAULTLIB:libcmt /NODEFAULTLIB:oldnames /NODEFAULTLIB:kernel32 \
	$(VIS_CPP_PATH)\lib\libcmt.lib \
	$(VIS_CPP_PATH)\lib\oldnames.lib \
	$(VIS_SDK_PATH)\Lib\winv6.3\um\x86\kernel32.lib \
	$(PD_INST_PATH)\bin\pd.lib

SRC =	NLMS~.c \
	NLMSerr_in~.c \
	NLMSCC~.c \
	n_CNLMS~.c \
	n_CLNLMS~.c \
	FXNLMSplus2in~.c \
	FXNLMSplus3in~.c \
	$(TARGET).c

OBJ = $(SRC:.c=.obj)

.c.obj:
	$(VIS_CPP_COMP) $(PD_WIN_C_FLAGS) $(PD_WIN_INCLUDE_PATH) /c $*.c

..\$(TARGET).dll: $(OBJ)
	$(VIS_CPP_LINK) $(PD_WIN_L_FLAGS) /dll /export:$(TARGET)_setup \
	/out:..\$(TARGET).dll $(OBJ) $(PD_WIN_LIB)

clean:
	del *.obj
