2 #------------------------------------------------------------------------------
4 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
6 # \\ / A nd | Copyright (C) 1991-2009 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 # Constructs all the file list for make given the source file list
31 # (which written by hand or using makeFilesAndDirectories.)
33 #------------------------------------------------------------------------------
35 if [ ! -d "$WM_OPTIONS" ]
37 echo "The $WM_OPTIONS directory does not exist, exiting" 1>&2
41 # change to the $WM_OPTIONS directory
42 cd $WM_OPTIONS 2>/dev
/null ||
{
43 echo "Could not change to directory '$WM_OPTIONS'" 1>&2
47 # Find and keep macro definitions in files list
48 grep "=" files
> filesMacros
50 # Remove all macro definitions from the files list
51 grep -v "=" files
> filesPlusBlank
53 # Add a newline to files to make sure the last line is followed by a newline
54 echo "" >> filesPlusBlank
57 # Remove commented lines blank lines, and trailing blanks from files
58 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
62 filesPlusBlank
> files.$$
69 echo "SOURCE = " > tmpSourceFile
70 cat files.$$
>> tmpSourceFile
74 tmpSourceFile
> sourceFiles
82 -e 's%^%$(OBJECTS_DIR)/%' \
83 -e 's%\.[a-zA-Z]*$%\.o%' \
84 files.$$
> tmpObjectFiles
86 echo "OBJECTS = " > tmpObjectFiles2
87 cat tmpObjectFiles
>> tmpObjectFiles2
91 tmpObjectFiles2
> objectFiles
93 rm tmpObjectFiles tmpObjectFiles2
96 # make localObjectFiles
97 # ~~~~~~~~~~~~~~~~~~~~~
99 -e 's%\.[a-zA-Z]*$%\.o%' \
100 files.$$
> tmpLocalObjectFiles
102 echo "LOCAL_OBJECTS = " > tmpLocalObjectFiles2
103 cat tmpLocalObjectFiles
>> tmpLocalObjectFiles2
107 tmpLocalObjectFiles2
> localObjectFiles
109 rm tmpLocalObjectFiles tmpLocalObjectFiles2
112 # make dependencyFiles
113 # ~~~~~~~~~~~~~~~~~~~~
114 sed 's/\.[a-zA-Z]*$/\.dep/' \
115 files.$$
> tmpDependencyFiles
117 echo "DEPENDENCIES = " > tmpDependencyFiles2
118 cat tmpDependencyFiles
>> tmpDependencyFiles2
122 tmpDependencyFiles2
> dependencyFiles
124 rm tmpDependencyFiles tmpDependencyFiles2
129 sed -e 's/\.[a-zA-Z]*$/.dep/' \
131 files.$$
> includeDeps
137 #------------------------------------------------------------------------------