Bugfix: set boundary velocity on a moving IB surface
[foam-extend-3.2.git] / wmake / wmakeDerivedFiles
blob427e9fc9877e3c1754a6d96e76807f848040e0e5
1 #!/bin/sh
2 #------------------------------------------------------------------------------
3 # ========= |
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 #------------------------------------------------------------------------------
9 # License
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/>.
25 # Script
26 # wmakeDerivedFiles
28 # Description
29 # Constructs all the file list for make given the source file list
30 # (which written by hand or using makeFilesAndDirectories.)
32 #------------------------------------------------------------------------------
34 if [ ! -d "$WM_OPTIONS" ]
35 then
36 echo "The $WM_OPTIONS directory does not exist, exiting" 1>&2
37 exit 1
40 # change to the $WM_OPTIONS directory
41 cd $WM_OPTIONS 2>/dev/null || {
42 echo "Could not change to directory '$WM_OPTIONS'" 1>&2
43 exit 1
46 # Find and keep macro definitions in files list
47 grep "=" files > filesMacros
49 # Remove all macro definitions from the files list
50 grep -v "=" files > filesPlusBlank
52 # Add a newline to files to make sure the last line is followed by a newline
53 echo "" >> filesPlusBlank
56 # Remove commented lines blank lines, and trailing blanks from files
57 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58 sed -e '/^#/ d' \
59 -e '/^[ \t]*$/ d' \
60 -e 's/[ \t]*$//' \
61 filesPlusBlank > files.$$
63 rm filesPlusBlank
66 # make sourceFiles
67 # ~~~~~~~~~~~~~~~~
68 echo "SOURCE = " > tmpSourceFile
69 cat files.$$ >> tmpSourceFile
71 sed -e 's/$/\\/' \
72 -e '$s/\\//' \
73 tmpSourceFile > sourceFiles
75 rm tmpSourceFile
78 # make objectFiles
79 # ~~~~~~~~~~~~~~~~
80 sed -e 's%.*/%%' \
81 -e 's%^%$(OBJECTS_DIR)/%' \
82 -e 's%\.[a-zA-Z]*$%\.o%' \
83 files.$$ > tmpObjectFiles
85 echo "OBJECTS = " > tmpObjectFiles2
86 cat tmpObjectFiles >> tmpObjectFiles2
88 sed -e 's/$/\\/' \
89 -e '$s/\\//' \
90 tmpObjectFiles2 > objectFiles
92 rm tmpObjectFiles tmpObjectFiles2
95 # make localObjectFiles
96 # ~~~~~~~~~~~~~~~~~~~~~
97 sed -e 's%.*/%%' \
98 -e 's%\.[a-zA-Z]*$%\.o%' \
99 files.$$ > tmpLocalObjectFiles
101 echo "LOCAL_OBJECTS = " > tmpLocalObjectFiles2
102 cat tmpLocalObjectFiles >> tmpLocalObjectFiles2
104 sed -e 's/$/\\/' \
105 -e '$s/\\//' \
106 tmpLocalObjectFiles2 > localObjectFiles
108 rm tmpLocalObjectFiles tmpLocalObjectFiles2
111 # make dependencyFiles
112 # ~~~~~~~~~~~~~~~~~~~~
113 sed 's/\.[a-zA-Z]*$/\.dep/' \
114 files.$$ > tmpDependencyFiles
116 echo "DEPENDENCIES = " > tmpDependencyFiles2
117 cat tmpDependencyFiles >> tmpDependencyFiles2
119 sed -e 's/$/\\/' \
120 -e '$s/\\//' \
121 tmpDependencyFiles2 > dependencyFiles
123 rm tmpDependencyFiles tmpDependencyFiles2
126 # make includeDeps
127 # ~~~~~~~~~~~~~~~~
128 sed -e 's/\.[a-zA-Z]*$/.dep/' \
129 -e 's/^/include /' \
130 files.$$ > includeDeps
132 rm files.$$
134 cd ..
136 #------------------------------------------------------------------------------