2 #------------------------------------------------------------------------------
4 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
6 # \\ / A nd | Copyright (C) 1991-2009 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 the
14 # Free Software Foundation; either version 2 of the License, or (at your
15 # 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, write to the Free Software Foundation,
24 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 # Clean up the wmake control directory Make and remove the include
31 # directories generated for libraries.
33 #------------------------------------------------------------------------------
37 while [ "$#" -ge 1 ]; do echo "$1"; shift; done
40 $Script target [dir [MakeDir]]
42 Clean up the wmake control directory Make and remove the include
43 directories generated for libraries.
45 The targets correspond to a subset of the 'wmake' special targets:
46 all all subdirectories
48 lib cleans dir/Make and dir/lnInclude
49 libso cleans dir/Make and dir/lnInclude
50 libo cleans dir/Make and dir/lnInclude
56 # provide immediate help
57 if [ "$1" = "-h" -o "$1" = "-help" ]
63 #------------------------------------------------------------------------------
64 # check arguments and change to the directory in which to run wmake
65 #------------------------------------------------------------------------------
85 # alternative name for the Make sub-directory
93 cd $dir 2>/dev
/null ||
{
94 echo "$Script error: could not change to directory '$dir'" 1>&2
99 # provide some feedback
100 echo "$Script ${dir:-./}"
103 #------------------------------------------------------------------------------
104 # Recurse the directories tree
105 #------------------------------------------------------------------------------
107 if [ "$makeOption" = all
]
113 elif [ ! -d $MakeDir ]
115 for dir
in `find . \( -type d -a -name Make \) -printf "%h "`
122 # This is the end of the recursion down the application directories tree
123 # so remove the "all" option so that the call to make builds the application
127 #------------------------------------------------------------------------------
128 # Check the existance of the Make directory
129 #------------------------------------------------------------------------------
133 echo "$Script error: '$MakeDir' directory does not exist" 1>&2
137 # -----------------------------------------------------------------------------
139 rm -rf $MakeDir/$WM_OPTIONS $MakeDir/classes
2>/dev
/null
141 find .
-name "*.dep" -exec rm {} \
;
143 case "$makeOption" in
145 rm -rf lnInclude
2>/dev
/null
149 rm -rf ii_files Templates.DB
2>/dev
/null
152 #------------------------------------------------------------------------------