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 # 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" ]
36 echo "The $WM_OPTIONS directory does not exist, exiting" 1>&2
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
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 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61 filesPlusBlank
> files.$$
68 echo "SOURCE = " > tmpSourceFile
69 cat files.$$
>> tmpSourceFile
73 tmpSourceFile
> sourceFiles
81 -e 's%^%$(OBJECTS_DIR)/%' \
82 -e 's%\.[a-zA-Z]*$%\.o%' \
83 files.$$
> tmpObjectFiles
85 echo "OBJECTS = " > tmpObjectFiles2
86 cat tmpObjectFiles
>> tmpObjectFiles2
90 tmpObjectFiles2
> objectFiles
92 rm tmpObjectFiles tmpObjectFiles2
95 # make localObjectFiles
96 # ~~~~~~~~~~~~~~~~~~~~~
98 -e 's%\.[a-zA-Z]*$%\.o%' \
99 files.$$
> tmpLocalObjectFiles
101 echo "LOCAL_OBJECTS = " > tmpLocalObjectFiles2
102 cat tmpLocalObjectFiles
>> tmpLocalObjectFiles2
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
121 tmpDependencyFiles2
> dependencyFiles
123 rm tmpDependencyFiles tmpDependencyFiles2
128 sed -e 's/\.[a-zA-Z]*$/.dep/' \
130 files.$$
> includeDeps
136 #------------------------------------------------------------------------------