1 | # To build this by itself, use the make target esmf_time_f90_only |
---|
2 | # from the top-level WRF Makefile. |
---|
3 | # > cd ../.. |
---|
4 | # configure |
---|
5 | # make esmf_time_f90_only |
---|
6 | |
---|
7 | .SUFFIXES: .F90 .o .f |
---|
8 | |
---|
9 | # get rid of single quotes after comments |
---|
10 | # WARNING: This will break if a quoted string is followed by a comment that has |
---|
11 | # a single quote. |
---|
12 | SED_FTN = sed -e "/\!.*'/s/'//g" |
---|
13 | |
---|
14 | RM = /bin/rm -f |
---|
15 | AR = ar |
---|
16 | #RANLIB = ranlib |
---|
17 | RANLIB = echo |
---|
18 | FGREP = fgrep -iq |
---|
19 | |
---|
20 | OBJS = ESMF_Alarm.o ESMF_BaseTime.o ESMF_Clock.o ESMF_Time.o \ |
---|
21 | Meat.o ESMF_Base.o ESMF_Calendar.o ESMF_Fraction.o \ |
---|
22 | ESMF_TimeInterval.o ESMF_Stubs.o ESMF_Mod.o \ |
---|
23 | module_symbols_util.o \ |
---|
24 | module_utility.o ESMF_AlarmClock.o |
---|
25 | |
---|
26 | default: libesmf_time.a |
---|
27 | |
---|
28 | tests: Test1_ESMF.exe Test1_WRFU.exe |
---|
29 | |
---|
30 | libesmf_time.a : $(OBJS) |
---|
31 | $(RM) libesmf_time.a |
---|
32 | if [ "$(AR)" != "lib.exe" ] ; then \ |
---|
33 | $(AR) ru libesmf_time.a $(OBJS) ; \ |
---|
34 | else \ |
---|
35 | $(AR) /out:libesmf_time.a $(OBJS) ; \ |
---|
36 | fi |
---|
37 | $(RANLIB) libesmf_time.a |
---|
38 | |
---|
39 | Test1_ESMF.f : Test1.F90 |
---|
40 | $(RM) Test1_ESMF.b Test1_ESMF.f |
---|
41 | cp Test1.F90 Test1_ESMF.b |
---|
42 | $(CPP) -C -P -I. Test1_ESMF.b > Test1_ESMF.f |
---|
43 | |
---|
44 | Test1_ESMF.exe : libesmf_time.a Test1_ESMF.o |
---|
45 | $(FC) -o Test1_ESMF.exe Test1_ESMF.o libesmf_time.a |
---|
46 | |
---|
47 | Test1_WRFU.f : Test1.F90 |
---|
48 | $(RM) Test1_WRFU.b Test1_WRFU.f |
---|
49 | sed -e "s/ESMF_Mod/module_utility/g" -e "s/ESMF_/WRFU_/g" Test1.F90 > Test1_WRFU.b |
---|
50 | $(CPP) -C -P -I. Test1_WRFU.b > Test1_WRFU.f |
---|
51 | |
---|
52 | Test1_WRFU.exe : libesmf_time.a Test1_WRFU.o |
---|
53 | $(FC) -o Test1_WRFU.exe Test1_WRFU.o libesmf_time.a |
---|
54 | |
---|
55 | .F90.o : |
---|
56 | $(RM) $@ |
---|
57 | $(SED_FTN) $*.F90 > $*.b |
---|
58 | $(CPP) -C -P -I. $*.b > $*.f |
---|
59 | $(RM) $*.b |
---|
60 | @ if echo $(CPP) | $(FGREP) 'DVAR4D'; then \ |
---|
61 | echo COMPILING $*.F90 for 4DVAR ; \ |
---|
62 | $(WRF_SRC_ROOT_DIR)/var/build/da_name_space.pl $*.f > $*.f.tmp ; \ |
---|
63 | mv $*.f.tmp $*.f ; \ |
---|
64 | fi |
---|
65 | $(FC) -o $@ -c $*.f |
---|
66 | |
---|
67 | .F90.f : |
---|
68 | $(RM) $@ |
---|
69 | $(SED_FTN) $*.F90 > $*.b |
---|
70 | $(CPP) -C -P -I. $*.b > $*.f |
---|
71 | $(RM) $*.b |
---|
72 | @ if echo $(CPP) | $(FGREP) 'DVAR4D'; then \ |
---|
73 | echo COMPILING $*.F90 for 4DVAR ; \ |
---|
74 | $(WRF_SRC_ROOT_DIR)/var/build/da_name_space.pl $*.f > $*.f.tmp ; \ |
---|
75 | mv $*.f.tmp $*.f ; \ |
---|
76 | fi |
---|
77 | |
---|
78 | .f.o : |
---|
79 | $(RM) $@ |
---|
80 | $(RM) $*.b |
---|
81 | $(FC) -c $*.f |
---|
82 | |
---|
83 | clean : testclean |
---|
84 | |
---|
85 | testclean: |
---|
86 | $(RM) *.b *.f *.o *.obj *.i libesmf_time.a *.mod Test1*.exe |
---|
87 | |
---|
88 | superclean: testclean |
---|
89 | $(RM) Test1*.out make_tests.out |
---|
90 | |
---|
91 | # DEPENDENCIES : only dependencies after this line |
---|
92 | |
---|
93 | #$$$ update dependencies! |
---|
94 | |
---|
95 | ESMF_Alarm.o : ESMF_BaseTime.o ESMF_Time.o ESMF_TimeInterval.o |
---|
96 | ESMF_BaseTime.o : ESMF_Base.o |
---|
97 | ESMF_Clock.o : ESMF_BaseTime.o ESMF_Time.o ESMF_TimeInterval.o |
---|
98 | ESMF_AlarmClock.o : ESMF_Alarm.o ESMF_Clock.o |
---|
99 | ESMF_Time.o : ESMF_BaseTime.o ESMF_TimeInterval.o ESMF_Calendar.o \ |
---|
100 | ESMF_Stubs.o |
---|
101 | ESMF_Base.o : |
---|
102 | ESMF_Calendar.o : ESMF_BaseTime.o |
---|
103 | ESMF_Fraction.o : ESMF_BaseTime.o |
---|
104 | ESMF_TimeInterval.o : ESMF_BaseTime.o ESMF_Calendar.o ESMF_Fraction.o |
---|
105 | ESMF_Mod.o : ESMF_Alarm.o ESMF_BaseTime.o ESMF_Clock.o ESMF_Time.o \ |
---|
106 | ESMF_Base.o ESMF_Calendar.o ESMF_Fraction.o \ |
---|
107 | ESMF_TimeInterval.o Meat.o ESMF_Stubs.o ESMF_AlarmClock.o |
---|
108 | Meat.o : ESMF_Alarm.o ESMF_BaseTime.o ESMF_Clock.o ESMF_Time.o \ |
---|
109 | ESMF_Base.o ESMF_Calendar.o ESMF_Fraction.o \ |
---|
110 | ESMF_TimeInterval.o |
---|
111 | ESMF_Stubs.o : ESMF_Base.o ESMF_Calendar.o |
---|
112 | module_utility.o : ESMF_Mod.o module_symbols_util.o |
---|
113 | module_symbols_util.o : ESMF_Mod.o |
---|
114 | Test1.o : module_utility.o |
---|
115 | |
---|