diff --git a/bin/tools/foamListBinDirs b/bin/tools/foamListBinDirs index 336bd91cdef8abe88f7c0271e92c8bb511a8c069..da2f4d4a374544aa061af01072b3a6bc18bc8d70 100755 --- a/bin/tools/foamListBinDirs +++ b/bin/tools/foamListBinDirs @@ -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 - 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 -} - +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 + } +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 diff --git a/bin/tools/foamListSourceFiles b/bin/tools/foamListSourceFiles index 2deedeac8c267af737f28d8b6790c21e3d3f03a4..ef6c166e4ccf1e369ad5c67aae37d91890bca657 100755 --- a/bin/tools/foamListSourceFiles +++ b/bin/tools/foamListSourceFiles @@ -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' \ diff --git a/bin/tools/foamListThirdPartyBinDirs b/bin/tools/foamListThirdPartyBinDirs index 872049628e203e49bfa23034ab654ddc40e483fa..c97fefede75e2364ab4d7d099f0a1a14c6178b87 100755 --- a/bin/tools/foamListThirdPartyBinDirs +++ b/bin/tools/foamListThirdPartyBinDirs @@ -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 diff --git a/wmake/Makefile b/wmake/Makefile index 72fd3ed087c5582c789520701fd72ab35895f9b8..168710ce196756a73da878c3208cbb78bb181eef 100644 --- a/wmake/Makefile +++ b/wmake/Makefile @@ -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 diff --git a/wmake/makeWmake b/wmake/makeWmake index bd2a7cae1930f6517a895937d193cba93485358a..3185c8090988767129daf24215d625c4b38d0f9a 100755 --- a/wmake/makeWmake +++ b/wmake/makeWmake @@ -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 #------------------------------------------------------------------------------ diff --git a/wmake/rules/General/sourceToDep b/wmake/rules/General/sourceToDep index 14e95d6eb10f76656947ff023fc6b67c13ab585c..329e7f409dc0dd8adcfa63432f7f2c2f1a0d5f98 100644 --- a/wmake/rules/General/sourceToDep +++ b/wmake/rules/General/sourceToDep @@ -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) diff --git a/wmake/scripts/makeFiles b/wmake/scripts/makeFiles index 7e6104a5e746bab17c7bfd81e367f9eb0d0e11f6..0fb1b2c1ee0e807f5e96c7a4870ceca6d8d3d03f 100755 --- a/wmake/scripts/makeFiles +++ b/wmake/scripts/makeFiles @@ -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 diff --git a/wmake/src/Makefile b/wmake/src/Makefile index a8332de09ec0756e2e9bd9b617cf68588d82daed..7c257b24b71ede610c8b6005f9144416743cdcc6 100644 --- a/wmake/src/Makefile +++ b/wmake/src/Makefile @@ -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 #------------------------------------------------------------------------------ diff --git a/wmake/wmake b/wmake/wmake index 54ee5696e85dff8fa814740bb5c9c6c01ea60a9c..37a17eca798a6d927dc668006abf63759ee16bf6 100755 --- a/wmake/wmake +++ b/wmake/wmake @@ -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