
VERSION = gfortran 
FC      = /usr/local/bin/gfortran 
CC      = gcc-4
CXX     = g++-4
FOPTIM  = -O2 
COPTIM  = -O2 
XFFLAGS = -fno-second-underscore 

XCFLAGS = -DGFORTRAN -DPROTOTYPE 
FFLAGS = $(FOPTIM) $(XFFLAGS) -static-libgcc -static-libgfortran
CFLAGS = $(COPTIM) $(XCFLAGS) 
CPPFLAGS = $(CFLAGS)

LLIBCIF = 
LLIBCCP = $(CLIB)/libccp4f.a $(CLIB)/libccp4c.a $(CLIB)/liblapack.a $(CLIB)/libblas.a
LLIBLAPACK = 
#LLIBOTHERS = -lstdc++ /usr/local/lib/libgfortran.a /usr/local/lib/gcc/i686-apple-darwin8/4.3.1/libgfortranbegin.a /usr/local/lib/gcc/i686-apple-darwin8/4.3.1/libgcc.a
#LLIBOTHERS = -lstdc++ /sw/lib/gcc4.3/lib/libgfortran.a /sw/lib/gcc4.3/lib/gcc/i686-apple-darwin9/4.3.1/libgfortranbegin.a /sw/lib/gcc4.3/lib/gcc/i686-apple-darwin9/4.3.1/libgcc.a -lSystemStubs
LLIBOTHERS = /sw/lib/gcc4.3/lib/libstdc++.a /sw/lib/gcc4.3/lib/libgfortran.a /sw/lib/gcc4.3/lib/gcc/i686-apple-darwin9/4.3.1/libgfortranbegin.a /sw/lib/gcc4.3/lib/gcc/i686-apple-darwin9/4.3.1/libgcc.a -lSystemStubs

# 
SUBR =                      \
refmac_xml.o                \
solvent_contr_mask.o          \
hkon_secder_tch.o           \
fast_hessian_tabulation.o   \
subvag.o                    \
lsq_symm_symm.o            \
oppro_allocate.o                \
rcard_tor1.o                \
subcf_scale1.o              \
subag_scale_hessian.o       \
extra_eigen.o               \
rigid_allocate.o            \
aniso_ref_eigen.o           \
linalgebra.o                \
make_CIF.o                  \
make_subr.o                 \
make_subr_refmac.o          \
tls_allocate.o              \
vdw_and_contacts.o          \
vdw_flexible.o              \
make_lib11.o                \
make_lib12.o                \
make_lib2.o                 \
make_crd1.o                 \
make_crd2.o                 \
make_new1.o                 \
make_new2.o                 \
set_num.o                   \
make_rst1.o                 \
make_rst2.o                 \
make_PDB.o                  \
makecif.o                   \
make_refmac_dummy.o         \
ls_scaling_double.o         \
interpolate_mod.o           \
rharvest.o                  \
newentry_idealise.o         \
ml_scaling_double.o         \
gaussian_int.o              \
subnumrec.o                 \
math_refmac.o               \
read_extra_restraints.o     \
inout_routines.o            \
errwrt.o                    \
xml_writer.o                \
ncs_rest.o                  \
occupancy_only_refine.o     \
cell_symm_subrs.o           \
iheap_sort.o                \
enm_restraints.o            \
wave2f2prime.o              \
lnumrec.o                   \
refpre_twin.o               \
refall_twin.o               \
ls_scaling_twin_save.o      \
max_with_ints.o             \
ml_params_refine.o          \
block_organization.o        \
merohedr_twin.o             \
decide_twin_opers_0.o       \
read_data.o                 \
asym_list.o                 \
calc_stats_twin.o           \
mtz_write_twin.o            \
libT.o                      \
messy_pdb.o                 \
bridge.o                    \
i0.o                        \
i1.o                        \
chbevl.o                    \
$(LLIBCIF)                  \
$(LLIBLAPACK)
#$(LLIBCCP)                  \
#crt0.o                      \
#heavy.o                     \

refmac:	$(SUBR)
	$(FC) $(FFLAGS) -o refmac${VERSION}   ${SUBR} $(LLIBOTHERS) $(LLIBCCP)
