1 |
edhill |
1.1 |
|
2 |
|
|
FC = f77 |
3 |
|
|
|
4 |
|
|
.SUFFIXES: |
5 |
|
|
.SUFFIXES: .T .t .F .h .o |
6 |
|
|
|
7 |
|
|
.t.h: |
8 |
|
|
cat $< > $@ |
9 |
|
|
.T.F: |
10 |
|
|
cat $< > $@ |
11 |
|
|
.F.o: |
12 |
|
|
$(FC) -c $< |
13 |
|
|
|
14 |
|
|
|
15 |
|
|
TEST_LINKS = EEPARAMS.h utils.F |
16 |
|
|
TEST_HEADERS = PACKAGES_CONFIG.h CPP_OPTIONS.h |
17 |
|
|
TEST_FILES = mnc_test_utils.F |
18 |
|
|
|
19 |
|
|
FILES = \ |
20 |
edhill |
1.2 |
mnc_dim.F \ |
21 |
edhill |
1.1 |
mnc_file.F \ |
22 |
|
|
mnc_grid.F \ |
23 |
|
|
mnc_init.F \ |
24 |
|
|
mnc_utils.F \ |
25 |
|
|
mnc_var.F |
26 |
|
|
|
27 |
|
|
TEST_OBJECTS = $(TEST_FILES:.F=.o) |
28 |
|
|
OBJECTS = $(FILES:.F=.o) |
29 |
|
|
|
30 |
edhill |
1.3 |
ALL_TEST = $(TEST_LINKS) $(TEST_HEADERS) $(TEST_FILES) $(TEST_OBJECTS) |
31 |
|
|
|
32 |
edhill |
1.1 |
noexe: $(TEST_LINKS) $(TEST_HEADERS) $(TEST_FILES) $(FILES) $(OBJECTS) |
33 |
|
|
echo "compiled" |
34 |
|
|
|
35 |
|
|
EEPARAMS.h: |
36 |
|
|
ln -s ../../eesupp/inc/EEPARAMS.h . |
37 |
|
|
utils.F: |
38 |
|
|
ln -s ../../eesupp/src/utils.F . |
39 |
|
|
|
40 |
edhill |
1.4 |
TEMPLATE_FILES = \ |
41 |
|
|
MNC_RESHAPE_RS_D.F MNC_RESHAPE_RL_D.F \ |
42 |
|
|
MNC_RESHAPE_RS_R.F MNC_RESHAPE_RL_R.F |
43 |
|
|
|
44 |
|
|
templates: $(TEMPLATE_FILES) |
45 |
|
|
|
46 |
|
|
MNC_RESHAPE_RS_D.F: mnc_reshape.template |
47 |
|
|
cat mnc_reshape.template | sed -e 's/RX/RS/g' | sed -e 's/YY/D/g' > $@ |
48 |
|
|
MNC_RESHAPE_RL_D.F: mnc_reshape.template |
49 |
|
|
cat mnc_reshape.template | sed -e 's/RX/RL/g' | sed -e 's/YY/D/g' > $@ |
50 |
|
|
MNC_RESHAPE_RS_R.F: mnc_reshape.template |
51 |
|
|
cat mnc_reshape.template | sed -e 's/RX/RS/g' | sed -e 's/YY/R/g' > $@ |
52 |
|
|
MNC_RESHAPE_RL_R.F: mnc_reshape.template |
53 |
|
|
cat mnc_reshape.template | sed -e 's/RX/RL/g' | sed -e 's/YY/R/g' > $@ |
54 |
|
|
|
55 |
edhill |
1.1 |
test: mnc_test_001 |
56 |
|
|
echo "running mnc_test_001 ..." |
57 |
edhill |
1.3 |
./mnc_test_001 && ncdump test_001.nc | head -50 |
58 |
|
|
|
59 |
edhill |
1.1 |
|
60 |
edhill |
1.3 |
mnc_test_001: $(ALL_TEST) $(FILES) $(OBJECTS) mnc_test_001.o |
61 |
edhill |
1.1 |
$(FC) -o mnc_test_001 mnc_test_001.o $(OBJECTS) $(TEST_OBJECTS) -lnetcdf |
62 |
|
|
|
63 |
|
|
|
64 |
|
|
clean: |
65 |
|
|
-rm -f *.o $(TEST_LINKS) $(TEST_HEADERS) $(TEST_FILES) $(TEST_OBJECTS) |
66 |
edhill |
1.3 |
-rm -f mnc_test_???.F mnc_test_??? test_???.nc |
67 |
edhill |
1.4 |
-rm -f MNC_RESHAPE_R?_?.F |