# ideal/Makefile.simple
# 
# Copyright 2004 The University of York
# Author: Paul Emsley
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# the Free Software Foundation; either version 3 of the License, or (at
# your option) any later version.
# 
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
# 
# You should have received a copy of the GNU General Public License and
# the GNU Lesser General Public License along with this program; if not,
# write to the Free Software Foundation, Inc., 51 Franklin Street,
# 02110-1301, USA

# MMDB    = /y/people/emsley/autobuild/clipper/mmdb102
# CLIPPER = /y/people/emsley/autobuild/clipper

# MMDB    = $(HOME)/crystal/clipper/mmdb102
# CLIPPER = $(HOME)/crystal/clippe


# Cambridge
MMDB    = $(HOME)/build
CLIPPER = $(HOME)/crystal/clipper
MCCP4   = $(HOME)/crystal/clipper/mccp4-0.6.3
FFTW    = $(HOME)/crystal/clipper/fftw
# York
MMDB    = $(HOME)/mapview
#CLIPPER = $(HOME)/crystal/clipper
# CLIPPER = $(HOME)/test/install # broken
#CLIPPER = $(HOME)/mapview
#MCCP4   = $(HOME)/mapview
# Glasgow
#MMDB    = $(HOME)/mapview
#CLIPPER = $(HOME)/mapview
#MCCP4   = $(HOME)/mapview
#FFTW    = $(HOME)/mapview


CXX = g++
MMDB_CXXFLAGS = -I$(MMDB)/include 
FFTW_LIBS = -L$(FFTW)/lib -lrfftw -lfftw

MMDB_LIBS = -L$(MMDB)/lib -lmmdb 
CLIPPER_LIBS = -L$(CLIPPER)/lib -lclipper-contrib \
	-lclipper-mtz -lclipper-phs -lclipper -L$(MCCP4)/lib -lmccp4 \
	-L$(CLIPPER)lib -L/h/paule/mapview/lib $(FFTW_LIBS)

MCCP4_CFLAGS = -I$(MCCP4)/include
CLIPPER_CXXFLAGS = -I$(CLIPPER)/include -I$(MCCP4)/include 

INCLUDES = $(CLIPPER_CXXFLAGS) $(MMDB_CXXFLAGS) \
	-I$(top_srcdir)/coords  \
	-I$(top_srcdir)/geometry

top_srcdir = ..

OPTI = -g
GSL_LIBS = -lgsl -lgslcblas -lm
CXXFLAGS = $(OPTI) $(INCLUDES)
LDLIBS = -L$(top_srcdir)/coords/.libs   -lcoot-coords \
	 -L$(top_srcdir)/geometry/.libs -lcoot-geometry \
	 $(CLIPPER_LIBS) $(MMDB_LIBS) $(GSL_LIBS)

#simple-restraint.o: simple-restraint.o

#u.o: u.cc

#simple-restraint.cc: simple-restraint.h

#u.cc: simple-restraint.h

with-geometry: with-geometry.o simple-restraint.o
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@

u: u.o simple-restraint.o
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@

tags: 
	etags *.cc

test-indexing: test-indexing.o simple-restraint.o
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@

with-map:  with-map.o simple-restraint.o
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@


mtz_to_phs: mtz_to_phs.cc
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -static $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@

molmantest: molmantest.cc
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -static $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@

# g++  -g -fPIC -ftemplate-depth-24 -I/h/paul/crystal/clipper/fftw/include -I/h/paul/crystal/clipper/mmdb/src -I/h/paul/crystal/clipper/mccp4 -I/h/paul/crystal/clipper/lccp4/src -I/h/paul/crystal/clipper/cctbx -I/h/paul/crystal/clipper/boost -I/h/paul/crystal/clipper/include -L/h/paul/crystal/clipper/fftw/lib -L/h/paul/crystal/clipper/mmdb -L/h/paul/crystal/clipper/mccp4 -L/h/paul/crystal/clipper/lccp4 -L/h/paul/crystal/clipper/cctbx/lib -L/h/paul/crystal/clipper/cctbx/lib -L/h/paul/crystal/clipper/lib -o phstest phstest.cpp -lclipper-mtz -lmccp4 -lclipper-minimol -lclipper-mmdb -lclipper-mmdbold -lclipper-phs -lclipper-cif -lclipper-contrib -lclipper -lrfftw -lfftw -lmmdb -lm
