summaryrefslogtreecommitdiff
blob: 9998b759c664e841bafbab50bf4896370e4a6ae7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
 makefile_refmac.inc1 |  215 ++++++++++++++++++++++++--------------------------
 1 files changed, 104 insertions(+), 111 deletions(-)

diff --git a/makefile_refmac.inc1 b/makefile_refmac.inc1
index 0f8bd63..e59fbfb 100644
--- a/makefile_refmac.inc1
+++ b/makefile_refmac.inc1
@@ -96,9 +96,7 @@ bridge.o                    \
 i0.o                        \
 i1.o                        \
 chbevl.o                    \
-make_unix_ccp4.o            \
-$(LLIBCIF)                  \
-$(LLIBLAPACK)
+make_unix_ccp4.o
 
 
 SUBL =                      \
@@ -133,9 +131,7 @@ cell_symm_subrs.o           \
 iheap_sort.o                \
 linalgebra.o                \
 math_refmac.o               \
-subnumrec.o                 \
-$(LLIBLAPACK)               \
-$(LLIBCCP)
+subnumrec.o
 
 SUB_FREE  =                 \
 freer_twin.o                 \
@@ -145,9 +141,7 @@ subnumrec.o                 \
 libT.o                      \
 iheap_sort.o                \
 cell_symm_subrs.o           \
-math_refmac.o               \
-$(LLIBLAPACK)               \
-$(LLIBCCP)
+math_refmac.o
 
 SUB_HEADER = header2matr.o
 #--------------------------------------------------------------------------------
@@ -185,41 +179,41 @@ rharvest_mod.o:  rharvest_mod.f90
 twin77mod.o:  twin77mod.f
 	$(FC) $(FFLAGS) -c twin77mod.f
 
-gibbs_gm_sampler.o:  linalgebra_f90.f90 gibbs_gm_sampler.f90
-	$(FC) $(FFLAGS) -c linalgebra_f90.f90 gibbs_gm_sampler.f90
+gibbs_gm_sampler.o:  linalgebra_f90.o gibbs_gm_sampler.f90
+	$(FC) $(FFLAGS) -c gibbs_gm_sampler.f90
 
-max_with_twins.o: restr_files.f90 max_with_twins.f weights.f90 agreem.f90
-	$(FC) $(FFLAGS) -c restr_files.f90 weights.f90 agreem.f90 max_with_twins.f
+max_with_twins.o: restr_files.o max_with_twins.f weights.o agreem.o
+	$(FC) $(FFLAGS) -c max_with_twins.f
 
-merohedr_twin.o: restr_files.f90 merohedr_twin.f
-	$(FC) $(FFLAGS) -c restr_files.f90 merohedr_twin.f
+merohedr_twin.o: restr_files.o merohedr_twin.f
+	$(FC) $(FFLAGS) -c merohedr_twin.f
 
-ls_scaling_twin_save.o: restr_files.f90 ls_scaling_twin_save.f weights.f90 agreem.f90
-	$(FC) $(FFLAGS) -c restr_files.f90 weights.f90 agreem.f90 ls_scaling_twin_save.f
+ls_scaling_twin_save.o: restr_files.o ls_scaling_twin_save.f weights.o agreem.o
+	$(FC) $(FFLAGS) -c ls_scaling_twin_save.f
 
-ml_params_refine.o: restr_files.f90 ml_params_refine.f weights.f90 agreem.f90
-	$(FC) $(FFLAGS) -c restr_files.f90 weights.f90 agreem.f90 ml_params_refine.f
+ml_params_refine.o: restr_files.o ml_params_refine.f weights.o agreem.o
+	$(FC) $(FFLAGS) -c ml_params_refine.f
 
-optimise_solvent_all.o: optimise_solvent_all.f90 agreem.f90
-	$(FC) $(FFLAGS) -c optimise_solvent_all.f90 agreem.f90
+optimise_solvent_all.o: optimise_solvent_all.f90 agreem.o
+	$(FC) $(FFLAGS) -c optimise_solvent_all.f90
 
