[CRIU] [PATCH]
Cyrill Gorcunov
gorcunov at openvz.org
Thu Apr 5 09:02:31 EDT 2012
Guys, while being mocking with root Makefile I found that
filtering of goals is not going fine, ie "make clean" called
twice in a row forced make to generate deps, which is useless
of course.
So the fix is below, please review. The idea is to generate
deps IIF they are really needed, which are the cases
- one of *.o,*.s,*.i file is about to build
- one of general targets such as crtools,zdtm,test-legacy
acquired
anything else (including clean,docs and such) should not
generate deps, saving cpu cycles ;)
Cyrill
---
From: Cyrill Gorcunov <gorcunov at openvz.org>
Date: Thu, 5 Apr 2012 16:49:12 +0400
Subject: [PATCH] make: Fix dependency generation
In case if no goals specified the all
goal is implied so don't forget to generate
deps. This as well fixes a problem where
two "make clean" in a row forced build system
to regenerate deps.
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
Makefile | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 40e3249..cc490c8 100644
--- a/Makefile
+++ b/Makefile
@@ -200,8 +200,16 @@ help:
$(E) ' test - Run zdtm test-suite'
.PHONY: help
-deps-targets := %.o %.s %.i
+deps-targets := %.o %.s %.i $(PROGRAM) zdtm test-legacy
-ifeq ($(filter deps-targets, $(MAKECMDGOALS)),)
+ifneq ($(filter $(deps-targets), $(MAKECMDGOALS)),)
+ INCDEPS := 1
+endif
+
+ifeq ($(MAKECMDGOALS),)
+ INCDEPS := 1
+endif
+
+ifeq ($(INCDEPS),1)
-include $(DEPS)
endif
--
1.7.7.6
More information about the CRIU
mailing list