GDAL_ROOT = ..\..

!INCLUDE $(GDAL_ROOT)\nmake.opt

TERRALIB_DIR = C:\Dev\Terralib

OBJ	= TerraLibDataset.obj TerraLibRasterBand.obj \
      $(TERRALIB_DIR)\examples\Debug\TeAdoDB.obj \
      $(TERRALIB_DIR)\examples\Debug\TeMySQL.obj

TERRALIB_LIB = $(TERRALIB_DIR)\Debug\terralib\terralib.lib

EXTRAFLAGS = $(EXTRAFLAGS) \
             -I$(TERRALIB_DIR)\src\terralib\kernel \
             -I$(TERRALIB_DIR)\src\terralib\drivers\MySQL \
             -I$(TERRALIB_DIR)\src\terralib\drivers\MySQL\include \
             -I$(TERRALIB_DIR)\src\terralib\application \
             -I$(TERRALIB_DIR)\terralibw\ado\

default: $(OBJ) 
	xcopy /D  /Y *.obj ..\o
	cd..
	
clean:
	-del *.obj
	-del *.dll
	-del *.exp
	-del *.ilk
	-del *.lib
	-del *.pdb
	-del *.tlh
	-del *.tli
	cd ..

plugin:	gdal_TERRALIB.dll

gdal_TERRALIB.dll: $(OBJ)
	link /nologo /dll $(LDEBUG) /out:gdal_TERRALIB.dll /NODEFAULTLIB:MSVCRT $(OBJ) $(GDALLIB) \
	$(TERRALIB_LIB) $(TERRALIB_DIR)\terralibw\MySQL\libmysql.lib
