STYLE: use 'platforms/' for organizing wmake binaries as well

- replaces previously used 'bin/'

STYLE: add -help to makeWmake
This commit is contained in:
Mark Olesen
2011-02-15 19:01:04 +01:00
parent 5152c4961d
commit fc2bd19356
9 changed files with 90 additions and 78 deletions

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -23,7 +23,7 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. # along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
# #
# Script # Script
# foamListBinDirs <directory> <archOptions> # foamListBinDirs <directory> [archOptions]
# #
# Description # Description
# Lists directories containing binary files of OpenFOAM # Lists directories containing binary files of OpenFOAM
@ -33,9 +33,9 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
toolsDir="${0%/*}" # this script is already located in the tools/ directory toolsDir="${0%/*}" # this script is already located in the tools/ directory
[ $# -eq 2 ] || { [ $# -eq 1 -o $# -eq 2 ] || {
cat <<USAGE 1>&2 cat <<USAGE 1>&2
Usage : ${0##*/} <packDir> <archOptions> Usage : ${0##*/} <packDir> [archOptions]
* Lists directories containing binary files for OpenFOAM * Lists directories containing binary files for OpenFOAM
@ -49,8 +49,13 @@ USAGE
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
packDir="$1" packDir="$1"
# same as $WM_OPTIONS - eg, 'linux64GccDPOpt' # default to same as $WM_OPTIONS - eg, 'linux64GccDPOpt'
archOptions="$2" archOptions="${2:-$WM_OPTIONS}"
[ -n "$archOptions" ] || {
echo "Error: no archOptions specified" 1>&2
exit 1
}
# base arch (w/o precision, optimization, etc) # base arch (w/o precision, optimization, etc)
# same as "$WM_ARCH$WM_COMPILER" # same as "$WM_ARCH$WM_COMPILER"
@ -65,42 +70,18 @@ arch3264=$(echo "$archOS" | sed -e 's@64@-64@')
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# check for essential directories # check for essential directories
[ -d $packDir ] || { for dir in \
echo "Error: directory $packDir does not exist" 1>&2 $packDir \
exit 1 $packDir/platforms/$archOptions/bin \
} $packDir/platforms/$archOptions/lib \
;
do
# [ -d $dir ] || {
# check places for libraries - same as $FOAM_LIBBIN echo "Error: directory $dir does not exist" 1>&2
# this has moved around a bit in the recent past exit 1
# }
[ -d $packDir/lib/$archOptions ] || \ done
[ -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
}
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# list of directories # list of directories
@ -108,13 +89,11 @@ dirList=$(
for dir in \ for dir in \
$packDir/platforms/$archOptions/bin \ $packDir/platforms/$archOptions/bin \
$packDir/platforms/$archOptions/lib \ $packDir/platforms/$archOptions/lib \
$packDir/wmake/bin/$archCompiler \ $packDir/wmake/platforms/$archCompiler \
$packDir/wmake/bin/$archOS \ $packDir/wmake/platforms/$archOS \
$packDir/wmake/rules/General \ $packDir/wmake/rules/General \
$packDir/wmake/rules/$archCompiler \ $packDir/wmake/rules/$archCompiler \
$packDir/wmake/rules/$archOS \ $packDir/wmake/rules/$archOS \
$packDir/applications/bin/$archOptions \
$packDir/lib/$archOptions \
; ;
do do
[ -d $dir ] && echo $dir [ -d $dir ] && echo $dir

View File

@ -46,7 +46,7 @@ USAGE
packDir=$(echo "$1" | sed -e 's@//*@/@g' -e 's@/$@@') packDir=$(echo "$1" | sed -e 's@//*@/@g' -e 's@/$@@')
# check for essential directories # check for essential directories
[ -d $packDir ] || { [ -d "$packDir" ] || {
echo "Error: directory $packDir does not exist" 1>&2 echo "Error: directory $packDir does not exist" 1>&2
exit 1 exit 1
} }
@ -77,12 +77,9 @@ find -H $packDir \
-a ! -name "core.[1-9]*" \ -a ! -name "core.[1-9]*" \
-a ! -name "libccmio*" \ -a ! -name "libccmio*" \
| sed \ | sed \
-e "\@$packDir/lib/@d" \
-e '\@/\.git/@d' \ -e '\@/\.git/@d' \
-e '\@/\.tags/@d' \ -e '\@/\.tags/@d' \
-e '\@/README\.org@d' \ -e '\@/README\.org@d' \
-e '\@/bin/[^/]*/@{ \@/bin/tools/@!d }' \
-e '\@/lib/@d' \
-e '\@/platforms/@d' \ -e '\@/platforms/@d' \
-e '\@/t/@d' \ -e '\@/t/@d' \
-e '\@/Make[.A-Za-z]*/[^/]*/@d' \ -e '\@/Make[.A-Za-z]*/[^/]*/@d' \

View File

@ -23,7 +23,7 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. # along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
# #
# Script # Script
# foamListThirdPartyBinDirs <directory> <archOptions> # foamListThirdPartyBinDirs <directory> [archOptions]
# #
# Description # Description
# Lists directories containing binary files for OpenFOAM ThirdParty # Lists directories containing binary files for OpenFOAM ThirdParty
@ -33,9 +33,9 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
toolsDir="${0%/*}" # this script is already located in the tools/ directory toolsDir="${0%/*}" # this script is already located in the tools/ directory
[ $# -eq 2 ] || { [ $# -eq 1 -o $# -eq 2 ] || {
cat <<USAGE 1>&2 cat <<USAGE 1>&2
Usage : ${0##*/} <packDir> <archOptions> Usage : ${0##*/} <packDir> [archOptions]
* List directories containing binary files for OpenFOAM ThirdParty * List directories containing binary files for OpenFOAM ThirdParty
@ -49,8 +49,13 @@ USAGE
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
packDir="$1" packDir="$1"
# same as $WM_OPTIONS - eg, 'linux64GccDPOpt' # default to same as $WM_OPTIONS - eg, 'linux64GccDPOpt'
archOptions="$2" archOptions="${2:-$WM_OPTIONS}"
[ -n "$archOptions" ] || {
echo "Error: no archOptions specified" 1>&2
exit 1
}
# base arch (w/o precision, optimization, etc) # base arch (w/o precision, optimization, etc)
# same as "$WM_ARCH$WM_COMPILER" # same as "$WM_ARCH$WM_COMPILER"
@ -66,7 +71,10 @@ arch3264=$(echo "$archOS" | sed -e 's@64@-64@')
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# check for essential directories # check for essential directories
for dir in $packDir $packDir/platforms/$archOptions/lib for dir in \
$packDir \
$packDir/platforms/$archOptions/lib \
;
do do
[ -d $dir ] || { [ -d $dir ] || {
echo "Error: directory $dir does not exist" 1>&2 echo "Error: directory $dir does not exist" 1>&2

View File

@ -106,7 +106,7 @@ SEXE = a.out
GENERAL_RULES = $(WM_DIR)/rules/General GENERAL_RULES = $(WM_DIR)/rules/General
RULES = $(WM_DIR)/rules/$(WM_ARCH)$(WM_COMPILER) 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 $(GENERAL_RULES)/general
include $(RULES)/general include $(RULES)/general

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
@ -26,13 +26,40 @@
# makeWmake # makeWmake
# #
# Description # 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 Build platform-specific parts of wmake
cd ${0%/*} || exit 1
( 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
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -1,6 +1,6 @@
.SUFFIXES: .c .cc .cxx .cpp .C .F .f .dep .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: .c.dep:
$(MAKE_DEP) $(MAKE_DEP)

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
@ -38,7 +38,7 @@ then
exit 1 exit 1
fi fi
dirToString=$WM_DIR/bin/$WM_ARCH$WM_COMPILER/dirToString dirToString=$WM_DIR/platforms/$WM_ARCH$WM_COMPILER/dirToString
[ -d Make ] || mkdir Make [ -d Make ] || mkdir Make
rm -f Make/files rm -f Make/files

View File

@ -2,7 +2,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
@ -49,7 +49,7 @@ SHELL = /bin/sh
GENERAL_RULES = $(WM_DIR)/rules/General GENERAL_RULES = $(WM_DIR)/rules/General
RULES = $(WM_DIR)/rules/$(WM_ARCH)$(WM_COMPILER) 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)/general
include $(RULES)/$(WM_LINK_LANGUAGE) include $(RULES)/$(WM_LINK_LANGUAGE)
@ -59,31 +59,31 @@ include $(RULES)/$(WM_LINK_LANGUAGE)
# targets # targets
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
all: $(BIN)/dirToString $(BIN)/wmkdep $(BIN)/wmkdepend all: $(WMAKE_BIN)/dirToString $(WMAKE_BIN)/wmkdep $(WMAKE_BIN)/wmkdepend
clean: clean:
rm -f $(BIN)/dirToString $(BIN)/wmkdep $(BIN)/wmkdepend 2>/dev/null rm -f $(WMAKE_BIN)/* 2>/dev/null
$(BIN)/dirToString: dirToString.c $(WMAKE_BIN)/dirToString: dirToString.c
@mkdir -p $(BIN) @mkdir -p $(WMAKE_BIN)
$(cc) $(cFLAGS) dirToString.c -o $(BIN)/dirToString $(cc) $(cFLAGS) dirToString.c -o $(WMAKE_BIN)/dirToString
$(BIN)/wmkdep: wmkdep.l $(WMAKE_BIN)/wmkdep: wmkdep.l
@mkdir -p $(BIN) @mkdir -p $(WMAKE_BIN)
flex wmkdep.l 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 @rm -f lex.yy.c 2>/dev/null
# for bootstrapping - use generated files directly (instead of from .atg file) # 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.cpp wmkdependScanner.cpp \
wmkdependParser.h wmkdependScanner.h wmkdependParser.h wmkdependScanner.h
@mkdir -p $(BIN) @mkdir -p $(WMAKE_BIN)
$(CC) $(c++FLAGS) \ $(CC) $(c++FLAGS) \
wmkdepend.cpp wmkdependParser.cpp wmkdependScanner.cpp \ wmkdepend.cpp wmkdependParser.cpp wmkdependScanner.cpp \
-o $(BIN)/wmkdepend -o $(WMAKE_BIN)/wmkdepend
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -32,6 +32,7 @@
Script=${0##*/} Script=${0##*/}
usage() { usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE cat<<USAGE