# clipper makefile

# set by configure
CLPR=/home/cowtan/clipper20
FFTW=/home/cowtan/clipper/ccp4-onlylibs-dev/
CXX=g++
LD=gcc
AR=ar cr
XCPPFLAGS=-O1 -fPIC -ftemplate-depth-30
MKLIBS=lib-core lib-contrib lib-phs lib-cif lib-mmdbold lib-mmdb lib-minimol lib-ccp4
LDLIBS=-lclipper-ccp4 -lccp4c -lclipper-minimol -lclipper-mmdb -lclipper-contrib -lclipper-core -lrfftw -lfftw -lmmdb -lstdc++ -lm


# these should be OK
IFFTW=${FFTW}/include
LFFTW=${FFTW}/lib

ICLPR=${CLPR}/include
LCLPR=${CLPR}/lib


CPPFLAGS=${XCPPFLAGS} -I${IFFTW} -I${ICLPR}
LDFLAGS=-L${LFFTW} -L${LCLPR}


# targets
TARGETS= cootaneer-demo


# make rules
all:	${TARGETS}

buccaneer-lib.o:	buccaneer-lib.cpp buccaneer-lib.h $(LCLPR)/*.a
		${CXX} $(CFLAGS) $(CPPFLAGS) -c $<

buccaneer-prot.o:	buccaneer-prot.cpp buccaneer-prot.h $(LCLPR)/*.a
		${CXX} $(CFLAGS) $(CPPFLAGS) -c $<

buccaneer-sequence.o:	buccaneer-sequence.cpp buccaneer-sequence.h $(LCLPR)/*.a
		${CXX} $(CFLAGS) $(CPPFLAGS) -c $<

cootaneer-sequence.o:	cootaneer-sequence.cpp cootaneer-sequence.h $(LCLPR)/*.a
		${CXX} $(CFLAGS) $(CPPFLAGS) -c $<

cootaneer-demo.o:	cootaneer-demo.cpp $(LCLPR)/*.a
		${CXX} $(CFLAGS) $(CPPFLAGS) -c $<

cootaneer-demo:	cootaneer-demo.o buccaneer-lib.o buccaneer-prot.o buccaneer-sequence.o cootaneer-sequence.o
		${LD} $(LDFLAGS) -o $@ $< buccaneer-lib.o buccaneer-prot.o buccaneer-sequence.o cootaneer-sequence.o ${LDLIBS}




clean: 
		rm *.o ${TARGETS}
