Commit e7fc1985 authored by Henry Weller's avatar Henry Weller
Browse files

Allwmake: improved '-update' option to handle out-of-date '.dep' files

Patch contributed by Bruno Santos
Resolves bug-report http://bugs.openfoam.org/view.php?id=2091
parent fd38002d
......@@ -47,7 +47,7 @@ SFILES = $(OBJECTS_DIR)/sourceFiles
#------------------------------------------------------------------------------
# Declare dependecy of all make system files on FILES
# Declare dependency of all make system files on FILES
# Causes all derived files to be remade if any are changed or missing
#------------------------------------------------------------------------------
......
......@@ -184,7 +184,7 @@ lnInclude: $(MAKE_DIR)/files $(MAKE_DIR)/options
#------------------------------------------------------------------------------
# Declare all qbject files depend on $(OBJECTS_DIR)/options
# Declare all object files depend on $(OBJECTS_DIR)/options
#------------------------------------------------------------------------------
$(OBJECTS) : $(OBJECTS_DIR)/options
......@@ -192,13 +192,15 @@ $(foreach S,$(SOURCE),$(eval $(OBJECTS_DIR)/$(basename $S).o : $(OBJECTS_DIR)/$S
#------------------------------------------------------------------------------
# Set depedency rule and include dependency lists
# Set dependency rule and include dependency lists
#------------------------------------------------------------------------------
.PHONY: dep
.PHONY: dep updatedep
dep: $(DEPENDENCIES)
ifeq ($(findstring lnInclude,$(MAKECMDGOALS)),)
updatedep: dep
ifeq ($(findstring lnInclude,$(MAKECMDGOALS))$(findstring updatedep,$(MAKECMDGOALS)),)
-include $(DEPENDENCIES)
endif
......
......@@ -127,6 +127,9 @@ do
-update)
wrmdep -update
wmakeLnIncludeAll
# Set WM_UPDATE_DEPENDENCIES, so that wmake will pick up on it
export WM_UPDATE_DEPENDENCIES=yes
;;
# Generate documentation
doc)
......
......@@ -82,6 +82,7 @@ or a special target:
libo Compile statically linked lib (.o)
libso Compile dynamically linked lib (.so)
dep Compile lnInclude and dependencies only
updatedep Compile dependencies only (in case of broken dependencies)
USAGE
exit 1
......@@ -378,6 +379,26 @@ case "$targetType" in
esac
#------------------------------------------------------------------------------
# When WM_UPDATE_DEPENDENCIES is set, use forced dependency files update
#------------------------------------------------------------------------------
if [ -n "$WM_UPDATE_DEPENDENCIES" ]
then
$make -f $WM_DIR/makefiles/general MAKE_DIR=$MakeDir \
OBJECTS_DIR=$objectsDir updatedep
makeExitCode=$?
if [ $makeExitCode -ne 0 ]
then
exit $makeExitCode
fi
unset makeExitCode
fi
#------------------------------------------------------------------------------
# Make the dependency files or object files and link
#------------------------------------------------------------------------------
......
Supports Markdown
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