#
#	mysql C++ wrapper library
#
#	Author: Roland Haenel <rh@ginster.net>
#
#	This program is in the public domain.
#	Distribute and use it freely.

# Don't change this!
VERSION = 0.02

# Compiler options (not to be changed under normal conditions)
CC		= g++
CPPFLAGS	= -O2 -Wall -Wstrict-prototypes
LFLAGS  	= -s
INCLUDES	= -I/usr/include/mysql
LIBS		= -L/usr/lib/mysql -lmysqlclient 
# All of our object files
OBJS	= database.o example.o
CFLAGS	= $(INCLUDES) -DDB_VERSION=\"$(VERSION)\" $(CPPFLAGS)

all:    .depend $(OBJS)
	$(CC) $(LFLAGS) $(OBJS) -o example $(LIBS)
	@echo -e "\nDone. Just link database.o with your programs."

clean:
	rm -f *.o *~ .depend example

.depend: *.h
	$(CC) $(CFLAGS) -M *.cc > .depend

dist:
	rm -f mysql-c++-$(VERSION).tar.gz
	tar -czf mysql-c++-$(VERSION).tar.gz *.cc *.h README Makefile COPYING

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

ifeq (.depend,$(wildcard .depend))
include .depend
endif