-ncs_rest.o: ncs_rest_mod.f90 restr_files.f90 ncs_ncs_generate.f90 ncs_rest.f weights.f90
-	$(FC) $(FFLAGS) -c ncs_rest_mod.f90 restr_files.f90 ncs_ncs_generate.f90 weights.f90 ncs_rest.f
+ncs_rest.o: ncs_rest_mod.o restr_files.o ncs_ncs_generate.o ncs_rest.f weights.o
+	$(FC) $(FFLAGS) -c ncs_rest.f
 
-ncs_ncs_generate.o: ncs_ncs_generate.f90 align_refmac.f90
-	$(FC) $(FFLAGS) -c ncs_ncs_generate.f90 align_refmac.f90
+ncs_ncs_generate.o: ncs_ncs_generate.f90 align_refmac.o
+	$(FC) $(FFLAGS) -c ncs_ncs_generate.f90
 
-lsq_exp2.o: ncs_rest_mod.f90 restr_files.f90 dist_routines.f90 ncs_simil.f90 ridge.f90 local_tls.f90 lsq_exp2.f weights.f90 rharvest_mod.f90
-	$(FC) $(FFLAGS) -c ncs_rest_mod.f90 restr_files.f90 dist_routines.f90 ncs_simil.f90 ridge.f90 local_tls.f90  lsq_exp2.f weights.f90 rharvest_mod.f90
+lsq_exp2.o: ncs_rest_mod.o restr_files.o dist_routines.o ncs_simil.o ridge.o local_tls.o lsq_exp2.f weights.o rharvest_mod.o
+	$(FC) $(FFLAGS) -c lsq_exp2.f
 
-vdw_and_contacts.o: ncs_rest_mod.f90 vdw_and_contacts.f local_tls.f90 ridge.f90 restr_files.f90 weights.f90 agreem.f90
-	$(FC) $(FFLAGS) -c ncs_rest_mod.f90 restr_files.f90 ridge.f90 local_tls.f90 weights.f90 agreem.f90 vdw_and_contacts.f
+vdw_and_contacts.o: ncs_rest_mod.o vdw_and_contacts.f local_tls.o ridge.o restr_files.o weights.o agreem.o
+	$(FC) $(FFLAGS) -c vdw_and_contacts.f
 
 dist_routines.o: dist_routines.f90
 	$(FC) $(FFLAGS) -c dist_routines.f90
 
-ncs_simil.o: ncs_rest_mod.f90 ncs_simil.f90
-	$(FC) $(FFLAGS) -c ncs_rest_mod.f90 ncs_simil.f90
+ncs_simil.o: ncs_rest_mod.o ncs_simil.f90
+	$(FC) $(FFLAGS) -c ncs_simil.f90
 
 ridge.o: ridge.f90
 	$(FC) $(FFLAGS) -c ridge.f90
@@ -227,140 +221,138 @@ ridge.o: ridge.f90
 align_refmac.o: align_refmac.f90
 	$(FC) $(FFLAGS) -c align_refmac.f90
 
-rigid_allocate.o: restr_files.f90 rigid_allocate.f agreem.f90
-	$(FC) $(FFLAGS) -c restr_files.f90 agreem.f90 rigid_allocate.f
+rigid_allocate.o: restr_files.o rigid_allocate.f agreem.o
+	$(FC) $(FFLAGS) -c rigid_allocate.f
 
-tls_allocate.o: restr_files.f90 tls_allocate.f weights.f90 agreem.f90
-	$(FC) $(FFLAGS) -c restr_files.f90 weights.f90 agreem.f90 tls_allocate.f
+tls_allocate.o: restr_files.o tls_allocate.f weights.o agreem.o
+	$(FC) $(FFLAGS) -c tls_allocate.f
 
-hkon_secder_tch.o: ridge.f90 gibbs_gm_sampler.f90 ncs_rest_mod.f90 hkon_secder_tch.f local_tls.f90 ncs_simil.f90 optimise_solvent_all.f90 \
-                   restr_files.f90 weights.f90 agreem.f90 rharvest_mod.f90
-	$(FC) $(FFLAGS) -c ridge.f90 gibbs_gm_sampler.f90 ncs_rest_mod.f90 restr_files.f90 optimise_solvent_all.f90 ncs_simil.f90 local_tls.f90 \
-	                   hkon_secder_tch.f weights.f90 agreem.f90 rharvest_mod.f90
+hkon_secder_tch.o: ridge.o gibbs_gm_sampler.o ncs_rest_mod.o hkon_secder_tch.f local_tls.o ncs_simil.o optimise_solvent_all.o \
+                   restr_files.o weights.o agreem.o rharvest_mod.o
+	$(FC) $(FFLAGS) -c hkon_secder_tch.f
 
