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
This commit is contained in:
Henry Weller 2016-05-16 12:21:57 +01:00
parent fd38002d57
commit e7fc198592
4 changed files with 31 additions and 5 deletions

View File

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

View File

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

View File

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

View File

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