2 #------------------------------------------------------------------------------
4 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
6 # \\ / A nd | Copyright (C) 1991-2008 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
56 # Search for java files in filesPlusBlank
57 nJava
=`grep "\.java" filesPlusBlank | wc -l`
60 # Remove commented lines blank lines, and trailing blanks from files
61 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
65 filesPlusBlank
> files.$$
72 echo "SOURCE = " > tmpSourceFile
73 cat files.$$
>> tmpSourceFile
77 tmpSourceFile
> sourceFiles
86 sed -e 's%^%$(CLASSES_DIR)/%' \
87 -e 's%\.[a-zA-Z]*$%\.class%' \
88 files.$$
> tmpObjectFiles
91 -e 's%^%$(OBJECTS_DIR)/%' \
92 -e 's%\.[a-zA-Z]*$%\.o%' \
93 files.$$
> tmpObjectFiles
96 echo "OBJECTS = " > tmpObjectFiles2
97 cat tmpObjectFiles
>> tmpObjectFiles2
101 tmpObjectFiles2
> objectFiles
103 rm tmpObjectFiles tmpObjectFiles2
106 # make localObjectFiles
107 # ~~~~~~~~~~~~~~~~~~~~~
109 -e 's%\.[a-zA-Z]*$%\.o%' \
110 files.$$
> tmpLocalObjectFiles
112 echo "LOCAL_OBJECTS = " > tmpLocalObjectFiles2
113 cat tmpLocalObjectFiles
>> tmpLocalObjectFiles2
117 tmpLocalObjectFiles2
> localObjectFiles
119 rm tmpLocalObjectFiles tmpLocalObjectFiles2
122 # make dependencyFiles
123 # ~~~~~~~~~~~~~~~~~~~~
124 sed 's/\.[a-zA-Z]*$/\.dep/' \
125 files.$$
> tmpDependencyFiles
127 echo "DEPENDENCIES = " > tmpDependencyFiles2
128 cat tmpDependencyFiles
>> tmpDependencyFiles2
132 tmpDependencyFiles2
> dependencyFiles
134 rm tmpDependencyFiles tmpDependencyFiles2
139 sed -e 's/\.[a-zA-Z]*$/.dep/' \
141 files.$$
> includeDeps
147 #------------------------------------------------------------------------------