1 | include $(DOMHOME)/HOSTS/$(DOM_HOSTTYPE)/makefile.h 2 | 3 | # 4 | # PARALLEL OR SEQUENTIAL 5 | # 6 | 7 | #SEQ = no 8 | 9 | ifeq ($(SEQ),yes) 10 | FFOMP = $(FFSLAGS) 11 | else 12 | FFOMP = $(FFSLAGS) -openmp 13 | endif 14 | 15 | # 16 | # Version and outpath 17 | # ------------------- 18 | # 19 | 20 | HOST = $(DOMHOME)/HOSTS/$(DOM_HOSTTYPE) 21 | OUT = $(HOST) 22 | 23 | # 24 | # Sources directories 25 | # ------------------- 26 | # 27 | 28 | CONST = $(DOMHOME)/SOURCES/MAIN 29 | TOOLD = $(DOMHOME)/TOOLS/QUAD_TRACING 30 | INCFILE = $(HOST)/dom.inc 31 | 32 | # 33 | # Quiet mode 34 | # 35 | .SILENT : 36 | 37 | # 38 | # Suffixes 39 | # -------- 40 | 41 | .SUFFIXES:.o .F .HH .h 42 | 43 | # 44 | # Intermediate files to keep 45 | # -------------------------- 46 | 47 | .PRECIOUS : %.o %_m4.F %.mod %.h 48 | 49 | # 50 | # Executable files 51 | # ---------------- 52 | # 53 | 54 | QUAD_TRACINGEXEC = $(OUT)/quad_tracing_$(DOM_VERSION).e_$(DOM_HOSTTYPE) 55 | 56 | # 57 | # List of object files for QUAD_TRACING 58 | # -------------------------------- 59 | # 60 | 61 | QUAD_TRACING_OBJ = \ 62 | $(TOOLD)/SRC/quad_tracing.o \ 63 | 64 | QUAD_TRACING_CNST_OBJ = \ 65 | $(CONST)/dom_constants.h \ 66 | 67 | # 68 | # QUAD_TRACING compilation 69 | # ------------------- 70 | 71 | all : $(QUAD_TRACINGEXEC) 72 | @echo 73 | @echo "****************************************" 74 | @echo 75 | ifeq ($(SEQ),yes) 76 | @echo " Sequential executable created :" 77 | else 78 | @echo " Parallel executable created :" 79 | endif 80 | @echo $(QUAD_TRACINGEXEC) 81 | @echo 82 | @echo "****************************************" 83 | $(RM) *.o *_m4.F *.mod dom.inc *.h 84 | 85 | 86 | $(QUAD_TRACINGEXEC) : $(QUAD_TRACING_CNST_OBJ) $(QUAD_TRACING_OBJ) 87 | @echo 88 | @echo "****************************************" 89 | @echo 90 | @echo "Linking Object Files ...." 91 | @echo 92 | $(FFS) $(FFOMP) -o $@ $(QUAD_TRACING_OBJ) 93 | @echo "****************************************" 94 | @echo 95 | 96 | # 97 | # dependecies by include 98 | # 99 | 100 | $(QUAD_TRACING_OBJ) : $(QUAD_TRACING_CNST_OBJ) 101 | 102 | # 103 | # Cleaning QUAD_TRACING 104 | # 105 | 106 | clean: 107 | @echo 108 | @echo "****************************************" 109 | @echo 110 | @echo "Removing QUAD_TRACING object files" 111 | @echo 112 | $(RM) $(TOOLD)/SRC/*_m4.F 113 | $(RM) $(TOOLD)/SRC/*.o 114 | $(RM) $(CONST)/dom_constants.h 115 | $(RM) dom.inc *.h *_m4.F *.c *.o 116 | @echo "****************************************" 117 | 118 | # 119 | # Suffix Rules: 120 | # 121 | 122 | dom.inc : $(INCFILE) 123 | @echo 124 | @echo "****************************************" 125 | @echo "Linking dom.inc" 126 | $(RM) dom.inc 127 | $(LN) $(INCFILE) . 128 | @echo "****************************************" 129 | @echo 130 | 131 | avbp_coor.mod : $(HOME)/TOOLS/EXTERNAL 132 | @echo 133 | @echo "****************************************" 134 | @echo "Linking avbp_coor.mod" 135 | $(RM) dom.inc 136 | $(LN) $(HOME)/TOOLS/EXTERNAL/avbp_coor.mod . 137 | @echo "****************************************" 138 | @echo 139 | 140 | %_m4.F : %.F dom.inc 141 | @echo 142 | @echo "****************************************" 143 | @echo 144 | @echo " Preprocessing " $*.F 145 | $(M4DIR) $*.F > $*_m4.F 146 | @sed '1d' $*_m4.F > tmp_m4.F 147 | ifeq ($(SEQ),yes) 148 | @sed '2i #define SEQ' $*_m4.F > tmp_m4.F 149 | endif 150 | $(MV) tmp_m4.F $*_m4.F 151 | 152 | %.o : %_m4.F 153 | @echo " Compiling " $*_m4.F 154 | $(FFS) -c -I$(CONST) $(FFOMP) -o $@ $*_m4.F 155 | @echo 156 | @echo "****************************************" 157 | 158 | 159 | %.h : %.HH dom.inc 160 | @echo 161 | @echo "****************************************" 162 | @echo 163 | @echo " Preprocessing " $*.HH 164 | $(M4DIR) $*.HH > $*.h 165 | @echo 166 | @echo "****************************************" 167 | 168 | # Canceling implicit rule %.F => %.o 169 | %.o : %.F 170 |