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