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 # Link all the source files in the <dir> directory into <dir>/lnInclude
32 # Usage: wmakeLnInclude [-f] <dir> [-lnOption]
34 # The desired source files:
35 # *.C *.H *.h *.cpp *.cxx *.hpp *.hxx
39 # .#* (cvs recovered files)
40 #------------------------------------------------------------------------------
44 while [ "$#" -ge 1 ]; do echo "$1"; shift; done
47 usage: $Script [-f] <dir> [-lnOption]
49 Link all the source files in the <dir> into <dir>/lnInclude
50 * Use '-f' to force an update when the lnInclude directory already exists.
56 #------------------------------------------------------------------------------
58 # simple option parsing
62 # simple parse options
66 -h |
-help) # provide immediate help
74 usage
"unknown option/argument: '$*'"
83 incDir
=$baseDir/lnInclude
92 usage
"ERROR: wrong number of arguments"
98 echo $Script: Base directory
$baseDir does not exist
, exiting.
104 # could change force to remove lnInclude first
105 if [ ! "$forceUpdate" ]
107 # echo $Script: include directory $incDir already exists, exiting.
116 echo $Script: failed to create include directory
$incDir
123 echo $Script: linking include files to
$incDir
129 \
( -name lnInclude
-o -name -Make -o -name config \
) -prune \
130 -o \
( -name '*.[CHh]' -o -name '*.[ch]xx' -o -name '*.[ch]pp' -o -name '*.type' \
) \
132 -exec ln $lnOpt {} . \
;
136 # remove any broken links
138 find -L .
-type l
-exec rm \
{\
} \
;
140 #------------------------------------------------------------------------------