PKG_CXXFLAGS=-I. -Icctz/include -Inanodbc
PKG_LIBS=-lodbc32 -Lcctz -lcctz

OBJECTS = odbc_result.o connection.o nanodbc.o result.o odbc_connection.o RcppExports.o Iconv.o utils.o

all: $(SHLIB)

$(SHLIB): $(OBJECTS)

$(OBJECTS): cctz/libcctz.a

cctz/libcctz.a:
	(cd cctz && \
$(MAKE) libcctz.a PREFIX="../" CC="$(CC)" CXX="$(CXX)" AR="$(AR)" ARFLAGS=$(ARFLAGS))

nanodbc.o: nanodbc/nanodbc.cpp
	$(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -DNANODBC_OVERALLOCATE_CHAR -c $< -o $@

clean:
	(cd cctz; $(MAKE) clean)
	rm -f $(OBJECTS) $(SHLIB)

.PHONY: all cctz clean
