ENH: move internal wmake scripts to scripts/ directory

- more consistent script names
- remove '-help' option from internal scripts
This commit is contained in:
Mark Olesen
2010-03-24 15:17:44 +01:00
parent 0c8fb634f0
commit d353f08f37
19 changed files with 65 additions and 78 deletions

View File

@ -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) .
#------------------------------------------------------------------------------

View File

@ -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

View File

@ -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
#------------------------------------------------------------------------------

View File

@ -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
@ -48,7 +49,7 @@ OPTIONS = $(WM_OPTIONS)/options
#------------------------------------------------------------------------------
$(OPTIONS) : options
@wmkdir $(WM_OPTIONS) ; $(CPP) $(GFLAGS) options > $(OPTIONS)
@$(WM_SCRIPTS)/makeDir $(WM_OPTIONS) ; $(CPP) $(GFLAGS) options > $(OPTIONS)
#------------------------------------------------------------------------------

View File

@ -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

View File

@ -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

View File

@ -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,12 +49,12 @@ 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
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Remove commented lines, blank lines, and trailing blanks from files
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sed -e '/^#/ d' \
-e '/^[ \t]*$/ d' \
-e 's/[ \t]*$//' \
@ -132,6 +131,4 @@ sed -e 's/\.[a-zA-Z]*$/.dep/' \
rm files.$$
cd ..
#------------------------------------------------------------------------------

View File

@ -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 <dir> [.. <dirN>]
# Usage : makeDir <dir> [.. <dirN>]
#
#------------------------------------------------------------------------------
if [ $# -ge 1 ]
then
# provide help
if [ "$1" = "-h" -o "$1" = "-help" ]
then
echo "usage: ${0##*/} <dir> [.. <dirN>]"
echo " mkdir if directories do not already exist"
echo
else
for dir
do
for dir
do
[ -d "$dir" ] || mkdir -p "$dir"
done
fi
fi
done
#------------------------------------------------------------------------------

View File

@ -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

View File

@ -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

View File

@ -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 <directory>
# Usage: makeTargetDir <directory>
#
#------------------------------------------------------------------------------
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
#------------------------------------------------------------------------------

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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