BUG: sampledSurfaces: cleared out volPointInterpolation & pointMesh.
[OpenFOAM-1.7.x.git] / wmake / wclean
blobdeeb59f8f26bbc2f7fe85620c17e7bf06537cb74
1 #!/bin/sh
2 #---------------------------------*- sh -*-------------------------------------
3 # ========= |
4 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 # \\ / O peration |
6 # \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
7 # \\/ M anipulation |
8 #------------------------------------------------------------------------------
9 # License
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
20 # for more details.
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/>.
25 # Script
26 # wclean
28 # Description
29 # Clean up the wmake control directory Make and remove the include
30 # directories generated for libraries.
32 #------------------------------------------------------------------------------
33 Script=${0##*/}
35 usage() {
36 while [ "$#" -ge 1 ]; do echo "$1"; shift; done
37 cat<<USAGE
38 usage: $Script [dir]
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
46 exe cleans dir/Make
47 lib cleans dir/Make and dir/lnInclude
48 libso cleans dir/Make and dir/lnInclude
49 libo cleans dir/Make and dir/lnInclude
51 USAGE
52 exit 1
55 # provide immediate help
56 if [ "$1" = "-h" -o "$1" = "-help" ]
57 then
58 usage
62 #------------------------------------------------------------------------------
63 # check arguments and change to the directory in which to run wmake
64 #------------------------------------------------------------------------------
66 unset dir makeOption
67 MakeDir=Make
69 if [ $# -ge 1 ]
70 then
72 if [ -d "$1" ]
73 then
74 dir=$1
75 else
76 makeOption=$1
79 if [ $# -ge 2 ]
80 then
81 dir=$2
84 # alternative name for the Make sub-directory
85 if [ $# -ge 3 ]
86 then
87 MakeDir=$3
90 if [ "$dir" ]
91 then
92 cd $dir 2>/dev/null || {
93 echo "$Script error: could not change to directory '$dir'" 1>&2
94 exit 1
98 # provide some feedback
99 echo "$Script ${dir:-./}"
102 #------------------------------------------------------------------------------
103 # Recurse the directories tree
104 #------------------------------------------------------------------------------
106 if [ "$makeOption" = all ]
107 then
108 if [ -e Allclean ]
109 then
110 ./Allclean
111 exit $?
112 elif [ ! -d $MakeDir ]
113 then
114 for dir in `find . \( -type d -a -name Make \) -printf "%h "`
116 $0 $dir
117 done
118 exit 0
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
123 makeOption=
126 #------------------------------------------------------------------------------
127 # Check the existance of the Make directory
128 #------------------------------------------------------------------------------
130 if [ ! -d $MakeDir ]
131 then
132 echo "$Script error: '$MakeDir' directory does not exist" 1>&2
133 exit 1
136 # -----------------------------------------------------------------------------
138 rm -rf $MakeDir/$WM_OPTIONS $MakeDir/classes 2>/dev/null
140 find . -name "*.dep" -exec rm {} \;
142 case "$makeOption" in
143 lib | libso | libo )
144 rm -rf lnInclude 2>/dev/null
146 esac
148 rm -rf ii_files Templates.DB 2>/dev/null
149 rm -f so_locations
151 #------------------------------------------------------------------------------