include ../../../GDALmake.opt

CC	=	@CC@
CXX	=	@CXX@
LD	=	@CXX@

CPPFLAGS = -DUSE_CPL $(JSON_INCLUDE) -I.. -I../.. -I../pgdump \
	  @GDAL_INC@ @PQ_INCLUDE@ @CPPFLAGS@
CXXFLAGS = @CXX_WFLAGS@ @CXX_PIC@
CFLAGS   = @CFLAGS@
LDFLAGS  = @LDFLAGS@

RANLIB		=	@RANLIB@
SO_EXT		=	@SO_EXT@
LD_SHARED	=	@LD_SHARED@

LIBS	=	@LIBS@ -ljson-c

AUTOLOAD_DIR	=	@AUTOLOAD_DIR@

GLIBNAME =	ogr_amigocloud.so

default:	$(GLIBNAME)

install:	default
	install -d $(AUTOLOAD_DIR)
	cp $(GLIBNAME) $(AUTOLOAD_DIR)

clean:
	rm -f $(GLIBNAME) *.o

distclean: clean
	rm -fr Makefile config.status config.log autom*.cache

$(GLIBNAME):	ogramigoclouddatasource.o ogramigocloudlayer.o ogramigocloudtablelayer.o ogramigoclouddriver.o ogramigocloudresultlayer.o
	$(LD_SHARED) $(LDFLAGS) ogramigoclouddatasource.o ogramigocloudlayer.o ogramigocloudtablelayer.o ogramigoclouddriver.o ogramigocloudresultlayer.o $(LIBS) -o $(GLIBNAME)

%.o:	%.cpp
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<

