2 #------------------------------------------------------------------------------
4 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
6 # \\ / A nd | Copyright (C) 1991-2008 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 ||
{
95 echo " could not change to directory '$dir'"
100 # provide some feedback
101 echo "$Script ${dir:-./}"
104 #------------------------------------------------------------------------------
105 # Recurse the directories tree
106 #------------------------------------------------------------------------------
108 if [ "$makeOption" = all
]
114 elif [ ! -d $MakeDir ]
116 for dir
in `find . \( -type d -a -name "Make" \) -printf "%h "`
123 # This is the end of the recursion down the application directories tree
124 # so remove the "all" option so that the call to make builds the application
128 #------------------------------------------------------------------------------
129 # Check the existance of the Make directory
130 #------------------------------------------------------------------------------
135 echo " '$MakeDir' directory does not exist"
139 # -----------------------------------------------------------------------------
141 rm -rf $MakeDir/$WM_OPTIONS $MakeDir/classes
2>/dev
/null
143 find .
-name "*.dep" -exec rm {} \
;
145 case "$makeOption" in
147 rm -rf lnInclude
2>/dev
/null
151 rm -rf ii_files Templates.DB
2>/dev
/null
154 #------------------------------------------------------------------------------