# Copyright (c) 2007-2023 Vincent ROGIER <vince.rogier@ocilib.net>
#  
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without 
# modifications, as long as this notice is preserved.
# 
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

CC = g++
CFLAGS =  -Wall -DOCI_CHARSET_ANSI
EXEC_NAME = ocilib_tests
INCLUDES = -I/usr/local/include -I/usr/local/include
LIBS = -L/opt/oracle/instantclient_21_7 -lclntsh  -L/usr/local/lib -locilib -lgtest -lgtest_main -lpthread
SOURCES := $(wildcard *.cpp) 
OBJS := $(addsuffix .o, $(basename $(notdir $(SOURCES))))

all: $(EXEC_NAME)
    
$(EXEC_NAME): $(OBJS)
	$(CC) -o $(EXEC_NAME) $(OBJS) $(LIBS)

%.o: %.cpp
	$(CC) $(CFLAGS) $(INCLUDES) -o $@ -c $<

clean: 
	rm -f *~ $(EXEC_NAME) 
	rm -f *~ $(OBJS)

