2 #---------------------------------*- sh -*-------------------------------------
4 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
6 # \\ / A nd | Copyright (C) 1991-2010 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
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
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/>.
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 #------------------------------------------------------------------------------