1 | include $(DOMHOME)/HOSTS/$(DOM_HOSTTYPE)/makefile.h 2 | 3 | # 4 | # Version and outpath 5 | # ------------------- 6 | # 7 | 8 | HOST = $(DOMHOME)/HOSTS/$(DOM_HOSTTYPE) 9 | OUT = $(HOST) 10 | 11 | # 12 | # Remove .f files? (yes/no) 13 | # ----------------- 14 | # 15 | 16 | CLEANf = yes 17 | 18 | 19 | # 20 | # Sources directories 21 | # ------------------- 22 | # 23 | 24 | FUNC = $(DOMHOME)/SOURCES/FUNCTIONS 25 | INOUT = $(DOMHOME)/SOURCES/INOUT 26 | MAIN = $(DOMHOME)/SOURCES/MAIN 27 | MASTR = $(DOMHOME)/SOURCES/MAIN/MASTER 28 | MODEL = $(DOMHOME)/SOURCES/MODEL 29 | MODIR = $(DOMHOME)/SOURCES/MODULES 30 | QUAD = $(DOMHOME)/SOURCES/QUADRATURE 31 | SCHM = $(DOMHOME)/SOURCES/SCHEMES 32 | SLAVE = $(DOMHOME)/SOURCES/MAIN/SLAVE 33 | 34 | INCFILE = $(HOST)/dom.inc 35 | 36 | # 37 | # Suffixes 38 | # -------- 39 | 40 | .SUFFIXES: 41 | .SUFFIXES:.o .F .HH .h 42 | 43 | # 44 | # Executable files 45 | # ---------------- 46 | # 47 | 48 | DOMEXEC = $(OUT)/mpiprissma_$(DOM_VERSION).e_$(DOM_HOSTTYPE) 49 | 50 | # 51 | # Modules 52 | # ------- 53 | # 54 | 55 | MODULES = \ 56 | $(MAIN)/mod_pmm \ 57 | $(MAIN)/mod_inout \ 58 | $(SLAVE)/mod_slave \ 59 | $(MASTR)/mod_prissma 60 | 61 | # 62 | # File dependency 63 | # --------------- 64 | # 65 | 66 | D1 = $(MAIN)/mod_pmm 67 | D2 = $(MAIN)/mod_inout 68 | D3 = $(SLAVE)/mod_slave 69 | D4 = $(MASTR)/mod_prissma 70 | 71 | D5 = $(MASTR)/mod_prissma $(MAIN)/mod_inout 72 | D6 = $(MASTR)/mod_prissma $(MAIN)/mod_pmm 73 | D7 = $(SLAVE)/mod_slave $(MAIN)/mod_inout 74 | 75 | D8 = $(MASTR)/mod_prissma $(MAIN)/mod_inout $(MAIN)/mod_pmm 76 | D9 = $(SLAVE)/mod_slave $(MAIN)/mod_inout $(MAIN)/mod_pmm 77 | 78 | # 79 | # Independent files 80 | # ----------------- 81 | # 82 | 83 | FUNC_= \ 84 | $(FUNC)/blae \ 85 | $(FUNC)/planck 86 | 87 | MODEL_= \ 88 | $(MODEL)/kbarandphi \ 89 | $(MODEL)/gray_case \ 90 | $(MODEL)/findi \ 91 | $(MODEL)/tmno 92 | 93 | QUAD_= \ 94 | $(QUAD)/stcd \ 95 | $(QUAD)/gicd \ 96 | $(QUAD)/cdss \ 97 | $(QUAD)/cofg \ 98 | $(QUAD)/gauleg \ 99 | $(QUAD)/k_distributeur 100 | 101 | SCHM_= \ 102 | $(SCHM)/scheme_exp \ 103 | $(SCHM)/exposcheme \ 104 | $(SCHM)/mfscheme \ 105 | $(SCHM)/scheme_dmfs \ 106 | $(SCHM)/band_integ 107 | 108 | # 109 | # Module dependency 110 | # ----------------- 111 | # 112 | 113 | SUB_D0 = $(FUNC_) $(MODEL_) $(QUAD_) $(SCHM_) 114 | 115 | SUB_D1 = \ 116 | $(MAIN)/pmm_begin \ 117 | $(MAIN)/pmm_end \ 118 | $(MAIN)/pmm_returnvectors \ 119 | $(MAIN)/pmm_sendpartition \ 120 | $(MAIN)/pmm_sendvectors \ 121 | $(MODEL)/emissiv \ 122 | $(MODEL)/emissiv_snb \ 123 | $(MAIN)/mpiprissma \ 124 | $(MASTR)/master \ 125 | $(SLAVE)/slave_return 126 | 127 | SUB_D2 = \ 128 | $(MAIN)/pmm_readinput \ 129 | $(INOUT)/readtab 130 | 131 | SUB_D3 = \ 132 | $(INOUT)/param_slave \ 133 | $(SLAVE)/slave_partition 134 | 135 | SUB_D4 = \ 136 | $(MASTR)/master_integrate 137 | 138 | SUB_D5 = \ 139 | $(INOUT)/outprocessing 140 | 141 | SUB_D6 = \ 142 | $(MASTR)/master_control 143 | 144 | SUB_D7 = \ 145 | $(INOUT)/read_data_slave 146 | 147 | SUB_D8 = \ 148 | $(INOUT)/read_data \ 149 | $(MASTR)/partition \ 150 | $(MODEL)/fsck_case \ 151 | $(MODEL)/tab_case \ 152 | $(MODEL)/snb_case \ 153 | $(MODEL)/wsgg_case \ 154 | $(MASTR)/sendtoslaves 155 | 156 | SUB_D9 = \ 157 | $(SLAVE)/slave_receive_vectors \ 158 | $(SLAVE)/slave_receive \ 159 | $(slave.F.html">SLAVE)/slave \ 160 | $(SLAVE)/slave_vectors 161 | 162 | # 163 | # Constants 164 | # --------- 165 | # 166 | 167 | CONSTS = \ 168 | $(MAIN)/dom_constants.h \ 169 | $(MAIN)/pmm_constants.h 170 | 171 | # 172 | # Subroutine compilation order 173 | # ---------------------------- 174 | # 175 | 176 | SUB = \ 177 | $(INOUT)/param_slave \ 178 | $(INOUT)/outprocessing \ 179 | $(INOUT)/read_data \ 180 | $(INOUT)/read_data_slave \ 181 | $(INOUT)/readtab \ 182 | $(FUNC)/blae \ 183 | $(FUNC)/planck \ 184 | $(QUAD)/stcd \ 185 | $(QUAD)/gicd \ 186 | $(QUAD)/cdss \ 187 | $(QUAD)/cofg \ 188 | $(QUAD)/gauleg \ 189 | $(QUAD)/k_distributeur \ 190 | $(MODEL)/kbarandphi \ 191 | $(MODEL)/gray_case \ 192 | $(MODEL)/fsck_case \ 193 | $(MODEL)/tab_case \ 194 | $(MODEL)/snb_case \ 195 | $(MODEL)/wsgg_case \ 196 | $(MODEL)/findi \ 197 | $(MODEL)/tmno \ 198 | $(MODEL)/emissiv \ 199 | $(MODEL)/emissiv_snb \ 200 | $(SCHM)/scheme_exp \ 201 | $(SCHM)/exposcheme \ 202 | $(SCHM)/mfscheme \ 203 | $(SCHM)/scheme_dmfs \ 204 | $(SCHM)/band_integ \ 205 | $(SLAVE)/slave_partition \ 206 | $(SLAVE)/slave_vectors \ 207 | $(SLAVE)/slave_receive_vectors \ 208 | $(SLAVE)/slave_receive \ 209 | $(SLAVE)/slave_return \ 210 | $(slave.F.html">SLAVE)/slave \ 211 | $(MASTR)/partition \ 212 | $(MASTR)/master_integrate \ 213 | $(MASTR)/master_control \ 214 | $(MASTR)/sendtoslaves \ 215 | $(MASTR)/master \ 216 | $(MAIN)/pmm_begin \ 217 | $(MAIN)/pmm_readinput \ 218 | $(MAIN)/pmm_sendpartition \ 219 | $(MAIN)/pmm_sendvectors \ 220 | $(MAIN)/pmm_returnvectors \ 221 | $(MAIN)/pmm_end \ 222 | $(MAIN)/mpiprissma 223 | 224 | # 225 | # All objects 226 | # ----------- 227 | # 228 | 229 | ALL_OBJ = $(MODULES:=.o) $(SUB:=.o) 230 | 231 | # 232 | # Compilation 233 | # ----------- 234 | # 235 | 236 | all : link_dominc link_const allmodules subroutines 237 | @echo 238 | @echo "****************************************" 239 | @echo 240 | @echo "Linking Object Files ...." 241 | @echo 242 | @$(FF) $(LDFLAGS) -o $(DOMEXEC) $(ALL_OBJ) $(PLIBS) 243 | @chmod a+x $(DOMEXEC) 244 | @echo "Removing include files" 245 | @$(RM) dom.inc *.h *_m4.f *.c *.o *.mod 246 | @echo 247 | @echo "Executable created :" 248 | @echo $(DOMEXEC) 249 | @echo 250 | @echo "****************************************" 251 | @echo 252 | 253 | allmodules : $(MODULES:=.o) 254 | 255 | subroutines : $(SUB:=.o) 256 | 257 | $(SUB_D1:=.o) : $(D1:=.mod) 258 | 259 | $(SUB_D2:=.o) : $(D2:=.mod) 260 | 261 | $(SUB_D3:=.o) : $(D3:=.mod) 262 | 263 | $(SUB_D4:=.o) : $(D4:=.mod) 264 | 265 | $(SUB_D5:=.o) : $(D5:=.mod) 266 | 267 | $(SUB_D6:=.o) : $(D6:=.mod) 268 | 269 | $(SUB_D7:=.o) : $(D7:=.mod) 270 | 271 | $(SUB_D8:=.o) : $(D8:=.mod) 272 | 273 | $(SUB_D9:=.o) : $(D9:=.mod) 274 | 275 | link_dominc : 276 | @echo 277 | @echo "****************************************" 278 | @echo "Linking dom.inc" 279 | @$(RM) dom.inc 280 | @$(LN) $(INCFILE) . 281 | @echo "****************************************" 282 | @echo 283 | 284 | link_const : $(CONSTS) 285 | @echo 286 | @echo "****************************************" 287 | @echo "Linking .h files" 288 | @$(RM) *.h 289 | @$(LN) $(CONSTS) . 290 | @echo "****************************************" 291 | @echo 292 | 293 | # 294 | # Cleaning 295 | # -------- 296 | # 297 | 298 | clean : clean_obj clean_modules clean_const 299 | 300 | clean_const : 301 | @echo 302 | @echo "****************************************" 303 | @echo 304 | @echo "Removing *.h files " 305 | @echo 306 | @$(RM) $(CONSTS) 307 | @$(RM) *.h ./dom.inc 308 | @echo 309 | @echo "****************************************" 310 | 311 | clean_modules : 312 | @echo 313 | @echo "****************************************" 314 | @echo 315 | @echo "Removing *.mod files " 316 | @echo 317 | @$(RM) *.mod 318 | @$(RM) $(MODULES:=.mod) 319 | @echo 320 | @echo "****************************************" 321 | 322 | clean_obj : 323 | @echo 324 | @echo "****************************************" 325 | @echo 326 | @echo "Removing *.f files " 327 | @echo 328 | @$(RM) $(ALL_OBJ) 329 | @$(RM) $(ALL_OBJ:%.o=%_m4.f) 330 | @$(RM) *.o 331 | @echo 332 | @echo "****************************************" 333 | 334 | # 335 | # Suffix rules 336 | # ------------ 337 | # 338 | 339 | .F.o : 340 | @echo 341 | @echo "****************************************" 342 | @echo "Preprocessing " $*.F 343 | @$(M4DIR) $*.F > $*_m4.f 344 | @sed '1d' $*_m4.f > tmp_m4.f 345 | @$(MV) tmp_m4.f $*_m4.f 346 | @echo "Compiling " $*_m4.f 347 | @$(FF) -I./ -I$(MASTR) -I$(MAIN) -I$(SLAVE) -c $(FFLAGS) $*_m4.f 348 | @-if [ -f $(notdir $*).mod ] ; then $(CP) $(notdir $*).mod $*.mod ; fi 349 | @$(MV) *.o $*.o 350 | @-if(test $(CLEANf) = yes) then $(RM) $*_m4.f ; fi 351 | @echo "****************************************" 352 | @echo 353 | 354 | .HH.h : 355 | @echo 356 | @echo "****************************************" 357 | @echo "Preprocessing " $*.HH 358 | @$(M4DIR) $*.HH > $*.h 359 | @-touch $*.h 360 | @echo "****************************************" 361 | @echo