-oppro_allocate.o: ncs_rest_mod.f90 oppro_allocate.f filter_params.f90 optimise_solvent_all.f90 restr_files.f90 weights.f90
-	$(FC) $(FFLAGS) -c ncs_rest_mod.f90 restr_files.f90 optimise_solvent_all.f90 filter_params.f90 weights.f90 oppro_allocate.f
+oppro_allocate.o: ncs_rest_mod.o oppro_allocate.f filter_params.o optimise_solvent_all.o restr_files.o weights.o
+	$(FC) $(FFLAGS) -c oppro_allocate.f
 
-read_extra_restraints.o: restr_files.f90 read_extra_restraints.f weights.f90
-	$(FC) $(FFLAGS) -c restr_files.f90 weights.f90 read_extra_restraints.f
+read_extra_restraints.o: restr_files.o read_extra_restraints.f weights.o
+	$(FC) $(FFLAGS) -c read_extra_restraints.f
 
-coords.o: coords.f90 atomf77mod.f
-	$(FC) $(FFLAGS) -c atomf77mod.f coords.f90
+coords.o: coords.f90 atomf77mod.o
+	$(FC) $(FFLAGS) -c coords.f90
 
 
-ls_scaling_double.o: ls_scaling_double.f weights.f90 agreem.f90
-	$(FC) $(FFLAGS) -c ls_scaling_double.f weights.f90 agreem.f90
+ls_scaling_double.o: ls_scaling_double.f weights.o agreem.o
+	$(FC) $(FFLAGS) -c ls_scaling_double.f
 
-fast_hessian_tabulation.o: fast_hessian_tabulation.f weights.f90 
-	$(FC) $(FFLAGS) -c fast_hessian_tabulation.f weights.f90
+fast_hessian_tabulation.o: fast_hessian_tabulation.f weights.o
+	$(FC) $(FFLAGS) -c fast_hessian_tabulation.f
 
-calc_stats_twin.o: calc_stats_twin.f weights.f90 agreem.f90 rharvest_mod.f90
-	$(FC) $(FFLAGS) -c calc_stats_twin.f weights.f90 agreem.f90 rharvest_mod.f90
+calc_stats_twin.o: calc_stats_twin.f weights.o agreem.o rharvest_mod.o
+	$(FC) $(FFLAGS) -c calc_stats_twin.f
 
-refpre_twin.o: refpre_twin.f coords.f90 automorphism.f90 restr_files.f90 weights.f90 agreem.f90 rharvest_mod.f90
-	$(FC) $(FFLAGS) -c restr_files.f90 coords.f90 automorphism.f90 weights.f90 agreem.f90 rharvest_mod.f90 refpre_twin.f
+refpre_twin.o: refpre_twin.f coords.o automorphism.o restr_files.o weights.o agreem.o rharvest_mod.o
+	$(FC) $(FFLAGS) -c refpre_twin.f
 
 
-decide_twin_opers_0.o: restr_files.f90 decide_twin_opers_0.f
-	$(FC) $(FFLAGS) -c restr_files.f90 decide_twin_opers_0.f
+decide_twin_opers_0.o: restr_files.o decide_twin_opers_0.f
+	$(FC) $(FFLAGS) -c decide_twin_opers_0.f
 
 automorphism.o: automorphism.f90
 	$(FC) $(FFLAGS) -c automorphism.f90
 
-mtz_write_twin.o: mtz_write_twin.f filter_params.f90 restr_files.f90 weights.f90 agreem.f90
-	$(FC) $(FFLAGS) -c restr_files.f90 filter_params.f90 weights.f90 agreem.f90 mtz_write_twin.f
+mtz_write_twin.o: mtz_write_twin.f filter_params.o restr_files.o weights.o agreem.o
+	$(FC) $(FFLAGS) -c mtz_write_twin.f
 
 filter_params.o: filter_params.f90
 	$(FC) $(FFLAGS) -c filter_params.f90
 
