wmake: Removed the cpp processing of the Make/options file
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.
This commit is contained in:
@ -1,2 +0,0 @@
|
||||
/* EXE_INC = */
|
||||
/* EXE_LIBS = */
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
EXE_INC = /*-DFULLDEBUG -O0 -g*/ \
|
||||
|
||||
EXE_LIBS =
|
||||
|
||||
@ -1,7 +1,3 @@
|
||||
/*
|
||||
check for consistent behaviour with non-optimized code
|
||||
*/
|
||||
|
||||
# Check for consistent behaviour with non-optimized code
|
||||
EXE_INC = \
|
||||
-DFULLDEBUG -g -O0
|
||||
|
||||
|
||||
@ -1 +0,0 @@
|
||||
EXE_INC = /* -DFULLDEBUG -g -O0 */
|
||||
|
||||
@ -1,6 +1,3 @@
|
||||
/*
|
||||
check for consistent behaviour with non-optimized code
|
||||
*/
|
||||
|
||||
# Check for consistent behaviour with non-optimized code
|
||||
EXE_INC = \
|
||||
-DFULLDEBUG -g -O0
|
||||
|
||||
@ -1,13 +1,14 @@
|
||||
EXE_INC = \
|
||||
/* -DDEBUG_MERGE */ \
|
||||
/* -DDEBUG_COUPLE */ \
|
||||
/* -DDEBUG_COUPLE_INTERSECTION */ \
|
||||
/* -DDEBUG_RIGHT_HAND_WALK */ \
|
||||
/* -DDEBUG_FACE_ORDERING */ \
|
||||
/* -DDEBUG_COUPLE_PROJECTION */ \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/conversion/lnInclude
|
||||
|
||||
# EXE_INC += -DDEBUG_MERGE
|
||||
# EXE_INC += -DDEBUG_COUPLE
|
||||
# EXE_INC += -DDEBUG_COUPLE_INTERSECTION
|
||||
# EXE_INC += -DDEBUG_RIGHT_HAND_WALK
|
||||
# EXE_INC += -DDEBUG_FACE_ORDERING
|
||||
# EXE_INC += -DDEBUG_COUPLE_PROJECTION
|
||||
|
||||
EXE_LIBS = \
|
||||
-ldynamicMesh \
|
||||
-lconversion
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
EXE_DEBUG = -DFULLDEBUG -g -O0
|
||||
EXE_NDEBUG = -DNDEBUG
|
||||
|
||||
CGAL_EXACT = /*-DCGAL_DONT_USE_LAZY_KERNEL*/
|
||||
CGAL_EXACT =
|
||||
#CGAL_EXACT = -DCGAL_DONT_USE_LAZY_KERNEL
|
||||
CGAL_INEXACT = -DCGAL_INEXACT
|
||||
|
||||
include $(GENERAL_RULES)/CGAL
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
EXE_DEBUG = -DFULLDEBUG -g -O0
|
||||
EXE_NDEBUG = -DNDEBUG
|
||||
|
||||
CGAL_EXACT = /*-DCGAL_DONT_USE_LAZY_KERNEL*/
|
||||
CGAL_EXACT =
|
||||
#CGAL_EXACT = -DCGAL_DONT_USE_LAZY_KERNEL
|
||||
CGAL_INEXACT = -DCGAL_INEXACT
|
||||
|
||||
include $(GENERAL_RULES)/CGAL
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
EXE_DEBUG = -DFULLDEBUG -g -O0
|
||||
EXE_NDEBUG = -DNDEBUG
|
||||
|
||||
CGAL_EXACT = /*-DCGAL_DONT_USE_LAZY_KERNEL*/
|
||||
CGAL_EXACT =
|
||||
#CGAL_EXACT = -DCGAL_DONT_USE_LAZY_KERNEL
|
||||
CGAL_INEXACT = -DCGAL_INEXACT
|
||||
|
||||
include $(GENERAL_RULES)/CGAL
|
||||
|
||||
@ -22,7 +22,7 @@ EXE_INC = \
|
||||
EXE_LIBS = \
|
||||
$(CGAL_LIBS) \
|
||||
-lconformalVoronoiMesh \
|
||||
-ldecompositionMethods /* -L$(FOAM_LIBBIN)/dummy -lscotchDecomp */ \
|
||||
-ldecompositionMethods \
|
||||
-ltriSurface \
|
||||
-lsurfMesh \
|
||||
-lmeshTools \
|
||||
|
||||
@ -5,7 +5,6 @@ include $(GENERAL_RULES)/CGAL
|
||||
EXE_INC = \
|
||||
-DUNIX \
|
||||
-Wno-old-style-cast \
|
||||
/* -IMarchingCubes */ \
|
||||
-I$(FASTDUALOCTREE_SRC_PATH) \
|
||||
-I../conformalVoronoiMesh/lnInclude \
|
||||
-I$(LIB_SRC)/mesh/snappyHexMesh/lnInclude \
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
EXE_INC = \
|
||||
/* -g -DFULLDEBUG -O0 */ \
|
||||
-I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \
|
||||
-I$(LIB_SRC)/mesh/snappyHexMesh/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
|
||||
@ -1 +0,0 @@
|
||||
/* */
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
EXE_INC = \
|
||||
/* -DFULLDEBUG -g -O0 */ \
|
||||
${COMPILE_FLAGS} \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
/* -DDEBUG_ZIPUP */ \
|
||||
/* -DDEBUG_CHAIN */ \
|
||||
/* -DDEBUG_ORDER */
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
#EXE_INC += -DDEBUG_ZIPUP
|
||||
#EXE_INC += -DDEBUG_CHAIN
|
||||
#EXE_INC += -DDEBUG_ORDER
|
||||
|
||||
EXE_LIBS = \
|
||||
-lmeshTools
|
||||
|
||||
@ -1,2 +0,0 @@
|
||||
/* EXE_INC = */
|
||||
/* EXE_LIBS = */
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* Note: enable vtkPolyhedron when available */
|
||||
# Note: enable vtkPolyhedron when available
|
||||
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
/* Needs ParMGridGen environment variable set. (see Allwmake script) */
|
||||
# Needs ParMGridGen environment variable set. (see Allwmake script)
|
||||
|
||||
TYPE_REAL=
|
||||
#if defined(WM_SP)
|
||||
TYPE_REAL=-DTYPE_REAL
|
||||
#endif
|
||||
TYPE_REAL =
|
||||
ifndef $(WM_SP)
|
||||
TYPE_REAL = -DTYPE_REAL
|
||||
endif
|
||||
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
|
||||
@ -14,4 +14,3 @@ LIB_LIBS = \
|
||||
-ldynamicFvMesh \
|
||||
-lfiniteVolume \
|
||||
-lfileFormats
|
||||
/*-lforces include in controlDict if needed */
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
EXE_INC = \
|
||||
/* -DFULLDEBUG -g -O0 */ \
|
||||
-I$(METIS_ARCH_PATH)/include \
|
||||
-I../decompositionMethods/lnInclude
|
||||
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
/*
|
||||
* Note including of mplib compilation rules.
|
||||
* This is purely to avoid scotch.h including mpicxx.h, which causes problems.
|
||||
*/
|
||||
# Note including of mplib compilation rules.
|
||||
# This is purely to avoid scotch.h including mpicxx.h, which causes problems.
|
||||
|
||||
-include $(GENERAL_RULES)/mplibType
|
||||
|
||||
EXE_INC = \
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
-include $(GENERAL_RULES)/mplibType
|
||||
|
||||
EXE_INC = \
|
||||
/* -DFULLDEBUG -g -O0 */ \
|
||||
$(PFLAGS) $(PINC) \
|
||||
-I$(FOAM_SRC)/Pstream/mpi/lnInclude \
|
||||
-I$(FOAM_SRC)/renumber/renumberMethods/lnInclude \
|
||||
@ -9,5 +8,4 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
/* -L$(ZOLTAN_ARCH_PATH)/lib -lzoltan */ \
|
||||
-lmeshTools
|
||||
|
||||
@ -25,8 +25,11 @@
|
||||
# wmake/makefiles/files
|
||||
#
|
||||
# Description
|
||||
# A Makefile for the 'options' and 'files' files, used by wmake
|
||||
# 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
|
||||
@ -38,10 +41,10 @@ include $(GENERAL_RULES)/general
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
OBJECTS_DIR = $(MAKE_DIR)/$(WM_OPTIONS)
|
||||
OPTIONS = $(OBJECTS_DIR)/options
|
||||
OPTIONS = $(MAKE_DIR)/options
|
||||
FILES = $(OBJECTS_DIR)/files
|
||||
|
||||
-include $(OPTIONS)
|
||||
include $(OPTIONS)
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -49,32 +52,24 @@ FILES = $(OBJECTS_DIR)/files
|
||||
# Causes all derived files to be remade if any are changed or missing
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
all : $(OPTIONS) $(FILES)
|
||||
all : $(FILES)
|
||||
|
||||
$(OPTIONS) : $(MAKE_DIR)/options
|
||||
@$(CPP) $(GFLAGS) $(MAKE_DIR)/options | sed -e 's@ *@ @g' > $(OPTIONS)
|
||||
# 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")
|
||||
|
||||
ifeq ($(shell grep "SOURCE" $(MAKE_DIR)/files),)
|
||||
# List of source files format supporting cpp conditionals
|
||||
$(FILES): $(MAKE_DIR)/files
|
||||
@$(CPP) $(GFLAGS) $(MAKE_DIR)/files | sed -e 's@ *@ @g' \
|
||||
> $(OBJECTS_DIR)/cppdFiles
|
||||
# Create a grep pattern from the source file suffix list
|
||||
@echo $(SUFFIXES) | sed -e "s/\([a-zA-Z]\) \./\1\\\|./g" -e "s/\./\\\./g" \
|
||||
> $(OBJECTS_DIR)/suffixPattern
|
||||
# Use the suffix pattern to find all non source file lines in files
|
||||
@grep -v -f $(OBJECTS_DIR)/suffixPattern $(OBJECTS_DIR)/cppdFiles > $(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 -f $(OBJECTS_DIR)/suffixPattern $(OBJECTS_DIR)/cppdFiles \
|
||||
@grep "$(SUFFIX_PATTERN)" $(OBJECTS_DIR)/cppdFiles \
|
||||
| sed -e 's,$$, \\,' -e '$$s,\\,,' >> $(FILES)
|
||||
# Remove the temporary cpp'd files file
|
||||
@rm -f $(OBJECTS_DIR)/cppdFiles
|
||||
else
|
||||
# SOURCE declaration format supporting gmake conditionals
|
||||
$(FILES): $(MAKE_DIR)/files
|
||||
@$(CPP) $(GFLAGS) $(MAKE_DIR)/files | sed -e 's@ *@ @g' > $(FILES)
|
||||
endif
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -57,8 +57,8 @@ WM_SCRIPTS = $(WM_DIR)/scripts
|
||||
LIB_SRC = $(WM_PROJECT_DIR)/src
|
||||
LIB_PLATFORMS = $(WM_PROJECT_DIR)/platforms/$(WM_OPTIONS)/lib
|
||||
OBJECTS_DIR = $(MAKE_DIR)/$(WM_OPTIONS)
|
||||
OPTIONS = $(OBJECTS_DIR)/options
|
||||
FILES = $(OBJECTS_DIR)/files
|
||||
OPTIONS = $(MAKE_DIR)/options
|
||||
FILES = $(MAKE_DIR)/files
|
||||
|
||||
SYS_INC =
|
||||
SYS_LIBS =
|
||||
@ -73,6 +73,12 @@ EXE_LIBS =
|
||||
|
||||
LIB_LIBS =
|
||||
|
||||
# For backward compatibility set FILES to $(OBJECTS_DIR)/files if it has been
|
||||
# created from $(MAKE_DIR)/files that does not contain the SOURCE entry
|
||||
ifneq ("$(wildcard $(OBJECTS_DIR)/files)","")
|
||||
FILES = $(OBJECTS_DIR)/files
|
||||
endif
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Declare default name of libraries and executables
|
||||
@ -195,15 +201,15 @@ $(LIB).o: $(OBJECTS)
|
||||
# Set rule to create the include directory for libraries
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
lnInclude: $(MAKE_DIR)/files $(MAKE_DIR)/options
|
||||
lnInclude: $(MAKE_DIR)/files $(OPTIONS)
|
||||
@rm -rf lnInclude ; wmakeLnInclude .
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Declare all object files depend on $(OBJECTS_DIR)/options
|
||||
# Declare all object files depend on $(OPTIONS)
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
$(OBJECTS): $(OBJECTS_DIR)/options
|
||||
$(OBJECTS): $(OPTIONS)
|
||||
$(foreach S,$(SOURCE),$(eval $(OBJECTS_DIR)/$(basename $S).o : $(OBJECTS_DIR)/$S.dep))
|
||||
|
||||
|
||||
|
||||
41
wmake/wmake
41
wmake/wmake
@ -390,8 +390,7 @@ fi
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Spawn a sub-shell and unset MAKEFLAGS in that sub-shell to avoid
|
||||
# files and options being built in parallel
|
||||
# Created the objectsDir directory
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
objectsDir=$MakeDir/$WM_OPTIONS
|
||||
@ -402,29 +401,31 @@ then
|
||||
objectsDir=$platformPath${exPath//$WM_PROJECT_DIR/}
|
||||
fi
|
||||
|
||||
(
|
||||
unset MAKEFLAGS
|
||||
mkdir -p "$objectsDir"
|
||||
|
||||
# Pre-build the $WM_OPTIONS/options file
|
||||
# which is included when building the $WM_OPTIONS/files file
|
||||
$make -s -f "$WM_DIR/makefiles/files" MAKE_DIR="$MakeDir" \
|
||||
OBJECTS_DIR="$objectsDir" "$objectsDir/options"
|
||||
|
||||
$make -s -f "$WM_DIR/makefiles/files" MAKE_DIR="$MakeDir" \
|
||||
OBJECTS_DIR="$objectsDir"
|
||||
)
|
||||
mkdir -p "$objectsDir"
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Check the $objectsDir/files file was created successfully
|
||||
# Create $objectsDir/files from $MakeDir/files if necessary
|
||||
#
|
||||
# Spawn a sub-shell and unset MAKEFLAGS in that sub-shell to avoid
|
||||
# $objectsDir/files being built in parallel
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
[ -r "$objectsDir/files" ] || {
|
||||
echo "$Script error: file '$objectsDir/files'" \
|
||||
"could not be created in $PWD" 1>&2
|
||||
exit 1
|
||||
}
|
||||
if ! grep -q "SOURCE" "$MakeDir/files"; then
|
||||
(
|
||||
unset MAKEFLAGS
|
||||
|
||||
$make -s -f "$WM_DIR/makefiles/files" MAKE_DIR="$MakeDir" \
|
||||
OBJECTS_DIR="$objectsDir"
|
||||
)
|
||||
|
||||
# Check the $objectsDir/files file was created successfully
|
||||
[ -r "$objectsDir/files" ] || {
|
||||
echo "$Script error: file '$objectsDir/files'" \
|
||||
"could not be created in $PWD" 1>&2
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user