#################################################################
#
# Targets
#
#################################################################
T1 = dbServer.exe

#################################################################
#
# Compile flags
#
#################################################################
CC = gcc
#CFLAGS = -c -O2 -Wall -W -g -DDEBUG             # RR
#CFLAGS = -c -O2 -Wall -W -g -DEVAL #-DUSE_ERTF  # ERTF
CFLAGS = -c -Wall -W -g -DEVAL -DDEBUG -I../include
LDFLAGS = -lm -pthread -lreadline -ltermcap -lz -L/usr/local/lib:/usr/lib
GTK_CFLAGS = `gtk-config --cflags`
GTK_LDFLAGS = `gtk-config --libs`
RM = rm -f

#################################################################
#
# Objects
#
#################################################################
OBJ_DBSRV = headMetaw.o dbServer.o insertInto.o allocSchema.o newThread.o sendAnswerListToClient.o appendInto.o parser.o selectFrom.o createTable.o createWindow.o execSelection.o deleteFrom.o dropTable.o getCor.o getEuclid.o getDTW.o getLCS.o lockMgr.o priority.o headSchema.o sortOrder.o recoveryMgr.o createIndex.o btree.o monitorMgr.o memfree.o buffMgr.o signal.o sendSchema.o sendMonitor.o sendWindow.o libNumeric.o synchr.o fft.o 
OBJ_LIBS = ../lib/libWrapper.o ../lib/connectCli.o ../lib/releaseAllocatedSpace.o ../lib/libkraft.o ../lib/createConnection.o

#################################################################
#
# Rules for make
#
#################################################################
all: $(T1) 

$(T1): $(OBJ_DBSRV) $(OBJ_LIBS)
	$(CC) $(LDFLAGS) -o $@ $^

.c.o:
	$(CC) $(CFLAGS) $<


#################################################################
#
# Clean up
#
#################################################################
clean: 
	$(RM) *.core *.stackdump err *.o *.exe *~ $(T1) 