-rcard_tor1.o: ncs_rest_mod.f90 rcard_tor1.f filter_params.f90 local_tls.f90 ridge.f90 optimise_solvent_all.f90 restr_files.f90 weights.f90 \
-              agreem.f90 rharvest_mod.f90 ncs_constr.f90
-	$(FC) $(FFLAGS) -c ncs_rest_mod.f90 restr_files.f90 optimise_solvent_all.f90 filter_params.f90 local_tls.f90 ridge.f90 weights.f90 \
-	                   agreem.f90 rharvest_mod.f90 ncs_constr.f90 rcard_tor1.f
+rcard_tor1.o: ncs_rest_mod.o rcard_tor1.f filter_params.o local_tls.o ridge.o optimise_solvent_all.o restr_files.o weights.o \
+              agreem.o rharvest_mod.o ncs_constr.o
+	$(FC) $(FFLAGS) -c rcard_tor1.f
 
-inout_routines.o: restr_files.f90 inout_routines.f
-	$(FC) $(FFLAGS) -c restr_files.f90 inout_routines.f
+inout_routines.o: restr_files.o inout_routines.f
+	$(FC) $(FFLAGS) -c inout_routines.f
 
-local_tls.o: local_tls.f90 linalgebra_f90.f90
-	$(FC) $(FFLAGS) -c linalgebra_f90.f90 local_tls.f90
+local_tls.o: local_tls.f90 linalgebra_f90.o
+	$(FC) $(FFLAGS) -c local_tls.f90
 
 linalgebra_f90.o: linalgebra_f90.f90 
 	$(FC) $(FFLAGS) -c linalgebra_f90.f90
 
-make_refmac_dummy.o: restr_files.f90 ncs_rest_mod.f90 make_refmac_dummy.f optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90
-	$(FC) $(FFLAGS) -c restr_files.f90 ncs_rest_mod.f90 weights.f90 agreem.f90 rharvest_mod.f90 optimise_solvent_all.f90 make_refmac_dummy.f
+make_refmac_dummy.o: restr_files.o ncs_rest_mod.o make_refmac_dummy.f optimise_solvent_all.o weights.o agreem.o rharvest_mod.o
+	$(FC) $(FFLAGS) -c make_refmac_dummy.f
 
-ml_scaling_double.o: ml_scaling_double.f optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90
-	$(FC) $(FFLAGS) -c optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90 ml_scaling_double.f
+ml_scaling_double.o: ml_scaling_double.f optimise_solvent_all.o weights.o agreem.o rharvest_mod.o
+	$(FC) $(FFLAGS) -c ml_scaling_double.f
 
-refall_twin.o: refall_twin.f optimise_solvent_all.f90 restr_files.f90 weights.f90 agreem.f90 rharvest_mod.f90
-	$(FC) $(FFLAGS) -c restr_files.f90 optimise_solvent_all.f90  weights.f90 agreem.f90 rharvest_mod.f90 refall_twin.f
+refall_twin.o: refall_twin.f optimise_solvent_all.o restr_files.f90 weights.o agreem.o rharvest_mod.o
+	$(FC) $(FFLAGS) -c refall_twin.f
 
-rharvest_subr.o: ncs_rest_mod.f90 rharvest_subr.f optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90
-	$(FC) $(FFLAGS) -c ncs_rest_mod.f90 optimise_solvent_all.f90  weights.f90 agreem.f90 rharvest_mod.f90 rharvest_subr.f
+rharvest_subr.o: ncs_rest_mod.o rharvest_subr.f optimise_solvent_all.o weights.o agreem.o rharvest_mod.o
+	$(FC) $(FFLAGS) -c rharvest_subr.f
 
