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/DOM2ASCII 18 | INCFILE = $(HOST)/dom.inc 19 | 20 | # 21 | # Quiet mode 22 | # 23 | .SILENT : 24 | 25 | # 26 | # Suffixes 27 | # -------- 28 | 29 | .SUFFIXES:.o .F .HH .h 30 | 31 | # 32 | # Intermediate files to keep 33 | # -------------------------- 34 | 35 | .PRECIOUS : %.o %_m4.f %.mod %.h 36 | 37 | # 38 | # Executable files 39 | # ---------------- 40 | # 41 | 42 | DOM2ASCIIEXEC = $(OUT)/dom2ascii_$(DOM_VERSION).e_$(DOM_HOSTTYPE) 43 | 44 | # 45 | # List of object files for DOM2ASCII 46 | # -------------------------------- 47 | # 48 | 49 | DOM2ASCII_OBJ = \ 50 | $(TOOLD)/SRC/dom2ascii.o \ 51 | $(TOOLD)/SRC/interpol.o 52 | 53 | DOM2ASCII_CNST_OBJ = \ 54 | $(CONST)/dom_constants.h 55 | 56 | # 57 | # DOM2ASCII compilation 58 | # ------------------- 59 | 60 | all : $(DOM2ASCIIEXEC) 61 | @echo 62 | @echo "****************************************" 63 | @echo 64 | @echo " Executable created :" 65 | @echo $(DOM2ASCIIEXEC) 66 | @echo 67 | @echo "****************************************" 68 | $(RM) *.o *_m4.f *.mod dom.inc *.h 69 | 70 | 71 | 72 | $(DOM2ASCIIEXEC) : $(DOM2ASCII_CNST_OBJ) $(DOM2ASCII_OBJ) 73 | @echo 74 | @echo "****************************************" 75 | @echo 76 | @echo "Linking Object Files ...." 77 | @echo 78 | $(FFS) $(LDFLAGS) -o $(DOM2ASCIIEXEC) $(DOM2ASCII_OBJ) 79 | @echo "****************************************" 80 | @echo 81 | 82 | # 83 | # dependecies by include 84 | # 85 | 86 | $(DOM2ASCII_OBJ) : $(DOM2ASCII_CNST_OBJ) 87 | 88 | # 89 | # Cleaning DOM2ASCII 90 | # 91 | 92 | clean: 93 | @echo 94 | @echo "****************************************" 95 | @echo 96 | @echo "Removing DOM2ASCII object files" 97 | @echo 98 | $(RM) $(TOOLD)/SRC/*_m4.f 99 | $(RM) $(TOOLD)/SRC/*.o 100 | $(RM) $(CONST)/dom_constants.h 101 | $(RM) dom.inc *.h *_m4.f *.c *.o 102 | @echo "****************************************" 103 | 104 | # 105 | # Suffix Rules: 106 | # 107 | 108 | dom.inc : $(INCFILE) 109 | @echo 110 | @echo "****************************************" 111 | @echo "Linking dom.inc" 112 | $(RM) dom.inc 113 | $(LN) $(INCFILE) . 114 | @echo "****************************************" 115 | @echo 116 | 117 | %_m4.f : %.F dom.inc 118 | @echo 119 | @echo "****************************************" 120 | @echo 121 | @echo " Preprocessing " $*.F 122 | $(M4DIR) $*.F > $*_m4.f 123 | sed '1d' $*_m4.f > tmp_m4.f 124 | $(MV) tmp_m4.f $*_m4.f 125 | 126 | %.o : %_m4.f 127 | @echo " Compiling " $*_m4.f 128 | $(FFS) -c -I$(CONST) $(FFSLAGS) -o $@ $*_m4.f 129 | @echo 130 | @echo "****************************************" 131 | 132 | 133 | %.h : %.HH dom.inc 134 | @echo 135 | @echo "****************************************" 136 | @echo 137 | @echo " Preprocessing " $*.HH 138 | $(M4DIR) $*.HH > $*.h 139 | @echo 140 | @echo "****************************************" 141 | 142 | # Canceling implicit rule %.F => %.o 143 | %.o : %.F 144 |