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 | # Sources directories 13 | # ------------------- 14 | # 15 | 16 | CONST = $(DOMHOME)/SOURCES/MAIN 17 | TOOLD = $(DOMHOME)/TOOLS/RAY 18 | MODEL = $(DOMHOME)/SEQCODE/MODEL 19 | FUNC = $(DOMHOME)/SEQCODE/FUNCTIONS 20 | INOUT = $(DOMHOME)/SEQCODE/INOUT 21 | QUADRA = $(DOMHOME)/SEQCODE/QUADRATURE 22 | INCFILE = $(HOST)/dom.inc 23 | PERSO = $(DOMHOME)/TOOLS/INCLUDE/profile.inc 24 | 25 | # 26 | # Quiet mode 27 | # 28 | .SILENT : 29 | 30 | # 31 | # Suffixes 32 | # -------- 33 | 34 | .SUFFIXES:.o .F .HH .h 35 | 36 | # 37 | # Intermediate files to keep 38 | # -------------------------- 39 | 40 | .PRECIOUS : %.o %_m4.f %.mod %.h 41 | 42 | # 43 | # Executable files 44 | # ---------------- 45 | # 46 | 47 | RAYEXEC = $(OUT)/ray_$(DOM_VERSION).e_$(DOM_HOSTTYPE) 48 | 49 | # 50 | # List of object files for RAY 51 | # -------------------------------- 52 | # 53 | 54 | RAY_OBJ = \ 55 | $(TOOLD)/SRC/malkmus_case.o \ 56 | $(TOOLD)/SRC/ray.o \ 57 | $(DOMHOME)/SOURCES/INOUT/readtab.o \ 58 | $(TOOLD)/SRC/tab_case.o 59 | 60 | MODEL_OBJ = \ 61 | $(FUNC)/blae.o \ 62 | $(FUNC)/planck.o \ 63 | $(QUADRA)/gauleg.o \ 64 | $(QUADRA)/cofg.o \ 65 | $(QUADRA)/k_distributeur.o \ 66 | $(QUADRA)/cdss.o \ 67 | $(MODEL)/tmno.o \ 68 | $(MODEL)/findi.o \ 69 | $(MODEL)/kbarandphi.o \ 70 | $(MODEL)/fsk_case.o \ 71 | $(MODEL)/ck_case.o \ 72 | $(INOUT)/param.o 73 | 74 | RAY_CNST_OBJ = \ 75 | $(CONST)/dom_constants.h 76 | 77 | RAY_ALL_OBJ = $(MODEL_OBJ) $(RAY_OBJ) 78 | 79 | # 80 | # RAY compilation 81 | # ------------------- 82 | 83 | all : $(RAYEXEC) 84 | @echo 85 | @echo "****************************************" 86 | @echo 87 | @echo " Executable created :" 88 | @echo $(RAYEXEC) 89 | @echo 90 | @echo "****************************************" 91 | @$(RM) *.o *_m4.f *.mod dom.inc *.h 92 | 93 | 94 | 95 | $(RAYEXEC) : $(RAY_CNST_OBJ) $(RAY_ALL_OBJ) 96 | @echo 97 | @echo "****************************************" 98 | @echo 99 | @echo "Linking Object Files ...." 100 | @echo 101 | @$(FFS) $(LDFLAGS) -o $(RAYEXEC) $(RAY_ALL_OBJ) 102 | @echo "****************************************" 103 | @echo 104 | 105 | # 106 | # dependecies by include 107 | # 108 | 109 | $(RAY_ALL_OBJ) : $(RAY_CNST_OBJ) 110 | 111 | # 112 | # Cleaning RAY 113 | # 114 | 115 | clean: clean_objs 116 | @echo 117 | @echo "****************************************" 118 | @echo 119 | @echo "Removing RAY files" 120 | @echo 121 | @$(RM) $(TOOLD)/SRC/*_m4.f 122 | @$(RM) $(TOOLD)/SRC/*.o 123 | @$(RM) $(CONST)/dom_constants.h 124 | @$(RM) dom.inc *.h *_m4.f *.c *.o 125 | @echo "****************************************" 126 | 127 | clean_objs : 128 | @echo 129 | @echo "****************************************" 130 | @echo 131 | @echo "Removing RAY objects" 132 | @echo 133 | @$(RM) $(RAY_ALL_OBJ:.o=_m4.f) 134 | @$(RM) $(RAY_ALL_OBJ) 135 | @echo "****************************************" 136 | 137 | # 138 | # Suffix Rules: 139 | # 140 | 141 | dom.inc : $(INCFILE) 142 | @echo 143 | @echo "****************************************" 144 | @echo "Linking dom.inc" 145 | @$(RM) dom.inc 146 | @$(LN) $(INCFILE) . 147 | @echo "****************************************" 148 | @echo 149 | 150 | profile.inc : $(PERSO) 151 | @echo "****************************************" 152 | @echo "Linking profile.inc" 153 | @$(RM) perso.inc 154 | @$(LN) $(PERSO) . 155 | @echo "****************************************" 156 | 157 | %_m4.f : %.F dom.inc profile.inc 158 | @echo 159 | @echo "****************************************" 160 | @echo 161 | @echo " Preprocessing " $*.F 162 | @$(M4DIR) $*.F > $*_m4.f 163 | @sed '1d' $*_m4.f > tmp_m4.f 164 | @$(MV) tmp_m4.f $*_m4.f 165 | 166 | %.o : %_m4.f 167 | @echo " Compiling " $*_m4.f 168 | @$(FFS) -c -I$(CONST) $(FFSLAGS) -o $@ $*_m4.f 169 | @$(RM) $*_m4.f 170 | @echo 171 | @echo "****************************************" 172 | 173 | 174 | %.h : %.HH dom.inc 175 | @echo 176 | @echo "****************************************" 177 | @echo 178 | @echo " Preprocessing " $*.HH 179 | @$(M4DIR) $*.HH > $*.h 180 | @$(LN) $*.h . 181 | @echo 182 | @echo "****************************************" 183 | 184 | # Canceling implicit rule %.F => %.o 185 | %.o : %.F 186 |