-solvent_contr_mask.o: solvent_contr_mask.f optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90 ncs_constr.f90
-	$(FC) $(FFLAGS) -c optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90 ncs_constr.f90 solvent_contr_mask.f
+solvent_contr_mask.o: solvent_contr_mask.f optimise_solvent_all.o weights.o agreem.o rharvest_mod.o ncs_constr.o
+	$(FC) $(FFLAGS) -c solvent_contr_mask.f
 
-subag_scale_hessian.o: subag_scale_hessian.f optimise_solvent_all.f90 restr_files.f90 weights.f90 agreem.f90 rharvest_mod.f90 ncs_constr.f90
-	$(FC) $(FFLAGS) -c restr_files.f90 optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90 ncs_constr.f90 subag_scale_hessian.f
+subag_scale_hessian.o: subag_scale_hessian.f optimise_solvent_all.o restr_files.o weights.o agreem.o rharvest_mod.o ncs_constr.o
+	$(FC) $(FFLAGS) -c subag_scale_hessian.f
 
-aniso_ref_eigen.o: aniso_ref_eigen.f ncs_constr.f90
-	$(FC) $(FFLAGS) -c ncs_constr.f90 aniso_ref_eigen.f
+aniso_ref_eigen.o: aniso_ref_eigen.f ncs_constr.o
+	$(FC) $(FFLAGS) -c aniso_ref_eigen.f
 
-subcf_scale1.o: subcf_scale1.f optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90
-	$(FC) $(FFLAGS) -c optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90 subcf_scale1.f
+subcf_scale1.o: subcf_scale1.f optimise_solvent_all.o weights.o agreem.o rharvest_mod.o
+	$(FC) $(FFLAGS) -c subcf_scale1.f
 
-bvalue_routines.o: bvalue_routines.f90 restr_files.f90 atomf77mod.f
-	$(FC) $(FFLAGS) -c restr_files.f90 atomf77mod.f bvalue_routines.f90
+bvalue_routines.o: bvalue_routines.f90 restr_files.o atomf77mod.o
+	$(FC) $(FFLAGS) -c bvalue_routines.f90
 
-newentry_idealise.o:: newentry_idealise.f weights.f90
-	$(FC) $(FFLAGS) -c newentry_idealise.f weights.f90
+newentry_idealise.o:: newentry_idealise.f weights.o
+	$(FC) $(FFLAGS) -c newentry_idealise.f
 
-occupancy_only_refine.o: occupancy_only_refine.f agreem.f90 rharvest_mod.f90
-	$(FC) $(FFLAGS) -c occupancy_only_refine.f agreem.f90 rharvest_mod.f90
+occupancy_only_refine.o: occupancy_only_refine.f agreem.o rharvest_mod.o
+	$(FC) $(FFLAGS) -c occupancy_only_refine.f
 
-refmac_completeness.o: weights.f90 agreem.f90 rharvest_mod.f90  refmac_completeness.f90
-	$(FC) $(FFLAGS) -c weights.f90 agreem.f90 rharvest_mod.f90 refmac_completeness.f90
+refmac_completeness.o: weights.o agreem.o rharvest_mod.o refmac_completeness.f90
+	$(FC) $(FFLAGS) -c refmac_completeness.f90
 
-refmac_xml.o: refmac_xml.f optimise_solvent_all.f90 restr_files.f90 bvalue_routines.f90 weights.f90 agreem.f90 rharvest_mod.f90
-	$(FC) $(FFLAGS) -c bvalue_routines.f90 restr_files.f90 optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90 refmac_xml.f
+refmac_xml.o: refmac_xml.f optimise_solvent_all.o restr_files.o bvalue_routines.o weights.o agreem.o rharvest_mod.o
+	$(FC) $(FFLAGS) -c refmac_xml.f
 
 hkl_pack.o:  hkl_pack.f90
 	$(FC) $(FFLAGS) -c hkl_pack.f90
 
-extra_eigen.o: extra_eigen.f agreem.f90 ncs_constr.f90
-	$(FC) $(FFLAGS) -c extra_eigen.f agreem.f90 ncs_constr.f90
+extra_eigen.o: extra_eigen.f agreem.o ncs_constr.o
+	$(FC) $(FFLAGS) -c extra_eigen.f
 
