# Uncomment one of these CFLAGS.  The default is to compile with
# debugging features enabled.
# Possible -D options are:
# -DLD_MDEBUG if you are using dmalloc.
# -DLD_DEBUGCACHE if you want the cache to keep statistics.

#CFLAGS 	= -O2 -Iinclude/ -I/usr/local/include -Wall 
CFLAGS	= -g -Iinclude/ -I/usr/local/include -Wall

CC		= cc
CWARN	= -Wall
SRC		= libdict.c ldsock.c ldutil.c lderrno.c ldcache.c
OBJ		= libdict.o ldsock.o ldutil.o lderrno.o ldcache.o
CPPSRC	= libdict-wrap.cpp
CPPOBJ	= libdict-wrap.o
LIBDIR		= /home/fattie/lib
INCDIR		= /home/fattie/include

all: libdict.a example

install: all
	(cp -f libdict.a ${LIBDIR})
	(cd include; cp -f *.h ${INCDIR})
libdict-wrap.o:
	${CXX} ${CFLAGS} -c libdict-wrap.cpp
libdict.a: ${OBJ} ${CPPOBJ}
	rm -f libdict.a
	ar rc libdict.a *.o
	ranlib libdict.a
clean: clean-example
	rm -f *.o *.core core 
superclean: clean
	rm -f libdict.a
example:
	(cd examples; make)
clean-example:
	(cd examples; make clean)
