5 |
# |
# |
6 |
|
|
7 |
FC = f77 |
FC = f77 |
8 |
|
CPP = cpp |
9 |
|
|
10 |
.SUFFIXES: |
.SUFFIXES: |
11 |
.SUFFIXES: .T .t .F .h .o |
.SUFFIXES: .T .t .F .f .h .o |
12 |
|
|
13 |
.t.h: |
.t.h: |
14 |
cat $< > $@ |
cat $< > $@ |
15 |
.T.F: |
.T.F: |
16 |
cat $< > $@ |
cat $< > $@ |
17 |
.F.o: |
.F.f: |
18 |
$(FC) -c $< |
$(CPP) $(DEFINES) > $@ |
19 |
|
.f.o: |
20 |
|
$(FC) -DMNC_TEST -c $< |
21 |
|
|
22 |
|
|
23 |
TEST_LINKS = EEPARAMS.h utils.F |
TEST_LINKS = EEPARAMS.h utils.F |
24 |
TEST_HEADERS = PACKAGES_CONFIG.h CPP_OPTIONS.h |
TEST_HEADERS = PACKAGES_CONFIG.h CPP_OPTIONS.h SIZE.h |
25 |
TEST_FILES = mnc_test_utils.F |
TEST_FILES = mnc_test_utils.F |
26 |
|
TEST_DEFINES = -DMNC_DEBUG |
27 |
|
|
28 |
FILES = \ |
FILES = \ |
29 |
mnc_dim.F \ |
mnc_dim.F \ |
50 |
ln -s ../../eesupp/src/utils.F . |
ln -s ../../eesupp/src/utils.F . |
51 |
|
|
52 |
TEMPLATE_FILES = \ |
TEMPLATE_FILES = \ |
53 |
MNC_RESHAPE_RS_D.F MNC_RESHAPE_RL_D.F \ |
MNC_CW_READWRITE_RS.F \ |
54 |
MNC_RESHAPE_RS_R.F MNC_RESHAPE_RL_R.F |
MNC_CW_READWRITE_RL.F \ |
55 |
|
MNC_CW_READWRITE_I.F |
56 |
|
TEMPLATE_OBJECTS = $(TEMPLATE_FILES:.F=.o) |
57 |
|
|
58 |
|
mnc_netcdf_stubs.c: mnc_netcdf_stubs.h |
59 |
|
-./build_netcdf_stubs > tmp_mnc_netcdf_stubs.c |
60 |
|
-cpp -P < tmp_mnc_netcdf_stubs.c > mnc_netcdf_stubs.c |
61 |
|
-rm -f tmp_mnc_netcdf_stubs.c |
62 |
|
|
63 |
|
mnc_netcdf_stubs.o: mnc_netcdf_stubs.c |
64 |
|
-gcc -c mnc_netcdf_stubs.c |
65 |
|
|
66 |
templates: $(TEMPLATE_FILES) mnc_id_header.h |
templates: $(TEMPLATE_FILES) mnc_id_header.h |
67 |
|
|
68 |
MNC_RESHAPE_RS_D.F: mnc_reshape.template |
MNC_CW_READWRITE_RS.F: mnc_cw_readwrite.template |
69 |
cat mnc_reshape.template | sed -e 's/RX/RS/g' | sed -e 's/YY/D/g' > $@ |
cat mnc_cw_readwrite.template | sed -e 's/RX/RS/g' | sed -e 's/MNC2I/NINT/g' | sed -e 's/MNCI2//g' | sed -e 's/__V/_RS/g' > MNC_CW_READWRITE_RS.F |
70 |
MNC_RESHAPE_RL_D.F: mnc_reshape.template |
MNC_CW_READWRITE_RL.F: mnc_cw_readwrite.template |
71 |
cat mnc_reshape.template | sed -e 's/RX/RL/g' | sed -e 's/YY/D/g' > $@ |
cat mnc_cw_readwrite.template | sed -e 's/RX/RL/g' | sed -e 's/MNC2I/NINT/g' | sed -e 's/MNCI2//g' | sed -e 's/__V/_RL/g' > MNC_CW_READWRITE_RL.F |
72 |
MNC_RESHAPE_RS_R.F: mnc_reshape.template |
MNC_CW_READWRITE_I.F: mnc_cw_readwrite.template |
73 |
cat mnc_reshape.template | sed -e 's/RX/RS/g' | sed -e 's/YY/R/g' > $@ |
cat mnc_cw_readwrite.template | sed -e 's/RX/I/g' | sed -e 's/MNC2I//g' | sed -e 's/MNCI2/NINT/g' | sed -e 's/__V/INTEGER/g' > MNC_CW_READWRITE_I.F |
|
MNC_RESHAPE_RL_R.F: mnc_reshape.template |
|
|
cat mnc_reshape.template | sed -e 's/RX/RL/g' | sed -e 's/YY/R/g' > $@ |
|
74 |
|
|
75 |
tag = ../../doc/tag-index |
tag = ../../doc/tag-index |
76 |
|
|
77 |
mnc_id_header.h: |
mnc_id_header.h: |
78 |
-./parse_local_info > $@ |
-./parse_local_info > $@ |
79 |
|
|
80 |
test: all mnc_test_001 mnc_test_002 |
test: all mnc_test_001 mnc_test_002 |
81 |
echo "running mnc_test_001 ..." |
echo "running mnc_test_001 ..." |
82 |
./mnc_test_001 > t_out_001 && ncdump test_001.nc | head -20 |
./mnc_test_001 > t_out_001 && ncdump test_001.nc | head -20 |
83 |
./mnc_test_002 |
./mnc_test_002 > t_out_002 && tail -15 t_out_002 |
84 |
|
|
85 |
mnc_test_001: $(ALL_TEST) $(FILES) $(OBJECTS) mnc_test_001.o |
mnc_test_001: $(ALL_TEST) $(FILES) $(OBJECTS) mnc_test_001.o |
86 |
$(FC) -o mnc_test_001 mnc_test_001.o $(OBJECTS) $(TEST_OBJECTS) -lnetcdf |
$(FC) -o mnc_test_001 mnc_test_001.o $(OBJECTS) $(TEST_OBJECTS) -lnetcdf |
90 |
|
|
91 |
CLEAN: |
CLEAN: |
92 |
@make clean |
@make clean |
93 |
|
-rm -f mnc_netcdf_stubs.c |
94 |
|
|
95 |
Clean: |
Clean: |
96 |
@make clean |
@make clean |
97 |
clean: |
|
98 |
|
testclean: |
99 |
-rm -f *.o $(TEST_LINKS) $(TEST_HEADERS) $(TEST_FILES) $(TEST_OBJECTS) |
-rm -f *.o $(TEST_LINKS) $(TEST_HEADERS) $(TEST_FILES) $(TEST_OBJECTS) |
100 |
-rm -f mnc_test_???.F mnc_test_??? test_???.nc t_out_??? |
-rm -f mnc_test_???.F mnc_test_??? test_???.nc t_out_??? |
101 |
-rm -f MNC_RESHAPE_R?_?.F mnc_id_header.h |
|
102 |
|
clean: testclean |
103 |
|
-rm -f $(TEMPLATE_FILES) mnc_id_header.h |
104 |
|
-rm -f mnc_netcdf_stubs.o |
105 |
|
|