diff --git a/wmake/Makefile b/wmake/Makefile index 6b4fd0abe6..b58d8b0858 100644 --- a/wmake/Makefile +++ b/wmake/Makefile @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -31,7 +31,7 @@ #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ -# The Makefile use a POSIX shell +# The Makefile uses a POSIX shell #------------------------------------------------------------------------------ SHELL = /bin/sh @@ -120,7 +120,7 @@ MAKE_DEP = @$(MKDEP) $< | $(WM_SCRIPTS)/addCompile $< #------------------------------------------------------------------------------ # Include PROJECT directory tree file and # source, object and dependency list files. -# These are constructed by wmakeDerivedFiles +# These are constructed by scripts/makeDerivedFiles #------------------------------------------------------------------------------ include $(OBJECTS_DIR)/options @@ -148,7 +148,7 @@ LIB_HEADER_DIRS = \ #------------------------------------------------------------------------------ $(EXE): $(OBJECTS) - @$(WM_SCRIPTS)/mkObjectDir $(EXE) + @$(WM_SCRIPTS)/makeTargetDir $(EXE) $(LINKEXE) $(OBJECTS) -L$(LIB_WM_OPTIONS_DIR) \ $(EXE_LIBS) $(PROJECT_LIBS) $(SYS_LIBS) $(LINK_LIBS) $(GLIBS) -o $(EXE) @@ -156,7 +156,7 @@ exe: $(SEXE) @echo \'$(SEXE)\' is up to date. $(SEXE): $(OBJECTS) - @$(WM_SCRIPTS)/mkObjectDir $(SEXE) + @$(WM_SCRIPTS)/makeTargetDir $(SEXE) $(LINKEXE) $(OBJECTS) $(EXE_LIBS) \ $(SYS_LIBS) $(LINK_LIBS) $(GLIBS) -o $(SEXE) @@ -169,7 +169,7 @@ libso: $(LIB).$(SO) @echo \'$(LIB).$(SO)\' is up to date. $(LIB).$(SO): $(OBJECTS) - @$(WM_SCRIPTS)/mkObjectDir $(LIB) + @$(WM_SCRIPTS)/makeTargetDir $(LIB) @rm -f so_locations @cd $(OBJECTS_DIR) ; \ $(LINKLIBSO) $(LOCAL_OBJECTS) -L$(LIB_WM_OPTIONS_DIR) $(LIB_LIBS) $(GLIB_LIBS) -o $(LIB).$(SO) @@ -178,7 +178,7 @@ lib: $(LIB).a @echo \'$(LIB).a\' is up to date. $(LIB).a: $(OBJECTS) - @$(WM_SCRIPTS)/mkObjectDir $(LIB) + @$(WM_SCRIPTS)/makeTargetDir $(LIB) @rm -f $(LIB).a $(AR) $(ARFLAGS) $(LIB).a $(OBJECTS) $(RANLIB) $(LIB).a @@ -187,7 +187,7 @@ libo: $(LIB).o @echo \'$(LIB).o\' is up to date. $(LIB).o: $(OBJECTS) - @$(WM_SCRIPTS)/mkObjectDir $(LIB) + @$(WM_SCRIPTS)/makeTargetDir $(LIB) @rm -f $(LIB).o $(LD) -r -o $(LIB).o $(OBJECTS) @@ -195,7 +195,7 @@ jar: $(LIB).jar @echo \'$(LIB).jar\' is up to date. $(LIB).jar: $(OBJECTS) - @$(WM_SCRIPTS)/mkObjectDir $(LIB) + @$(WM_SCRIPTS)/makeTargetDir $(LIB) jar cfm $(LIB).jar $(LIB_LIBS) -C $(CLASSES_DIR) . #------------------------------------------------------------------------------ diff --git a/wmake/MakefileApps b/wmake/MakefileApps index 55efa80ff8..41a74a3085 100644 --- a/wmake/MakefileApps +++ b/wmake/MakefileApps @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License diff --git a/wmake/MakefileFiles b/wmake/MakefileFiles index d927682d9b..0ad78c6198 100644 --- a/wmake/MakefileFiles +++ b/wmake/MakefileFiles @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -32,6 +32,7 @@ GENERAL_RULES = $(WM_DIR)/rules/General RULES = $(WM_DIR)/rules/$(WM_ARCH)$(WM_COMPILER) +WM_SCRIPTS = $(WM_DIR)/scripts OBJECTS_DIR = $(WM_OPTIONS) FFLAGS = @@ -61,16 +62,16 @@ $(FILES) : files @$(CPP) $(GFLAGS) $(FFLAGS) files > $(FILES) $(SFILES): files - @wmakeDerivedFiles + @$(WM_SCRIPTS)/makeDerivedFiles $(OFILES): files - @wmakeDerivedFiles + @$(WM_SCRIPTS)/makeDerivedFiles $(DFILES): files - @wmakeDerivedFiles + @$(WM_SCRIPTS)/makeDerivedFiles $(IFILES): files - @wmakeDerivedFiles + @$(WM_SCRIPTS)/makeDerivedFiles #------------------------------------------------------------------------------ diff --git a/wmake/MakefileOptions b/wmake/MakefileOptions index 3e7779ff52..98746d34c6 100644 --- a/wmake/MakefileOptions +++ b/wmake/MakefileOptions @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -32,6 +32,7 @@ GENERAL_RULES = $(WM_DIR)/rules/General RULES = $(WM_DIR)/rules/$(WM_ARCH)$(WM_COMPILER) +WM_SCRIPTS = $(WM_DIR)/scripts include $(GENERAL_RULES)/general include $(RULES)/general @@ -47,8 +48,8 @@ OPTIONS = $(WM_OPTIONS)/options # Causes all derived files to be remade if any are changed or missing #------------------------------------------------------------------------------ -$(OPTIONS) : options - @wmkdir $(WM_OPTIONS) ; $(CPP) $(GFLAGS) options > $(OPTIONS) +$(OPTIONS) : options + @$(WM_SCRIPTS)/makeDir $(WM_OPTIONS) ; $(CPP) $(GFLAGS) options > $(OPTIONS) #------------------------------------------------------------------------------ diff --git a/wmake/makeWmake b/wmake/makeWmake index 21386f41be..ee44234372 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) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License diff --git a/wmake/scripts/addCompile b/wmake/scripts/addCompile index 1e75e7eae1..cac0070a81 100755 --- a/wmake/scripts/addCompile +++ b/wmake/scripts/addCompile @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License diff --git a/wmake/wmakeDerivedFiles b/wmake/scripts/makeDerivedFiles similarity index 83% rename from wmake/wmakeDerivedFiles rename to wmake/scripts/makeDerivedFiles index fe6d53e08c..96377d6832 100755 --- a/wmake/wmakeDerivedFiles +++ b/wmake/scripts/makeDerivedFiles @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -24,22 +24,21 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # Script -# wmakeDerivedFiles +# makeDerivedFiles # # Description -# Constructs all the file list for make given the source file list -# (which written by hand or using makeFilesAndDirectories.) +# Constructs all the file list for make given the source file list, +# written was by hand or using makeFilesAndOptions. # #------------------------------------------------------------------------------ -if [ ! -d "$WM_OPTIONS" ] -then - echo "The $WM_OPTIONS directory does not exist, exiting" 1>&2 +[ -d "$WM_OPTIONS" ] || { + echo "The '$WM_OPTIONS' directory does not exist, exiting" 1>&2 exit 1 -fi +} # change to the $WM_OPTIONS directory -cd $WM_OPTIONS 2>/dev/null || { +cd "$WM_OPTIONS" 2>/dev/null || { echo "Could not change to directory '$WM_OPTIONS'" 1>&2 exit 1 } @@ -50,15 +49,15 @@ grep "=" files > filesMacros # Remove all macro definitions from the files list grep -v "=" files > filesPlusBlank -# Add a newline to files to make sure the last line is followed by a newline +# Add a newline to files to ensure the last line is followed by a newline echo "" >> filesPlusBlank -# Remove commented lines blank lines, and trailing blanks from files -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -sed -e '/^#/ d' \ - -e '/^[ \t]*$/ d' \ - -e 's/[ \t]*$//' \ +# Remove commented lines, blank lines, and trailing blanks from files +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +sed -e '/^#/ d' \ + -e '/^[ \t]*$/ d' \ + -e 's/[ \t]*$//' \ filesPlusBlank > files.$$ rm filesPlusBlank @@ -80,7 +79,7 @@ rm tmpSourceFile # ~~~~~~~~~~~~~~~~ sed -e 's%.*/%%' \ -e 's%^%$(OBJECTS_DIR)/%' \ - -e 's%\.[a-zA-Z]*$%\.o%' \ + -e 's%\.[a-zA-Z]*$%\.o%' \ files.$$ > tmpObjectFiles echo "OBJECTS = " > tmpObjectFiles2 @@ -96,7 +95,7 @@ rm tmpObjectFiles tmpObjectFiles2 # make localObjectFiles # ~~~~~~~~~~~~~~~~~~~~~ sed -e 's%.*/%%' \ - -e 's%\.[a-zA-Z]*$%\.o%' \ + -e 's%\.[a-zA-Z]*$%\.o%' \ files.$$ > tmpLocalObjectFiles echo "LOCAL_OBJECTS = " > tmpLocalObjectFiles2 @@ -132,6 +131,4 @@ sed -e 's/\.[a-zA-Z]*$/.dep/' \ rm files.$$ -cd .. - #------------------------------------------------------------------------------ diff --git a/wmake/wmkdir b/wmake/scripts/makeDir similarity index 75% rename from wmake/wmkdir rename to wmake/scripts/makeDir index e9703d2733..365dda9fd8 100755 --- a/wmake/wmkdir +++ b/wmake/scripts/makeDir @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -24,28 +24,18 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # Script -# wmkdir +# makeDir # # Description # Script to make directories that do not already exist -# Usage : wmkdir [.. ] +# Usage : makeDir [.. ] # #------------------------------------------------------------------------------ -if [ $# -ge 1 ] -then - # provide help - if [ "$1" = "-h" -o "$1" = "-help" ] - then - echo "usage: ${0##*/} [.. ]" - echo " mkdir if directories do not already exist" - echo - else - for dir - do - [ -d "$dir" ] || mkdir -p "$dir" - done - fi -fi +for dir +do + [ -d "$dir" ] || mkdir -p "$dir" +done + #------------------------------------------------------------------------------ diff --git a/wmake/scripts/makeFiles b/wmake/scripts/makeFiles index c36f153b3c..8416970039 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) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License diff --git a/wmake/scripts/makeOptions b/wmake/scripts/makeOptions index 47c9f0c271..609a447ba0 100755 --- a/wmake/scripts/makeOptions +++ b/wmake/scripts/makeOptions @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License diff --git a/wmake/scripts/mkObjectDir b/wmake/scripts/makeTargetDir similarity index 82% rename from wmake/scripts/mkObjectDir rename to wmake/scripts/makeTargetDir index 3008303ae3..b4d1e01385 100755 --- a/wmake/scripts/mkObjectDir +++ b/wmake/scripts/makeTargetDir @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -24,21 +24,19 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # Script -# mkObjectDir +# makeTargetDir # # Description -# Makes a directory hierarchy for the given object file +# Makes a directory hierarchy for the given target file # -# Usage: mkObjectDir +# Usage: makeTargetDir # #------------------------------------------------------------------------------ -if [ $# -eq 1 ] -then - if [ ! -d ${1%/*} -a $1 != ${1%/*} ] - then - mkdir -p ${1%/*} - fi -fi +for target +do + dir=${target%/*} + [ -d "$dir" ] || [ "$dir" = "$target" ] || mkdir -p "$dir" +done #------------------------------------------------------------------------------ diff --git a/wmake/src/dirToString.c b/wmake/src/dirToString.c index b5fb428b0e..26d2876c31 100644 --- a/wmake/src/dirToString.c +++ b/wmake/src/dirToString.c @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/wmake/wcleanLnIncludeAll b/wmake/wcleanLnIncludeAll index 0ca7561c6a..6756391a47 100755 --- a/wmake/wcleanLnIncludeAll +++ b/wmake/wcleanLnIncludeAll @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License diff --git a/wmake/wcleanMachine b/wmake/wcleanMachine index 0af523c186..6ffb0c2f2a 100755 --- a/wmake/wcleanMachine +++ b/wmake/wcleanMachine @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License diff --git a/wmake/wmakeCheckPwd b/wmake/wmakeCheckPwd index 48266543fa..4a26185fdd 100755 --- a/wmake/wmakeCheckPwd +++ b/wmake/wmakeCheckPwd @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License diff --git a/wmake/wmakeFilesAndOptions b/wmake/wmakeFilesAndOptions index d9fdca1854..fe5472c55d 100755 --- a/wmake/wmakeFilesAndOptions +++ b/wmake/wmakeFilesAndOptions @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License diff --git a/wmake/wmakeLnIncludeAll b/wmake/wmakeLnIncludeAll index 07d7df7c59..84f2922115 100755 --- a/wmake/wmakeLnIncludeAll +++ b/wmake/wmakeLnIncludeAll @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License diff --git a/wmake/wmakePrintBuild b/wmake/wmakePrintBuild index da3c8d4086..4538445418 100755 --- a/wmake/wmakePrintBuild +++ b/wmake/wmakePrintBuild @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License diff --git a/wmake/wmakeScheduler b/wmake/wmakeScheduler index 5d82d8a21e..e5156628a5 100755 --- a/wmake/wmakeScheduler +++ b/wmake/wmakeScheduler @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License