Merge branch 'master' of github.com:OpenCFD/OpenFOAM-1.7.x
[OpenFOAM-1.7.x.git] / bin / foamSourceFiles
blob5b342983999e20465f99b35a24f289a65999569a
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 # foamSourceFiles <directory>
28 # Description
29 # Returns all the .C and .H files and Make/options
30 # and Make/files in a given directory.
32 #------------------------------------------------------------------------------
34 if [ $# -ne 1 ]
35 then
36 echo "Usage : ${0##*/} directory"
37 echo ""
38 echo "Returns all .C and .H files and Make/options and Make/files."
39 echo ""
40 exit 1
43 # canonical form (no double and no trailing dashes)
44 packDir=$(echo "$1" | sed -e 's@//*@/@g' -e 's@/$@@')
46 if [ ! -d $packDir ]
47 then
48 echo "Error: directory $packDir does not exist"
49 exit 1
52 find -H $packDir \
53 ! -type d \
54 \( -type f -o -type l \) \
55 ! -name "*~" \
56 -a ! -name ".*~" \
57 -a ! -name "*.orig" \
58 -a ! -name "*.dep" \
59 -a ! -name "*.o" \
60 -a ! -name "*.so" \
61 -a ! -name "*.a" \
62 -a ! -name "*.tgz" \
63 -a ! -name "core" \
64 -a ! -name "core.[1-9]*" \
65 -a ! -name "libccmio*" \
66 | sed \
67 -e "\@$packDir/lib/@d" \
68 -e '\@/\.git/@d' \
69 -e '\@/\.gitignore@d' \
70 -e '\@/\.tags/@d' \
71 -e '\@/\README\.org@d' \
72 -e '\@applications/bin/@d' \
73 -e '\@tutorialsTest/@d' \
74 -e '\@wmake/bin/@d' \
75 -e '\@/t/@d' \
76 -e '\@/Make[.A-Za-z]*/[^/]*/@d'\
77 -e '\@/platforms/@d' \
78 -e '\@/download/@d' \
79 -e '\@/libccmio-.*/@d' \
80 -e '\@/debian/@d'
82 #------------------------------------------------------------------------------