-subvag.o: subvag.f hkl_pack.f90
-	$(FC) $(FFLAGS) -c hkl_pack.f90 subvag.f
+subvag.o: subvag.f hkl_pack.o
+	$(FC) $(FFLAGS) -c subvag.f
 
-make_PDB.o: make_PDB.f ncs_constr.f90
-	$(FC) $(FFLAGS) -c ncs_constr.f90 make_PDB.f
+make_PDB.o: make_PDB.f ncs_constr.o
+	$(FC) $(FFLAGS) -c make_PDB.f
 
-make_CIF.o: make_CIF.f ncs_constr.f90
-	$(FC) $(FFLAGS) -c ncs_constr.f90 make_CIF.f
+make_CIF.o: make_CIF.f ncs_constr.o
+	$(FC) $(FFLAGS) -c make_CIF.f
 
 refmac:	$(SUBR)
-	$(FC) $(FFLAGS) -o refmac${VERSION}   ${SUBR} $(LLIBOTHERS) $(LLIBCCP)
+	$(FC) $(FFLAGS) $(LDFLAGS) -o refmac${VERSION}   ${SUBR} $(LLIBOTHERS) $(LLIBCCP) $(LLIBCIF) $(LLIBLAPACK)
 
-mol2_file.o:	mol2_file.f odb_files.f90
-	$(FC) $(FFLAGS) -c odb_files.f90 mol2_file.f
+mol2_file.o:	mol2_file.f odb_files.o
+	$(FC) $(FFLAGS) -c mol2_file.f
 
-odb_files.o:	odb_files.f90 elements_module.f90 enerf77mod.f
-	$(FC) $(FFLAGS) -c elements_module.f90 enerf77mod.f odb_files.f90
+odb_files.o:	odb_files.f90 elements_module.o enerf77mod.o
+	$(FC) $(FFLAGS) -c odb_files.f90
 
 elements_module.o:	elements_module.f90
 	$(FC) $(FFLAGS) -c elements_module.f90
 
-make_lib2.o:	make_lib2.f odb_files.f90 
-	$(FC) $(FFLAGS) -c odb_files.f90 make_lib2.f
+make_lib2.o:	make_lib2.f odb_files.o
+	$(FC) $(FFLAGS) -c make_lib2.f
 
 pdb2libcheck.o:	pdb2libcheck.f90
 	$(FC) $(FFLAGS) -c pdb2libcheck.f90
 
-libcheck.o:	libcheck.f elements_module.f90 pdb2libcheck.f90
-	$(FC) $(FFLAGS) -c elements_module.f90 pdb2libcheck.f90 libcheck.f
+libcheck.o:	libcheck.f elements_module.o pdb2libcheck.o
+	$(FC) $(FFLAGS) -c libcheck.f
 
 header2matr.o:	header2matr.f90
 	$(FC) $(FFLAGS) -c header2matr.f90
@@ -369,16 +361,17 @@ freer_twin.o:	freer_twin.f90
 	$(FC) $(FFLAGS) -c  freer_twin.f90
 
 libcheck:	$(SUBL)
-	$(FC) $(FFLAGS) -o libcheck${VERSION} $(SUBL)
+	$(FC) $(FFLAGS) $(LDFLAGS) -o libcheck${VERSION} $(SUBL) $(LLIBCCP) $(LLIBCIF) $(LLIBLAPACK)
 
 free_twin:	$(SUB_FREE)
-	$(FC) $(FFLAGS) -o FreeTwin${VERSION} $(SUB_FREE)
+	$(FC) $(FFLAGS) $(LDFLAGS) -o FreeTwin${VERSION} $(SUB_FREE) $(LLIBCCP) $(LLIBLAPACK)
 
 
 header2matr:	$(SUB_HEADER)
-	$(FC) $(FFLAGS) -o header2matr${VERSION} $(SUB_HEADER)
+	$(FC) $(FFLAGS) $(LDFLAGS) -o header2matr${VERSION} $(SUB_HEADER)
 
 clean:
 	/bin/rm *.o *.mod
 
 bridge.o:			bridge.cpp llhood.h covmat.h Gauss.h tabfunc.h
+	$(CXX) $(CXXFLAGS) -c bridge.cpp