CC = cl 
CXXC = cl
CFLAGS = -O2 -GX -GB -W3 -nologo
LDFLAGS = -ML ADVAPI32.LIB
DEFS = -DDLL_EXPORT -DHAVE_WINDOWS_H -DVERSION="\"@VERSION@\"" -DMODEL_VERSION=@MODEL_VERSION@ -DPACKAGE="\"yamcha\""
INC = -I. -I..
DEL = del

OBJ = chunker.obj  feature_index.obj  param.obj   svm.obj

.cpp.obj:
	$(CXXC) $(CFLAGS) $(INC) $(DEFS) -c $<
	              
.c.obj:
	$(CC) $(CFLAGS) $(INC) $(DEFS) -c  $<
		
all: libyamcha yamcha mkdarts mktrie pkemine
			 
yamcha: $(OBJ) yamcha.obj
	$(CXXC) $(LDFLAGS) /Fe$@.exe yamcha.obj libyamcha.lib

libyamcha: $(OBJ) libyamcha.obj
        $(CXXC) /GD /LD $(LDFLAGS) /Fe$@.dll $(OBJ) libyamcha.obj /link /dll
	
mkdarts:
	$(CXXC) $(CFLAGS) $(INC) $(LDFLAGS) /Fe..\libexec\$@.exe ..\libexec\mkdarts.cpp

mktrie:
	$(CXXC) $(CFLAGS) $(INC) $(LDFLAGS) /Fe..\libexec\$@.exe ..\libexec\mktrie.cpp

pkemine:
	$(CXXC) $(CFLAGS) $(INC) $(LDFLAGS) /Fe..\libexec\$@.exe ..\libexec\pkemine.cpp
	
clean:
	$(DEL) *.exe *.obj *.dll *.a *.lib *.o *.exp *.def
