/[MITgcm]/MITgcm/tools/convert_cpp_cmd2defines
ViewVC logotype

Contents of /MITgcm/tools/convert_cpp_cmd2defines

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


Revision 1.4 - (show annotations) (download)
Tue Nov 25 17:22:47 2003 UTC (21 years ago) by edhill
Branch: MAIN
CVS Tags: checkpoint58l_post, checkpoint57t_post, checkpoint57o_post, checkpoint52l_pre, checkpoint52e_pre, hrcube4, checkpoint58e_post, mitgcm_mapl_00, checkpoint52n_post, checkpoint52j_post, checkpoint53d_post, checkpoint58u_post, checkpoint58w_post, checkpoint54a_pre, checkpoint57m_post, checkpoint55c_post, checkpoint54e_post, checkpoint52e_post, checkpoint57s_post, checkpoint54a_post, checkpoint53c_post, checkpoint57k_post, checkpoint55d_pre, checkpoint57d_post, checkpoint57g_post, checkpoint60, checkpoint61, checkpoint62, checkpoint57b_post, checkpoint57c_pre, checkpoint58r_post, checkpoint55j_post, checkpoint56b_post, checkpoint57i_post, checkpoint57y_post, hrcube_1, checkpoint57e_post, branch-netcdf, checkpoint52d_pre, checkpoint52l_post, checkpoint55h_post, checkpoint58n_post, checkpoint53b_post, checkpoint58x_post, checkpoint52k_post, checkpoint57g_pre, checkpoint54b_post, checkpoint53b_pre, checkpoint55b_post, checkpoint58t_post, checkpoint58h_post, checkpoint54d_post, checkpoint56c_post, checkpoint52m_post, checkpoint57y_pre, checkpoint55, checkpoint53a_post, checkpoint57f_pre, checkpoint57a_post, checkpoint54, checkpoint58q_post, checkpoint54f_post, checkpoint57v_post, checkpoint59q, checkpoint59p, checkpoint55g_post, checkpoint59r, checkpoint58j_post, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint55f_post, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint59j, checkpoint57r_post, checkpoint59, checkpoint58, checkpoint57a_pre, checkpoint55i_post, checkpoint57, checkpoint56, checkpoint53, checkpoint52d_post, eckpoint57e_pre, checkpoint57h_done, checkpoint58f_post, checkpoint53g_post, checkpoint52f_post, checkpoint57x_post, checkpoint57n_post, checkpoint52c_post, checkpoint58d_post, checkpoint58c_post, checkpoint57w_post, checkpoint57p_post, checkpint57u_post, checkpoint57f_post, checkpoint58a_post, checkpoint58i_post, checkpoint57q_post, checkpoint58g_post, hrcube5, checkpoint58o_post, checkpoint57z_post, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint57c_post, checkpoint58y_post, checkpoint55e_post, checkpoint58k_post, checkpoint52i_post, checkpoint52j_pre, checkpoint58v_post, checkpoint53f_post, checkpoint55a_post, checkpoint53d_pre, checkpoint54c_post, checkpoint58s_post, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint58p_post, checkpoint61a, checkpoint61n, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint57j_post, checkpoint61z, checkpoint61x, checkpoint61y, checkpoint58b_post, checkpoint57h_pre, checkpoint58m_post, checkpoint57l_post, checkpoint52i_pre, checkpoint52h_pre, checkpoint52f_pre, checkpoint57h_post, hrcube_2, hrcube_3, checkpoint56a_post, checkpoint55d_post
Branch point for: netcdf-sm0
Changes since 1.3: +2 -2 lines
 o changed the shell invocation syntax to "#! /usr/bin/env ${SHELL}" and
   verified that this works on the following machines:
   - all available Linux boxes
   - Mac OS X
   - OSF1 eg. halem
   - AIX SP[34] clusters eg. bluesky/blackforest/babyblue @ NCAR
   - SGI O[23]k clusters eg. turing/lomax/chapman @ nas.nasa.gov
   - Solaris [89] eg. slough.mit.edu

1 #! /usr/bin/env sh
2 #
3 # Converts -Dmacro to #define macro
4 # and -Umacro to #undef macro
5 # on standard output
6 #
7 # Any options that do not take the form -D* or -U* are placed as comments.
8 #
9 # usage: convert_cpp_cmd2defines [-Dmacro1|-Umacro1] [...]
10 #
11 # $Header: /u/u3/gcmpack/MITgcm/tools/convert_cpp_cmd2defines,v 1.3 2003/11/25 15:31:47 adcroft Exp $
12 # $Name: $
13
14 cat << EOF
15 /*
16 This file created by convert_cpp_cmd2defines with the following command
17 line arguments:
18 $@
19 */
20
21 EOF
22
23 BARRIER=
24
25 # Process arguments
26 for arg in $@
27 do
28 case $arg in
29 -b*)
30 BARRIER=`echo $arg | sed 's/-b//'`
31 echo "#ifndef ${BARRIER}"
32 echo "#define ${BARRIER}"
33 ;;
34 -D*)
35 echo $arg | sed 's/-D/#define /' | sed 's/=/ /'
36 ;;
37 -U*)
38 echo $arg | sed 's/-U/#undef /' | sed 's/=/ /'
39 ;;
40 *)
41 echo "/* " $arg " */"
42 ;;
43 esac
44 done
45
46 if test ! "x${BARRIER}" = x ; then
47 echo "#endif /* ${BARRIER} */"
48 fi

  ViewVC Help
Powered by ViewVC 1.1.22