mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: use 'platforms/' for organizing wmake binaries as well
- replaces previously used 'bin/' STYLE: add -help to makeWmake
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||
# \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#-------------------------------------------------------------------------------
|
||||
# License
|
||||
@ -23,7 +23,7 @@
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Script
|
||||
# foamListBinDirs <directory> <archOptions>
|
||||
# foamListBinDirs <directory> [archOptions]
|
||||
#
|
||||
# Description
|
||||
# Lists directories containing binary files of OpenFOAM
|
||||
@ -33,9 +33,9 @@
|
||||
#------------------------------------------------------------------------------
|
||||
toolsDir="${0%/*}" # this script is already located in the tools/ directory
|
||||
|
||||
[ $# -eq 2 ] || {
|
||||
[ $# -eq 1 -o $# -eq 2 ] || {
|
||||
cat <<USAGE 1>&2
|
||||
Usage : ${0##*/} <packDir> <archOptions>
|
||||
Usage : ${0##*/} <packDir> [archOptions]
|
||||
|
||||
* Lists directories containing binary files for OpenFOAM
|
||||
|
||||
@ -49,8 +49,13 @@ USAGE
|
||||
#------------------------------------------------------------------------------
|
||||
packDir="$1"
|
||||
|
||||
# same as $WM_OPTIONS - eg, 'linux64GccDPOpt'
|
||||
archOptions="$2"
|
||||
# default to same as $WM_OPTIONS - eg, 'linux64GccDPOpt'
|
||||
archOptions="${2:-$WM_OPTIONS}"
|
||||
|
||||
[ -n "$archOptions" ] || {
|
||||
echo "Error: no archOptions specified" 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# base arch (w/o precision, optimization, etc)
|
||||
# same as "$WM_ARCH$WM_COMPILER"
|
||||
@ -65,42 +70,18 @@ arch3264=$(echo "$archOS" | sed -e 's@64@-64@')
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# check for essential directories
|
||||
[ -d $packDir ] || {
|
||||
echo "Error: directory $packDir does not exist" 1>&2
|
||||
for dir in \
|
||||
$packDir \
|
||||
$packDir/platforms/$archOptions/bin \
|
||||
$packDir/platforms/$archOptions/lib \
|
||||
;
|
||||
do
|
||||
[ -d $dir ] || {
|
||||
echo "Error: directory $dir does not exist" 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# check places for libraries - same as $FOAM_LIBBIN
|
||||
# this has moved around a bit in the recent past
|
||||
#
|
||||
[ -d $packDir/lib/$archOptions ] || \
|
||||
[ -d $packDir/platforms/$archOptions/lib ] || {
|
||||
cat <<LIB_CHECK 1>&2
|
||||
Error: no directory for libraries exists:
|
||||
$packDir/lib/$archOptions
|
||||
$packDir/platforms/$archOptions/lib
|
||||
LIB_CHECK
|
||||
exit 1
|
||||
}
|
||||
|
||||
#
|
||||
# check places for executables - same as $FOAM_APPBIN
|
||||
# this has moved around a bit in the recent past
|
||||
#
|
||||
[ -d $packDir/applications/bin/$archOptions ] || \
|
||||
[ -d $packDir/platforms/$archOptions/bin ] || {
|
||||
cat <<BIN_CHECK 1>&2
|
||||
Error: no directory for executables exists:
|
||||
$packDir/platforms/$archOptions/bin
|
||||
$packDir/applications/bin/$archOptions
|
||||
BIN_CHECK
|
||||
exit 1
|
||||
}
|
||||
|
||||
done
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# list of directories
|
||||
@ -108,13 +89,11 @@ dirList=$(
|
||||
for dir in \
|
||||
$packDir/platforms/$archOptions/bin \
|
||||
$packDir/platforms/$archOptions/lib \
|
||||
$packDir/wmake/bin/$archCompiler \
|
||||
$packDir/wmake/bin/$archOS \
|
||||
$packDir/wmake/platforms/$archCompiler \
|
||||
$packDir/wmake/platforms/$archOS \
|
||||
$packDir/wmake/rules/General \
|
||||
$packDir/wmake/rules/$archCompiler \
|
||||
$packDir/wmake/rules/$archOS \
|
||||
$packDir/applications/bin/$archOptions \
|
||||
$packDir/lib/$archOptions \
|
||||
;
|
||||
do
|
||||
[ -d $dir ] && echo $dir
|
||||
|
||||
@ -46,7 +46,7 @@ USAGE
|
||||
packDir=$(echo "$1" | sed -e 's@//*@/@g' -e 's@/$@@')
|
||||
|
||||
# check for essential directories
|
||||
[ -d $packDir ] || {
|
||||
[ -d "$packDir" ] || {
|
||||
echo "Error: directory $packDir does not exist" 1>&2
|
||||
exit 1
|
||||
}
|
||||
@ -77,12 +77,9 @@ find -H $packDir \
|
||||
-a ! -name "core.[1-9]*" \
|
||||
-a ! -name "libccmio*" \
|
||||
| sed \
|
||||
-e "\@$packDir/lib/@d" \
|
||||
-e '\@/\.git/@d' \
|
||||
-e '\@/\.tags/@d' \
|
||||
-e '\@/README\.org@d' \
|
||||
-e '\@/bin/[^/]*/@{ \@/bin/tools/@!d }' \
|
||||
-e '\@/lib/@d' \
|
||||
-e '\@/platforms/@d' \
|
||||
-e '\@/t/@d' \
|
||||
-e '\@/Make[.A-Za-z]*/[^/]*/@d' \
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Script
|
||||
# foamListThirdPartyBinDirs <directory> <archOptions>
|
||||
# foamListThirdPartyBinDirs <directory> [archOptions]
|
||||
#
|
||||
# Description
|
||||
# Lists directories containing binary files for OpenFOAM ThirdParty
|
||||
@ -33,9 +33,9 @@
|
||||
#------------------------------------------------------------------------------
|
||||
toolsDir="${0%/*}" # this script is already located in the tools/ directory
|
||||
|
||||
[ $# -eq 2 ] || {
|
||||
[ $# -eq 1 -o $# -eq 2 ] || {
|
||||
cat <<USAGE 1>&2
|
||||
Usage : ${0##*/} <packDir> <archOptions>
|
||||
Usage : ${0##*/} <packDir> [archOptions]
|
||||
|
||||
* List directories containing binary files for OpenFOAM ThirdParty
|
||||
|
||||
@ -49,8 +49,13 @@ USAGE
|
||||
#------------------------------------------------------------------------------
|
||||
packDir="$1"
|
||||
|
||||
# same as $WM_OPTIONS - eg, 'linux64GccDPOpt'
|
||||
archOptions="$2"
|
||||
# default to same as $WM_OPTIONS - eg, 'linux64GccDPOpt'
|
||||
archOptions="${2:-$WM_OPTIONS}"
|
||||
|
||||
[ -n "$archOptions" ] || {
|
||||
echo "Error: no archOptions specified" 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# base arch (w/o precision, optimization, etc)
|
||||
# same as "$WM_ARCH$WM_COMPILER"
|
||||
@ -66,7 +71,10 @@ arch3264=$(echo "$archOS" | sed -e 's@64@-64@')
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# check for essential directories
|
||||
for dir in $packDir $packDir/platforms/$archOptions/lib
|
||||
for dir in \
|
||||
$packDir \
|
||||
$packDir/platforms/$archOptions/lib \
|
||||
;
|
||||
do
|
||||
[ -d $dir ] || {
|
||||
echo "Error: directory $dir does not exist" 1>&2
|
||||
|
||||
@ -106,7 +106,7 @@ SEXE = a.out
|
||||
|
||||
GENERAL_RULES = $(WM_DIR)/rules/General
|
||||
RULES = $(WM_DIR)/rules/$(WM_ARCH)$(WM_COMPILER)
|
||||
BIN = $(WM_DIR)/bin/$(WM_ARCH)$(WM_COMPILER)
|
||||
WMAKE_BIN = $(WM_DIR)/platforms/$(WM_ARCH)$(WM_COMPILER)
|
||||
|
||||
include $(GENERAL_RULES)/general
|
||||
include $(RULES)/general
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
||||
# \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
@ -26,13 +26,40 @@
|
||||
# makeWmake
|
||||
#
|
||||
# Description
|
||||
# Script to build all the system-specific parts of wmake
|
||||
# Build platform-specific parts of wmake
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
usage() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
cat<<USAGE
|
||||
usage: ${0##*/}
|
||||
|
||||
# run from this directory only
|
||||
cd ${0%/*} || exit 1
|
||||
Build platform-specific parts of wmake
|
||||
|
||||
( cd src && make $@ )
|
||||
USAGE
|
||||
exit 1
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
-h | -help)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
echo ========================================
|
||||
echo Build platform-specific parts of wmake
|
||||
echo
|
||||
(
|
||||
set -x
|
||||
cd ${0%/*}/src && make $@
|
||||
# or simply: make -C ${0%/*}/src $@
|
||||
)
|
||||
echo
|
||||
echo ========================================
|
||||
echo Done building wmake
|
||||
echo ========================================
|
||||
echo
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
.SUFFIXES: .c .cc .cxx .cpp .C .F .f .dep
|
||||
|
||||
MKDEP = $(BIN)/wmkdep -I$(*D) $(LIB_HEADER_DIRS)
|
||||
MKDEP = $(WMAKE_BIN)/wmkdep -I$(*D) $(LIB_HEADER_DIRS)
|
||||
|
||||
.c.dep:
|
||||
$(MAKE_DEP)
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
||||
# \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
@ -38,7 +38,7 @@ then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dirToString=$WM_DIR/bin/$WM_ARCH$WM_COMPILER/dirToString
|
||||
dirToString=$WM_DIR/platforms/$WM_ARCH$WM_COMPILER/dirToString
|
||||
|
||||
[ -d Make ] || mkdir Make
|
||||
rm -f Make/files
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
||||
# \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
@ -49,7 +49,7 @@ SHELL = /bin/sh
|
||||
|
||||
GENERAL_RULES = $(WM_DIR)/rules/General
|
||||
RULES = $(WM_DIR)/rules/$(WM_ARCH)$(WM_COMPILER)
|
||||
BIN = $(WM_DIR)/bin/$(WM_ARCH)$(WM_COMPILER)
|
||||
WMAKE_BIN = $(WM_DIR)/platforms/$(WM_ARCH)$(WM_COMPILER)
|
||||
|
||||
include $(RULES)/general
|
||||
include $(RULES)/$(WM_LINK_LANGUAGE)
|
||||
@ -59,31 +59,31 @@ include $(RULES)/$(WM_LINK_LANGUAGE)
|
||||
# targets
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
all: $(BIN)/dirToString $(BIN)/wmkdep $(BIN)/wmkdepend
|
||||
all: $(WMAKE_BIN)/dirToString $(WMAKE_BIN)/wmkdep $(WMAKE_BIN)/wmkdepend
|
||||
|
||||
clean:
|
||||
rm -f $(BIN)/dirToString $(BIN)/wmkdep $(BIN)/wmkdepend 2>/dev/null
|
||||
rm -f $(WMAKE_BIN)/* 2>/dev/null
|
||||
|
||||
|
||||
$(BIN)/dirToString: dirToString.c
|
||||
@mkdir -p $(BIN)
|
||||
$(cc) $(cFLAGS) dirToString.c -o $(BIN)/dirToString
|
||||
$(WMAKE_BIN)/dirToString: dirToString.c
|
||||
@mkdir -p $(WMAKE_BIN)
|
||||
$(cc) $(cFLAGS) dirToString.c -o $(WMAKE_BIN)/dirToString
|
||||
|
||||
|
||||
$(BIN)/wmkdep: wmkdep.l
|
||||
@mkdir -p $(BIN)
|
||||
$(WMAKE_BIN)/wmkdep: wmkdep.l
|
||||
@mkdir -p $(WMAKE_BIN)
|
||||
flex wmkdep.l
|
||||
$(cc) $(cFLAGS) lex.yy.c -o $(BIN)/wmkdep
|
||||
$(cc) $(cFLAGS) lex.yy.c -o $(WMAKE_BIN)/wmkdep
|
||||
@rm -f lex.yy.c 2>/dev/null
|
||||
|
||||
|
||||
# for bootstrapping - use generated files directly (instead of from .atg file)
|
||||
$(BIN)/wmkdepend: wmkdepend.cpp \
|
||||
$(WMAKE_BIN)/wmkdepend: wmkdepend.cpp \
|
||||
wmkdependParser.cpp wmkdependScanner.cpp \
|
||||
wmkdependParser.h wmkdependScanner.h
|
||||
@mkdir -p $(BIN)
|
||||
@mkdir -p $(WMAKE_BIN)
|
||||
$(CC) $(c++FLAGS) \
|
||||
wmkdepend.cpp wmkdependParser.cpp wmkdependScanner.cpp \
|
||||
-o $(BIN)/wmkdepend
|
||||
-o $(WMAKE_BIN)/wmkdepend
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
||||
# \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#-------------------------------------------------------------------------------
|
||||
# License
|
||||
@ -32,6 +32,7 @@
|
||||
Script=${0##*/}
|
||||
|
||||
usage() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
cat<<USAGE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user