/[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.1 - (show annotations) (download)
Mon Nov 24 14:54:12 2003 UTC (21 years ago) by adcroft
Branch: MAIN
 o Created mechanism for make makefile to use $TOOLSDIR variable of Makefile
   - previously it recorded the actual invocation of genmake2 which meant
     that editing TOOLSDIR was not sufficient to be able to move the set-up
 o In addition to everything else, we now record the pkg configuration in
   the Makefile
   - previously the configuration was only recorded in PACKAGES_CONFIG.h
     and gm_state
 o Created targets for Makefile:
   PACKAGES_CONFIG.h:  this allows "make" to create the pkg config file
                       given the configuration state that is now recorded
                       in Makefile
   AD_CONFIG.h:        creates the appropriate null adj config file for
                       compiling the forward model
 o The switching of AD_CONFIG.h is unchanged but the files used for comparison
   of the state are now created only briefly by make and only for the duration
   of the comparison
   - previously these files were left in place and an inadvertent deletion
    required a new invocation of genmake2
 o Added new "generic" script for converting cmd-line cpp options to cpp
   statements in a file
 o Created a file in tools/adjoint_sed containing the sed commands needed
   to patch back myThid in adjoint code. This file used to be created in
   the CWD by genmake2

Comments:
 o genmake2, make   now works without the make depend phase
   - this is necessary (and was an old feature) for occasions when makedepend
     is not available and xmakedepend doesn't work or is too slow to be useful
 o make clean   now deletes all temporary files (except FC_NAMEMANGLE.h) so
   that make CLEAN only leaves the Makefile and the Makefile now contains
   sufficient information to rebuild everything. This was a capability of
   the old genmake.

1 #!/bin/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: $
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 for ac_option ; do
24 case $ac_option in
25 -D*)
26 echo $ac_option | sed 's/-D/#define /' | sed 's/=/ /'
27 ;;
28 -U*)
29 echo $ac_option | sed 's/-U/#undef /' | sed 's/=/ /'
30 ;;
31 *)
32 echo "/* " $ac_option " */"
33 ;;
34 esac
35 done

  ViewVC Help
Powered by ViewVC 1.1.22