2 #---------------------------------*- sh -*-------------------------------------
4 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
6 # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
8 #------------------------------------------------------------------------------
10 # This file is part of OpenFOAM.
12 # OpenFOAM is free software: you can redistribute it and/or modify it
13 # under the terms of the GNU General Public License as published by
14 # the Free Software Foundation, either version 3 of the License, or
15 # (at your option) any later version.
17 # OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
18 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 # You should have received a copy of the GNU General Public License
23 # along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
29 # Clean up the wmake control directory Make and remove the include
30 # directories generated for libraries.
32 #------------------------------------------------------------------------------
36 while [ "$#" -ge 1 ]; do echo "$1"; shift; done
39 $Script target [dir [MakeDir]]
41 Clean up the wmake control directory Make and remove the include
42 directories generated for libraries.
44 The targets correspond to a subset of the 'wmake' special targets:
45 all all subdirectories
47 lib cleans dir/Make and dir/lnInclude
48 libso cleans dir/Make and dir/lnInclude
49 libo cleans dir/Make and dir/lnInclude
55 # provide immediate help
56 if [ "$1" = "-h" -o "$1" = "-help" ]
62 #------------------------------------------------------------------------------
63 # check arguments and change to the directory in which to run wmake
64 #------------------------------------------------------------------------------
84 # alternative name for the Make sub-directory
92 cd $dir 2>/dev
/null ||
{
93 echo "$Script error: could not change to directory '$dir'" 1>&2
98 # provide some feedback
99 echo "$Script ${dir:-./}"
102 #------------------------------------------------------------------------------
103 # Recurse the directories tree
104 #------------------------------------------------------------------------------
106 if [ "$makeOption" = all
]
112 elif [ ! -d $MakeDir ]
114 for dir
in `find . \( -type d -a -name Make \) -printf "%h "`
121 # This is the end of the recursion down the application directories tree
122 # so remove the "all" option so that the call to make builds the application
126 #------------------------------------------------------------------------------
127 # Check the existance of the Make directory
128 #------------------------------------------------------------------------------
132 echo "$Script error: '$MakeDir' directory does not exist" 1>&2
136 # -----------------------------------------------------------------------------
138 rm -rf $MakeDir/$WM_OPTIONS $MakeDir/classes
2>/dev
/null
140 find .
-name "*.dep" -exec rm {} \
;
142 case "$makeOption" in
144 rm -rf lnInclude
2>/dev
/null
148 rm -rf ii_files Templates.DB
2>/dev
/null
151 #------------------------------------------------------------------------------