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

Annotation of /MITgcm/tools/convert_cpp_cmd2defines

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


Revision 1.7 - (hide annotations) (download)
Tue Aug 28 21:09:11 2012 UTC (7 years, 10 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63s, checkpoint64, checkpoint65, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, HEAD
Changes since 1.6: +3 -2 lines
always print usual warning comment 'this file is automatically generated'
 from here (instead of passing this as argument from genmake2).

1 jmc 1.5 #! /usr/bin/env bash
2 adcroft 1.1 #
3     # Converts -Dmacro to #define macro
4 jmc 1.6 # and -Umacro to #undef macro
5 adcroft 1.1 # 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 jmc 1.7 # $Header: /u/gcmpack/MITgcm/tools/convert_cpp_cmd2defines,v 1.6 2012/07/06 18:53:14 jmc Exp $
12 adcroft 1.2 # $Name: $
13 adcroft 1.1
14     cat << EOF
15 jmc 1.7 /* Warning - this file is automatically generated - do NOT edit */
16 adcroft 1.1 /*
17 jmc 1.7 Created by convert_cpp_cmd2defines with the following command line arguments:
18 adcroft 1.1 $@
19     */
20    
21     EOF
22    
23 adcroft 1.2 BARRIER=
24    
25 adcroft 1.3 # Process arguments
26 jmc 1.5 for arg in "$@"
27 adcroft 1.3 do
28     case $arg in
29 adcroft 1.2 -b*)
30 adcroft 1.3 BARRIER=`echo $arg | sed 's/-b//'`
31     echo "#ifndef ${BARRIER}"
32     echo "#define ${BARRIER}"
33     ;;
34 adcroft 1.1 -D*)
35 adcroft 1.3 echo $arg | sed 's/-D/#define /' | sed 's/=/ /'
36     ;;
37 adcroft 1.1 -U*)
38 adcroft 1.3 echo $arg | sed 's/-U/#undef /' | sed 's/=/ /'
39     ;;
40 adcroft 1.1 *)
41 adcroft 1.3 echo "/* " $arg " */"
42     ;;
43 adcroft 1.1 esac
44     done
45 adcroft 1.2
46     if test ! "x${BARRIER}" = x ; then
47     echo "#endif /* ${BARRIER} */"
48     fi

  ViewVC Help
Powered by ViewVC 1.1.22