ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / bin / tools / foamListSourceFiles
blob56f87bdcff5f5b292e05e7d6c7728af8413c3ea2
1 #!/bin/sh
2 #------------------------------------------------------------------------------
3 # ========= |
4 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 # \\ / O peration |
6 # \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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 # foamListSourceFiles <directory>
28 # Description
29 # Lists source files and Make/{files,options} in given directory
31 # Note
32 # Not normally called directly by the user.
33 #------------------------------------------------------------------------------
35 [ $# -eq 1 ] || {
36 cat <<USAGE 1>&2
37 Usage : ${0##*/} directory
39 * Lists source files and Make/{files,options} in given directory
41 USAGE
42 exit 1
45 # canonical form (no double and no trailing dashes)
46 packDir=$(echo "$1" | sed -e 's@//*@/@g' -e 's@/$@@')
48 # check for essential directories
49 [ -d "$packDir" ] || {
50 echo "Error: directory $packDir does not exist" 1>&2
51 exit 1
56 # list of files but excluding
57 # - dependent files (dep, obj, lib), archives
58 # - exclude Doxygen documentation etc
61 find -H $packDir \
62 ! -type d \
63 \( -type f -o -type l \) \
64 ! -name "*~" \
65 -a ! -name ".*~" \
66 -a ! -name "*.orig" \
67 -a ! -name "*.dep" \
68 -a ! -name "*.o" \
69 -a ! -name "*.so" \
70 -a ! -name "*.a" \
71 -a ! -name "*.tar" \
72 -a ! -name "*.tar.gz" \
73 -a ! -name "*.tgz" \
74 -a ! -name "*.tar.bz2" \
75 -a ! -name "*.tbz" \
76 -a ! -name "core" \
77 -a ! -name "core.[1-9]*" \
78 -a ! -name "libccmio*" \
79 | sed \
80 -e '\@/\.git/@d' \
81 -e '\@/\.tags/@d' \
82 -e '\@/platforms/@d' \
83 -e '\@/t/@d' \
84 -e '\@/Make[.A-Za-z]*/[^/]*/@d' \
85 -e '\@/[Dd]oxygen/html/@d' \
86 -e '\@/download/@d' \
87 -e '\@/libccmio-.*/@d' \
88 -e '\@/debian/@d'
91 #------------------------------------------------------------------------------