2 #------------------------------------------------------------------------------
4 # \\ / F ield | foam-extend: Open Source CFD
5 # \\ / O peration | Version: 3.2
6 # \\ / A nd | Web: http://www.foam-extend.org
7 # \\/ M anipulation | For copyright notice see file Copyright
8 #------------------------------------------------------------------------------
10 # This file is part of foam-extend.
12 # foam-extend 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 3 of the License, or (at your
15 # option) any later version.
17 # foam-extend is distributed in the hope that it will be useful, but
18 # WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 # General Public License for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with foam-extend. 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 #------------------------------------------------------------------------------