source: trunk/bin/check_define.sh @ 2941

Last change on this file since 2941 was 2941, checked in by bradbell, 7 years ago

General comments about this commit go here (delete this line).

check_define.sh: ignore files that are output during configuration.
whats_new_13.omh: fix spelling.
makefile.in: fix modification date.
adolc_prefix.omh: require that Colpack and Adolc have same prefix.

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.5 KB
Line 
1#! /bin/bash -e
2# $Id: check_define.sh 2941 2013-10-15 02:26:20Z bradbell $
3# -----------------------------------------------------------------------------
4# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
5#
6# CppAD is distributed under multiple licenses. This distribution is under
7# the terms of the
8#                     Eclipse Public License Version 1.0.
9#
10# A copy of this license is included in the COPYING file of this distribution.
11# Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
12# -----------------------------------------------------------------------------
13if [ $0 != "bin/check_define.sh" ]
14then
15        echo "bin/check_define.sh: must be executed from its parent directory"
16        exit 1
17fi
18# -----------------------------------------------------------------------------
19echo "Difference between '# define' names and '# undef' names"
20echo '-----------------------------------------------------------------------'
21list=`find cppad \( -name '*.hpp' \) -or \( -name '*.hpp.in' \)`
22#
23for cmd in define undef
24do
25        for file in $list
26        do
27                if [ ! -e $file.in ]
28                then
29                        sed -n -e "/^# *$cmd /p" $file | \
30                                sed -e "s/^# *$cmd  *\([A-Za-z0-9_]*\).*/\1/" >> tmp.$$
31                fi
32        done
33        if [ "$cmd" == 'define' ]
34        then
35                sed -e '/_INCLUDED$/d' -i tmp.$$
36        fi
37        sort -u tmp.$$ > $cmd.$$
38        rm tmp.$$
39done
40if ! diff define.$$ undef.$$
41then
42        echo "check_define.sh: exiting because defines and undefs do not match"
43        rm undef.$$
44        rm define.$$
45        exit 1
46fi
47echo '-----------------------------------------------------------------------'
48rm undef.$$
49rm define.$$
50exit 0
Note: See TracBrowser for help on using the repository browser.