1 | # | |
---|
2 | # o---------------------------------------------------------------------o |
---|
3 | # | |
---|
4 | # | PTC makefile - Fortran files selection and dependencies |
---|
5 | # | |
---|
6 | # o---------------------------------------------------------------------o |
---|
7 | # | |
---|
8 | # | Polymorphic Tracking Code from Etienne Forest |
---|
9 | # | |
---|
10 | # | For more information, see http:/cern.ch/mad |
---|
11 | # | |
---|
12 | # o---------------------------------------------------------------------o |
---|
13 | # | |
---|
14 | # | $Id$ |
---|
15 | # | |
---|
16 | |
---|
17 | vpath %.inc src |
---|
18 | vpath %.f90 src |
---|
19 | vpath %.F90 src |
---|
20 | |
---|
21 | FC_DIR := src |
---|
22 | FC_SRC := $(notdir $(wildcard $(FC_DIR)/*.f90 $(FC_DIR)/*.F90)) |
---|
23 | |
---|
24 | # files specific compiler flag |
---|
25 | l_complex_taylor.o: NOPT := 2 |
---|
26 | |
---|
27 | ####################### |
---|
28 | # Fortran dependencies (case not automatic!) |
---|
29 | |
---|
30 | ifeq ($(FDEP),) |
---|
31 | |
---|
32 | # chain of dependencies (PTC from MAD-X) |
---|
33 | a_scratch_size.o: $(FC_DIR)/a_scratch_size.f90 |
---|
34 | b_da_arrays_all.o: $(FC_DIR)/b_da_arrays_all.f90 a_scratch_size.o |
---|
35 | c_dabnew.o: $(FC_DIR)/c_dabnew.f90 b_da_arrays_all.o |
---|
36 | d_lielib.o: $(FC_DIR)/d_lielib.f90 c_dabnew.o |
---|
37 | h_definition.o: $(FC_DIR)/h_definition.f90 d_lielib.o |
---|
38 | i_tpsa.o: $(FC_DIR)/i_tpsa.f90 h_definition.o |
---|
39 | j_tpsalie.o: $(FC_DIR)/j_tpsalie.f90 i_tpsa.o |
---|
40 | k_tpsalie_analysis.o: $(FC_DIR)/k_tpsalie_analysis.f90 j_tpsalie.o |
---|
41 | l_complex_taylor.o: $(FC_DIR)/l_complex_taylor.f90 k_tpsalie_analysis.o |
---|
42 | m_real_polymorph.o: $(FC_DIR)/m_real_polymorph.f90 l_complex_taylor.o |
---|
43 | n_complex_polymorph.o: $(FC_DIR)/n_complex_polymorph.f90 m_real_polymorph.o |
---|
44 | o_tree_element.o: $(FC_DIR)/o_tree_element.f90 n_complex_polymorph.o |
---|
45 | |
---|
46 | Sa_extend_poly.o: $(FC_DIR)/Sa_extend_poly.f90 o_tree_element.o |
---|
47 | Sb_sagan_pol_arbitrary.o: $(FC_DIR)/Sb_sagan_pol_arbitrary.f90 Sa_extend_poly.o |
---|
48 | Sc_euclidean.o: $(FC_DIR)/Sc_euclidean.f90 Sb_sagan_pol_arbitrary.o |
---|
49 | Sd_frame.o: $(FC_DIR)/Sd_frame.f90 Sc_euclidean.o |
---|
50 | Se_status.o: $(FC_DIR)/Se_status.f90 Sd_frame.o |
---|
51 | Sf_def_all_kinds.o: $(FC_DIR)/Sf_def_all_kinds.f90 Se_status.o |
---|
52 | Sg_sagan_wiggler.o: $(FC_DIR)/Sg_sagan_wiggler.f90 Sf_def_all_kinds.o |
---|
53 | Sh_def_kind.o: $(FC_DIR)/Sh_def_kind.f90 Sg_sagan_wiggler.o |
---|
54 | Si_def_element.o: $(FC_DIR)/Si_def_element.f90 Sh_def_kind.o |
---|
55 | Sk_link_list.o: $(FC_DIR)/Sk_link_list.f90 Si_def_element.o |
---|
56 | Sl_family.o: $(FC_DIR)/Sl_family.f90 Sk_link_list.o |
---|
57 | Sm_tracking.o: $(FC_DIR)/Sm_tracking.f90 Sl_family.o |
---|
58 | Sma0_beam_beam_ptc.o: $(FC_DIR)/Sma0_beam_beam_ptc.f90 Sm_tracking.o |
---|
59 | Sma_multiparticle.o: $(FC_DIR)/Sma_multiparticle.f90 Sma0_beam_beam_ptc.o |
---|
60 | Sn_mad_like.o: $(FC_DIR)/Sn_mad_like.f90 Sma_multiparticle.o |
---|
61 | So_fitting.o: $(FC_DIR)/So_fitting.f90 Sn_mad_like.o |
---|
62 | Sp_keywords.o: $(FC_DIR)/Sp_keywords.f90 So_fitting.o |
---|
63 | Spb_fake_gino_sub.o: $(FC_DIR)/Spb_fake_gino_sub.f90 |
---|
64 | Sq_orbit_ptc.o: $(FC_DIR)/Sq_orbit_ptc.f90 Sp_keywords.o |
---|
65 | Sr_spin.o: $(FC_DIR)/Sr_spin.f90 Sq_orbit_ptc.o |
---|
66 | Sra_fitting.o: $(FC_DIR)/Sra_fitting.f90 Sr_spin.o |
---|
67 | St_pointers.o: $(FC_DIR)/St_pointers.f90 Sp_keywords.o Ss_fake_mad.o |
---|
68 | |
---|
69 | h_definition.o: $(FC_DIR)/a_def_frame_patch_chart.inc $(FC_DIR)/a_def_all_kind.inc \ |
---|
70 | $(FC_DIR)/a_def_sagan.inc $(FC_DIR)/a_def_element_fibre_layout.inc |
---|
71 | Sf_def_all_kinds.o: $(FC_DIR)/a_def_worm.inc |
---|
72 | Sp_keywords.o: $(FC_DIR)/a_namelists.inc |
---|
73 | |
---|
74 | # chain of dependencies (PTC lib) |
---|
75 | Ss_fake_mad.o: $(FC_DIR)/Ss_fake_mad.f90 Sra_fitting.o |
---|
76 | ptcinterface.o: $(FC_DIR)/ptcinterface.f90 St_pointers.o |
---|
77 | |
---|
78 | endif |
---|
79 | |
---|
80 | ####################### |
---|
81 | # check for gfortran version >= 4.4 |
---|
82 | # set to gfortran44 on lxplus |
---|
83 | # |
---|
84 | |
---|
85 | ifneq ($(filter $(BUILDGOALS),$(MAKECMDGOALS)),) |
---|
86 | ifeq ($(FC),gfortran) |
---|
87 | ifeq ($(origin FC),file) |
---|
88 | FCVER := $(shell $(FC) -dumpversion) |
---|
89 | FCVERL := $(subst ., ,$(FCVER)) |
---|
90 | FCVER1 := $(findstring $(word 1,$(FCVERL)),"456789") |
---|
91 | FCVER2 := 0 |
---|
92 | ifeq ($(FCVER1),4) |
---|
93 | FCVER2 := $(findstring $(word 2,$(FCVERL)),"456789") |
---|
94 | endif |
---|
95 | ifeq ($(and $(FCVER1),$(FCVER2)),) |
---|
96 | ifeq ($(findstring lxplus,$(HOST)),lxplus) |
---|
97 | $(warning PTC requires gfortran >= 4.4 ($(FCVER) detected), FC set to gfortran44) |
---|
98 | FC := gfortran44 |
---|
99 | FCNAME := gfortran |
---|
100 | else |
---|
101 | $(error PTC requires gfortran >= 4.4 ($(if $(FCVER),$(FCVER),none) detected)) |
---|
102 | endif # lxplus |
---|
103 | endif # version |
---|
104 | endif # origin |
---|
105 | endif # gfortran |
---|
106 | endif # cmdgoal |
---|
107 | |
---|
108 | # end of makefile |
---|