Skip to content
Snippets Groups Projects
Commit dc2f4519 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

ENH: add wmake -user option

- overrides values of FOAM_APPBIN and FOAM_LIBBIN with those from
  FOAM_USER_APPBIN and FOAM_USER_LIBBIN, respectively.

  It can be useful in some situations to compile code into user locations
  rather than library locations. In #1522, for example, it will
  normally be useful to deliver out packages that compile into
  FOAM_LIBBIN (when included as a module) but still allow the user the
  chance to install into their own directories without editing all of
  the Make/files.
parent 75ba4a07
No related branches found
No related tags found
No related merge requests found
...@@ -54,7 +54,7 @@ USAGE ...@@ -54,7 +54,7 @@ USAGE
# Parse the arguments and options # Parse the arguments and options
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
unset fromWmake optDebug optLog optQueue unset fromWmake optDebug optUser optQueue optLog
for arg in "$@" for arg in "$@"
do do
...@@ -93,6 +93,10 @@ do ...@@ -93,6 +93,10 @@ do
optDebug="-debug" optDebug="-debug"
continue # Permanently remove arg continue # Permanently remove arg
;; ;;
-user)
optUser="-user"
continue # Permanently remove arg
;;
-q | -queue) -q | -queue)
optQueue="-queue" optQueue="-queue"
continue # Permanently remove arg continue # Permanently remove arg
...@@ -116,12 +120,12 @@ if [ -z "$fromWmake" ] ...@@ -116,12 +120,12 @@ if [ -z "$fromWmake" ]
then then
if [ -z "$optLog" ] if [ -z "$optLog" ]
then then
exec wmake -all $optQueue $* exec wmake -all $optDebug $optUser $optQueue $*
exit $? # Unneeded, but just in case something went wrong exit $? # Unneeded, but just in case something went wrong
else else
echo "Logging wmake -all output to '$optLog'" 1>&2 echo "Logging wmake -all output to '$optLog'" 1>&2
echo 1>&2 echo 1>&2
exec wmake -all $optDebug $optQueue $* 2>&1 | /usr/bin/tee $optLog exec wmake -all $optDebug $optUser $optQueue $* 2>&1 | /usr/bin/tee $optLog
# Need to cleanup after the tee # Need to cleanup after the tee
rc=$? # Error code from tee (not wmake), but not entirely important rc=$? # Error code from tee (not wmake), but not entirely important
echo "Done logging to '$optLog'" 1>&2 echo "Done logging to '$optLog'" 1>&2
......
...@@ -73,6 +73,7 @@ options: ...@@ -73,6 +73,7 @@ options:
-q | -queue wmakeCollect all sub-directories, running Allwmake if present -q | -queue wmakeCollect all sub-directories, running Allwmake if present
-k | -keep-going Keep going even when errors occur (-non-stop) -k | -keep-going Keep going even when errors occur (-non-stop)
-debug Define c++DBUG='-DFULLDEBUG -g -O0' as override -debug Define c++DBUG='-DFULLDEBUG -g -O0' as override
-user Set FOAM_APPBIN/FOAM_LIBBIN to user locations
-j Compile using all local cores/hyperthreads -j Compile using all local cores/hyperthreads
-jN | -j N Compile using N cores/hyperthreads -jN | -j N Compile using N cores/hyperthreads
-no-scheduler Disable scheduled parallel compilation -no-scheduler Disable scheduled parallel compilation
...@@ -148,6 +149,11 @@ do ...@@ -148,6 +149,11 @@ do
-debug) -debug)
optDebug="-DFULLDEBUG -g -O0" optDebug="-DFULLDEBUG -g -O0"
;; ;;
-user)
[ -n "$FOAM_USER_APPBIN" ] && export FOAM_APPBIN="$FOAM_USER_APPBIN"
[ -n "$FOAM_USER_LIBBIN" ] && export FOAM_LIBBIN="$FOAM_USER_LIBBIN"
echo "Compiling with user locations" 1>&2
;;
-show-api | -show-ext-so | \ -show-api | -show-ext-so | \
-show-compile-c | -show-c | -show-cflags | -show-cflags-arch | \ -show-compile-c | -show-c | -show-cflags | -show-cflags-arch | \
-show-compile-cxx | -show-cxx | -show-cxxflags | -show-cxxflags-arch ) -show-compile-cxx | -show-cxx | -show-cxxflags | -show-cxxflags-arch )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment