Commit 5d185831 authored by Mark Olesen's avatar Mark Olesen
Browse files

ENH: collect arch-specific directly under platforms/

- platforms/WM_OPTIONS/lib
      old: lib/WM_OPTIONS

- platforms/WM_OPTIONS/bin
      old: bin/WM_OPTIONS
      old: applications/bin/WM_OPTIONS

A runtime environment nows needs
    - bin/
    - etc/
    - platforms/
parent 5e12506f
EXE_LIBS = $(LIB_WM_OPTIONS_DIR)/libfbsdmalloc.o
EXE_LIBS = $(FOAM_EXT_LIBBIN)/libfbsdmalloc.o
......@@ -73,13 +73,10 @@ do
done
# check for essential directories
for dir in $packDir
do
[ -d $dir ] || {
echo "Error: directory $dir does not exist" 1>&2
exit 1
}
done
[ -d $packDir ] || {
echo "Error: directory $packDir does not exist" 1>&2
exit 1
}
#------------------------------------------------------------------------------
......
......@@ -57,10 +57,29 @@ esac
}
# obtain archOptions types from lib/
for archOptions in $packDir/lib/*
do
$binDir/$packBin $@ ${archOptions##*/}
done
if [ -d $packDir/lib ]
then
# obtain archOptions types from lib/<archOptions>
for archOptions in $packDir/lib/*
do
$binDir/$packBin $@ ${archOptions##*/}
done
elif [ -d $packDir/platforms ]
# obtain archOptions types from platforms/<archOptions>/lib
for archOptions in $packDir/platforms/*/lib
do
archOptions=${archOptions%%/lib}
$binDir/$packBin $@ ${archOptions##*/}
done
else
echo "Error: directory $packDir does not appear packable" 1>&2
exit 1
fi
#------------------------------------------------------------------------------
......@@ -72,13 +72,10 @@ do
done
# check for essential directories
for dir in $packDir
do
[ -d $dir ] || {
echo "Error: directory $dir does not exist" 1>&2
exit 1
}
done
[ -d $packDir ] || {
echo "Error: directory $packDir does not exist" 1>&2
exit 1
}
#------------------------------------------------------------------------------
......
......@@ -67,19 +67,35 @@ arch3264=$(echo "$archOS" | sed -e 's@64@-64@')
#------------------------------------------------------------------------------
# check for essential directories
for dir in $packDir $packDir/lib/$archOptions
do
[ -d $dir ] || {
echo "Error: directory $dir does not exist" 1>&2
exit 1
}
done
# check new/old places for executables - same as $FOAM_APPBIN
[ -d $packDir/bin/$archOptions -o -d $packDir/applications/bin/$archOptions ] || {
[ -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/bin/$archOptions
$packDir/platforms/$archOptions/bin
$packDir/applications/bin/$archOptions
BIN_CHECK
exit 1
......@@ -90,14 +106,15 @@ BIN_CHECK
# list of directories
dirList=$(
for dir in \
$packDir/bin/$archOptions \
$packDir/lib/$archOptions \
$packDir/applications/bin/$archOptions \
$packDir/platforms/$archOptions/bin \
$packDir/platforms/$archOptions/lib \
$packDir/wmake/bin/$archCompiler \
$packDir/wmake/bin/$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
......
......@@ -66,7 +66,7 @@ arch3264=$(echo "$archOS" | sed -e 's@64@-64@')
#------------------------------------------------------------------------------
# check for essential directories
for dir in $packDir $packDir/lib/$archOptions
for dir in $packDir $packDir/platforms/$archOptions/lib
do
[ -d $dir ] || {
echo "Error: directory $dir does not exist" 1>&2
......@@ -78,12 +78,6 @@ done
# list of directories
dirList=$(
for dir in \
$packDir/bin/$archOptions \
$packDir/bin/$archCompiler \
$packDir/bin/$archOS \
$packDir/lib/$archOptions \
$packDir/lib/$archCompiler \
$packDir/lib/$archOS \
$packDir/platforms/$archOptions \
$packDir/platforms/$archCompiler \
$packDir/platforms/$archOS \
......
......@@ -48,20 +48,20 @@ setenv WM_LINK_LANGUAGE c++
setenv WM_OPTIONS $WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_COMPILE_OPTION
# base executables/libraries
setenv FOAM_APPBIN $WM_PROJECT_DIR/bin/$WM_OPTIONS
setenv FOAM_LIBBIN $WM_PROJECT_DIR/lib/$WM_OPTIONS
setenv FOAM_APPBIN $WM_PROJECT_DIR/platforms/$WM_OPTIONS/bin
setenv FOAM_LIBBIN $WM_PROJECT_DIR/platforms/$WM_OPTIONS/lib
# external (ThirdParty) libraries
setenv FOAM_EXT_LIBBIN $WM_THIRD_PARTY_DIR/lib/$WM_OPTIONS
setenv FOAM_EXT_LIBBIN $WM_THIRD_PARTY_DIR/platforms/$WM_OPTIONS/lib
# shared site executables/libraries
# similar naming convention as ~OpenFOAM expansion
setenv FOAM_SITE_APPBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/bin/$WM_OPTIONS
setenv FOAM_SITE_LIBBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/lib/$WM_OPTIONS
setenv FOAM_SITE_APPBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/bin
setenv FOAM_SITE_LIBBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib
# user executables/libraries
setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/bin/$WM_OPTIONS
setenv FOAM_USER_LIBBIN $WM_PROJECT_USER_DIR/lib/$WM_OPTIONS
setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/bin
setenv FOAM_USER_LIBBIN $WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/lib
# convenience
setenv FOAM_APP $WM_PROJECT_DIR/applications
......
......@@ -71,20 +71,20 @@ export WM_LINK_LANGUAGE=c++
export WM_OPTIONS=$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_COMPILE_OPTION
# base executables/libraries
export FOAM_APPBIN=$WM_PROJECT_DIR/bin/$WM_OPTIONS
export FOAM_LIBBIN=$WM_PROJECT_DIR/lib/$WM_OPTIONS
export FOAM_APPBIN=$WM_PROJECT_DIR/platforms/$WM_OPTIONS/bin
export FOAM_LIBBIN=$WM_PROJECT_DIR/platforms/$WM_OPTIONS/lib
# external (ThirdParty) libraries
export FOAM_EXT_LIBBIN=$WM_THIRD_PARTY_DIR/lib/$WM_OPTIONS
export FOAM_EXT_LIBBIN=$WM_THIRD_PARTY_DIR/platforms/$WM_OPTIONS/lib
# shared site executables/libraries
# similar naming convention as ~OpenFOAM expansion
export FOAM_SITE_APPBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/bin/$WM_OPTIONS
export FOAM_SITE_LIBBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/lib/$WM_OPTIONS
export FOAM_SITE_APPBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/bin
export FOAM_SITE_LIBBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib
# user executables/libraries
export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/bin/$WM_OPTIONS
export FOAM_USER_LIBBIN=$WM_PROJECT_USER_DIR/lib/$WM_OPTIONS
export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/bin
export FOAM_USER_LIBBIN=$WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/lib
# convenience
export FOAM_APP=$WM_PROJECT_DIR/applications
......
......@@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
......@@ -56,8 +56,7 @@ WM_SCRIPTS = $(WM_DIR)/scripts
#------------------------------------------------------------------------------
LIB_SRC = $(WM_PROJECT_DIR)/src
LIB_DIR = $(WM_PROJECT_DIR)/lib
LIB_WM_OPTIONS_DIR = $(LIB_DIR)/$(WM_OPTIONS)
LIB_PLATFORMS = $(WM_PROJECT_DIR)/platforms/$(WM_OPTIONS)/lib
OBJECTS_DIR = $(MAKE_DIR)/$(WM_OPTIONS)
CLASSES_DIR = $(MAKE_DIR)/classes
......@@ -148,7 +147,7 @@ LIB_HEADER_DIRS = \
$(EXE): $(OBJECTS)
@$(WM_SCRIPTS)/makeTargetDir $(EXE)
$(LINKEXE) $(OBJECTS) -L$(LIB_WM_OPTIONS_DIR) \
$(LINKEXE) $(OBJECTS) -L$(LIB_PLATFORMS) \
$(EXE_LIBS) $(PROJECT_LIBS) $(SYS_LIBS) $(LINK_LIBS) $(GLIBS) -o $(EXE)
exe: $(SEXE)
......@@ -173,7 +172,7 @@ $(LIB).$(SO): $(OBJECTS)
@$(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)
$(LINKLIBSO) $(LOCAL_OBJECTS) -L$(LIB_PLATFORMS) $(LIB_LIBS) $(GLIB_LIBS) -o $(LIB).$(SO)
lib: $(LIB).a
@echo \'$(LIB).a\' is up to date.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment