so that it can be included directly into the wmake Makefile to allow full support of gmake syntax, variables, functions etc. The Make/files file handled in the same manner as the Make/options file if it contains the SOURCE entry otherwise it is first processed by cpp for backward compatibility.
76 lines
3.0 KiB
Plaintext
76 lines
3.0 KiB
Plaintext
#----------------------------*- makefile-gmake -*------------------------------
|
|
# ========= |
|
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
# \\ / O peration | Website: https://openfoam.org
|
|
# \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
|
# \\/ M anipulation |
|
|
#------------------------------------------------------------------------------
|
|
# License
|
|
# This file is part of OpenFOAM.
|
|
#
|
|
# OpenFOAM is free software: you can redistribute it and/or modify it
|
|
# under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
# for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
#
|
|
# File
|
|
# wmake/makefiles/files
|
|
#
|
|
# Description
|
|
# A Makefile to process Make/files for gmake
|
|
#
|
|
# If the Make/files file does not contain a SOURCE entry it is parsed by cpp
|
|
# to filter comments, expands macros and variable and the source file list
|
|
# is converted into the SOURCE entry for gmake.
|
|
#------------------------------------------------------------------------------
|
|
|
|
GENERAL_RULES = $(WM_DIR)/rules/General
|
|
include $(GENERAL_RULES)/general
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
# Declare names of make system control files derived from file 'files'
|
|
#------------------------------------------------------------------------------
|
|
|
|
OBJECTS_DIR = $(MAKE_DIR)/$(WM_OPTIONS)
|
|
OPTIONS = $(MAKE_DIR)/options
|
|
FILES = $(OBJECTS_DIR)/files
|
|
|
|
include $(OPTIONS)
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
# Declare dependency of all make system files on FILES
|
|
# Causes all derived files to be remade if any are changed or missing
|
|
#------------------------------------------------------------------------------
|
|
|
|
all : $(FILES)
|
|
|
|
# Create a grep pattern from the source file suffix list
|
|
SUFFIX_PATTERN = \
|
|
$(shell echo $(SUFFIXES) \
|
|
| sed -e "s/\([a-zA-Z]\) \./\1\\\|./g" -e "s/\./\\\./g")
|
|
|
|
$(FILES): $(MAKE_DIR)/files
|
|
@$(CPP) $(GFLAGS) $(MAKE_DIR)/files | sed -e 's@ *@ @g' \
|
|
> $(OBJECTS_DIR)/cppdFiles
|
|
# Use the suffix pattern to find all non source file lines in files
|
|
@grep -v "$(SUFFIX_PATTERN)" $(OBJECTS_DIR)/cppdFiles > $(FILES)
|
|
# Use the suffix pattern to create the SOURCE entry from the source files
|
|
@echo "SOURCE = \\" >> $(FILES)
|
|
@grep "$(SUFFIX_PATTERN)" $(OBJECTS_DIR)/cppdFiles \
|
|
| sed -e 's,$$, \\,' -e '$$s,\\,,' >> $(FILES)
|
|
# Remove the temporary cpp'd files file
|
|
@rm -f $(OBJECTS_DIR)/cppdFiles
|
|
|
|
|
|
#------------------------------------------------------------------------------
|