/[MITgcm]/MITgcm/pkg/mnc/Makefile
ViewVC logotype

Contents of /MITgcm/pkg/mnc/Makefile

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.17 - (show annotations) (download)
Mon Feb 28 17:53:29 2005 UTC (19 years, 2 months ago) by edhill
Branch: MAIN
CVS Tags: checkpoint58l_post, checkpoint57t_post, checkpoint57o_post, checkpoint58e_post, checkpoint57v_post, checkpoint58u_post, checkpoint58w_post, checkpoint57m_post, checkpoint57s_post, checkpoint57k_post, checkpoint57g_post, checkpoint58r_post, checkpoint57i_post, checkpoint57y_post, checkpoint57e_post, checkpoint58n_post, checkpoint58x_post, checkpoint57g_pre, checkpoint58t_post, checkpoint58h_post, checkpoint57y_pre, checkpoint57f_pre, checkpoint58q_post, checkpoint58j_post, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59h, checkpoint57r_post, checkpoint59, checkpoint58, checkpoint57h_done, checkpoint58f_post, checkpoint57x_post, checkpoint57n_post, checkpoint58d_post, checkpoint58c_post, checkpoint57w_post, checkpoint57p_post, checkpint57u_post, checkpoint57f_post, checkpoint58a_post, checkpoint58i_post, checkpoint57q_post, checkpoint58g_post, checkpoint58o_post, checkpoint57z_post, checkpoint58y_post, checkpoint58k_post, checkpoint58v_post, checkpoint58s_post, checkpoint58p_post, checkpoint57j_post, checkpoint58b_post, checkpoint57h_pre, checkpoint58m_post, checkpoint57l_post, checkpoint57h_post
Changes since 1.16: +4 -4 lines
 o fix obscure MNC bug involving conversion between reals and integers
   - it caused no problems with certain (eg. gcc, ifc) compilers but the
     new version is now more standards-compliant

1 #
2 # $Header: /u/gcmpack/MITgcm/pkg/mnc/Makefile,v 1.16 2005/01/05 18:26:56 edhill Exp $
3 #
4 # A Makefile for MNC templates and testing
5 #
6
7 FC = f77
8 CPP = cpp
9
10 .SUFFIXES:
11 .SUFFIXES: .T .t .F .f .h .o
12
13 .t.h:
14 cat $< > $@
15 .T.F:
16 cat $< > $@
17 .F.f:
18 $(CPP) $(DEFINES) > $@
19 .f.o:
20 $(FC) -DMNC_TEST -c $<
21
22
23 TEST_LINKS = EEPARAMS.h utils.F
24 TEST_HEADERS = PACKAGES_CONFIG.h CPP_OPTIONS.h SIZE.h
25 TEST_FILES = mnc_test_utils.F
26 TEST_DEFINES = -DMNC_DEBUG
27
28 FILES = \
29 mnc_dim.F \
30 mnc_file.F \
31 mnc_grid.F \
32 mnc_init.F \
33 mnc_utils.F \
34 mnc_var.F \
35 mnc_cwrapper.F
36
37 TEST_OBJECTS = $(TEST_FILES:.F=.o)
38 OBJECTS = $(FILES:.F=.o)
39
40 ALL_TEST = $(TEST_LINKS) $(TEST_HEADERS) $(TEST_FILES) $(TEST_OBJECTS)
41
42 all: templates
43
44 noexe: $(TEST_LINKS) $(TEST_HEADERS) $(TEST_FILES) $(FILES) $(OBJECTS)
45 echo "compiled"
46
47 EEPARAMS.h:
48 ln -s ../../eesupp/inc/EEPARAMS.h .
49 utils.F:
50 ln -s ../../eesupp/src/utils.F .
51
52 TEMPLATE_FILES = \
53 MNC_CW_READWRITE_RS.F \
54 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
67
68 MNC_CW_READWRITE_RS.F: mnc_cw_readwrite.template
69 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_CW_READWRITE_RL.F: mnc_cw_readwrite.template
71 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_CW_READWRITE_I.F: mnc_cw_readwrite.template
73 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
74
75 tag = ../../doc/tag-index
76
77 mnc_id_header.h:
78 -./parse_local_info > $@
79
80 test: all mnc_test_001 mnc_test_002
81 echo "running mnc_test_001 ..."
82 ./mnc_test_001 > t_out_001 && ncdump test_001.nc | head -20
83 ./mnc_test_002 > t_out_002 && tail -15 t_out_002
84
85 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
87
88 mnc_test_002: $(ALL_TEST) $(FILES) $(OBJECTS) mnc_test_002.o
89 $(FC) -o mnc_test_002 mnc_test_002.o $(OBJECTS) $(TEST_OBJECTS) -lnetcdf
90
91 CLEAN:
92 @make clean
93 -rm -f mnc_netcdf_stubs.c
94
95 Clean:
96 @make clean
97
98 testclean:
99 -rm -f *.o $(TEST_LINKS) $(TEST_HEADERS) $(TEST_FILES) $(TEST_OBJECTS)
100 -rm -f mnc_test_???.F mnc_test_??? test_???.nc t_out_???
101
102 clean: testclean
103 -rm -f $(TEMPLATE_FILES) mnc_id_header.h
104 -rm -f mnc_netcdf_stubs.o
105

  ViewVC Help
Powered by ViewVC 1.1.22