# uncomment -one- of the following to indicate which sql engine you are using.
# also, make sure to indicate where to find either the mysql or msql libs 
# and includes below
DB_TYPE = -DGH_SQL_MYSQL
#DB_TYPE = -DGH_SQL_MSQL

# uncomment edit the following to lines to point to the appropriate 
# directories
MYSQL_INCLUDE = -I/usr/local/mysql/include 
MYSQL_LIB = -L/usr/local/mysql/lib/mysql -lmysqlclient

# uncomment and edit the following to lines to point to the appropriate 
# directories
#MSQL_INCLUDE = -I/usr/local/Hughes/include 
#MSQL_LIB = -L/usr/local/Hughes/lib/ -lmsql

# the following should be fine on most systems.
CC = gcc
CFLAGS = -g -Wall -O2 $(DB_TYPE)
INC = $(MYSQL_INCLUDE) $(MSQL_INCLUDE)
LIBS = -lguile $(MYSQL_LIB) $(MSQL_LIB)

EXEC = squile
OBJS = squile.o sql.o sql_imp.o	

squile:	$(OBJS)
	$(CC) $(CFLAGS) $(INC) -o $(EXEC) $(OBJS) $(LIBS)

sql.o: sql.c sql_imp.h
	$(CC) $(CFLAGS) $(INC) -c sql.c

sql_imp.o: sql_imp.c
	$(CC) $(CFLAGS) $(INC) -c sql_imp.c

squile.o: squile.c sql.h
	$(CC) $(CFLAGS) $(INC) -c squile.c


clean:
	rm -f $(OBJS) $(EXEC) *~ core

archive:
	ci -l -m. *.[ch] Makefile README

dist:
	(make clean; cd ..; tar cvf squile.tar squile; gzip squile.tar)