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 | INC = $(HOST) 11 | 12 | # 13 | # Sources directories 14 | # ------------------- 15 | # 16 | 17 | SEQDIR = $(DOMHOME)/SEQCODE 18 | 19 | FUNC = $(SEQDIR)/FUNCTIONS 20 | INOUT = $(SEQDIR)/INOUT 21 | MAIN = $(SEQDIR)/MAIN 22 | MODEL = $(SEQDIR)/MODEL 23 | QUAD = $(SEQDIR)/QUADRATURE 24 | SCHEM = $(SEQDIR)/SCHEMES 25 | 26 | MODIR = $(SEQDIR)/MODULES 27 | 28 | # 29 | # Quiet mode 30 | # 31 | .SILENT : 32 | 33 | # 34 | # Suffixes 35 | # -------- 36 | 37 | .SUFFIXES:.o .F .HH .h 38 | 39 | # 40 | # Intermediate files to keep 41 | # -------------------------- 42 | 43 | .PRECIOUS : %.o %_m4.f %.mod %.h 44 | 45 | # 46 | # Executable file 47 | # --------------- 48 | # 49 | 50 | DOMEXEC = $(OUT)/prissma_$(DOM_VERSION).e_$(DOM_HOSTTYPE) 51 | 52 | # 53 | # List of object files 54 | # -------------------- 55 | # 56 | 57 | FUNC_OBJ = \ 58 | $(FUNC)/blae.o \ 59 | $(FUNC)/planck.o 60 | 61 | INOUT_OBJ = \ 62 | $(INOUT)/outprocessing.o \ 63 | $(INOUT)/param.o \ 64 | $(INOUT)/read_data.o \ 65 | $(INOUT)/readtab.o 66 | 67 | MAIN_OBJ = \ 68 | $(MAIN)/prissma.o 69 | 70 | MODEL_OBJ = \ 71 | $(MODEL)/findi.o \ 72 | $(MODEL)/emissiv.o \ 73 | $(MODEL)/emissiv_snb.o \ 74 | $(MODEL)/grey_case.o \ 75 | $(MODEL)/kbarandphi.o \ 76 | $(MODEL)/tmno.o \ 77 | $(MODEL)/wsgg_case.o \ 78 | $(MODEL)/snb_case.o \ 79 | $(MODEL)/fsck_case.o \ 80 | $(MODEL)/tab_case.o 81 | 82 | QUAD_OBJ = \ 83 | $(QUAD)/cdss.o \ 84 | $(QUAD)/cofg.o \ 85 | $(QUAD)/gauleg.o \ 86 | $(QUAD)/k_distributeur.o 87 | 88 | SCHEM_OBJ = \ 89 | $(SCHEM)/band_integ.o \ 90 | $(SCHEM)/exposcheme.o \ 91 | $(SCHEM)/mfscheme.o \ 92 | $(SCHEM)/scheme_dmfs.o \ 93 | $(SCHEM)/scheme_exp.o 94 | 95 | CONST = \ 96 | $(MAIN)/dom_constants.h 97 | 98 | ALL_OBJS = $(MODEL_OBJ) $(QUAD_OBJ) $(SCHEM_OBJ) $(INOUT_OBJ) $(MAIN_OBJ) $(FUNC_OBJ) 99 | 100 | # 101 | # Main compilation 102 | # ---------------- 103 | # 104 | 105 | all : $(DOMEXEC) 106 | @echo 107 | @echo "****************************************" 108 | @echo 109 | @echo " Executable created :" 110 | @echo $(DOMEXEC) 111 | @echo 112 | @echo "****************************************" 113 | @$(RM) *.o *_m4.f *.mod dom.inc *.h 114 | 115 | $(DOMEXEC) : $(CONST) $(ALL_OBJS) 116 | @echo 117 | @echo "****************************************" 118 | @echo 119 | @echo " Linking Object Files ...." 120 | @$(FFS) $(LDFLAGS) -o $(DOMEXEC) $(ALL_OBJS) 121 | @echo 122 | @echo "****************************************" 123 | 124 | # 125 | # dependecies by include 126 | # 127 | 128 | $(SCHEM_OBJ) : $(CONST) 129 | 130 | $(MODEL_OBJ) : $(CONST) 131 | 132 | $(FUNC_OBJ) : $(CONST) 133 | 134 | $(INOUT_OBJ) : $(CONST) 135 | 136 | $(MAIN_OBJ) : $(CONST) 137 | 138 | # 139 | # Cleaning 140 | # 141 | 142 | clean : clean_SUBROUTINES clean_MODULES clean_CONST 143 | 144 | clean_SUBROUTINES : 145 | @echo 146 | @echo "****************************************" 147 | @echo 148 | @echo " Removing SUBROUTINES object files" 149 | @$(RM) $(ALL_OBJS) 150 | @echo " Removing intermediary _m4.f files" 151 | @$(RM) $(ALL_OBJS:.o=_m4.f) 152 | @$(RM) dom.inc *.h *_m4.f *.c *.o *.mod 153 | @echo 154 | @echo "****************************************" 155 | 156 | clean_MODULES : 157 | @echo 158 | @echo "****************************************" 159 | @echo 160 | @echo " Removing MODULES " 161 | @$(RM) $(MODIR)/*.mod ./*.mod 162 | @echo 163 | @echo "****************************************" 164 | 165 | clean_CONST : 166 | @echo 167 | @echo "****************************************" 168 | @echo 169 | @echo " Removing *.h files " 170 | @$(RM) $(MAIN)/*.h 171 | @echo 172 | @echo "****************************************" 173 | 174 | # 175 | # Suffix Rules: 176 | # 177 | 178 | dom.inc : $(INC)/dom.inc 179 | @echo 180 | @echo "****************************************" 181 | @echo 182 | @echo " Installing dom.inc" 183 | @$(LN) $(INC)/dom.inc . 184 | @echo 185 | @echo "****************************************" 186 | 187 | 188 | %_m4.f : %.F dom.inc 189 | @echo 190 | @echo "****************************************" 191 | @echo 192 | @echo " Preprocessing " $*.F 193 | @$(M4DIR) $*.F > $*_m4.f 194 | @sed '1d' $*_m4.f > tmp_m4.f 195 | @$(MV) tmp_m4.f $*_m4.f 196 | 197 | %.o : %_m4.f 198 | @echo " Compiling " $*_m4.f 199 | $(FFS) -c -I$(MODIR) -I$(MAIN) $(FFSLAGS) -o $@ $*_m4.f 200 | @echo 201 | @echo "****************************************" 202 | 203 | 204 | %.h : %.HH dom.inc 205 | @echo 206 | @echo "****************************************" 207 | @echo " Preprocessing " $*.HH 208 | @$(M4DIR) $*.HH > $*.h 209 | @$(LN) $*.h . 210 | @echo 211 | @echo "****************************************" 212 | 213 | # Canceling implicit rule %.F => %.o 214 | %.o : %.F