[XEN PATCH v7 29/51] build: add an other explicite rules to not build $(XEN_ROOT)/.config

Anthony PERARD posted 51 patches 4 years, 5 months ago
There is a newer version of this series
[XEN PATCH v7 29/51] build: add an other explicite rules to not build $(XEN_ROOT)/.config
Posted by Anthony PERARD 4 years, 5 months ago
GNU Make will try to rebuild every Makefile included with the
"include" directive, so everytime Config.mk is used, make will try to
build ".config". This would normally not be an issue, unless we happen
to have a rules which match. This is the case with Kconfig in xen/.

While we had a workaround in "xen/Makefile", this ".config" files
becomes an issue again in "xen/tools/kconfig/Makefile". It has a
target "%.config".

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 xen/Rules.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index a62c761be8d1..f1043a78a332 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -11,6 +11,10 @@ __build:
 -include $(BASEDIR)/include/config/auto.conf
 
 include $(XEN_ROOT)/Config.mk
+
+# Don't try to remake this file included by Config.mk.
+$(XEN_ROOT)/.config: ;
+
 include $(BASEDIR)/scripts/Kbuild.include
 
 ifndef obj
-- 
Anthony PERARD


Re: [XEN PATCH v7 29/51] build: add an other explicite rules to not build $(XEN_ROOT)/.config
Posted by Jan Beulich 4 years, 4 months ago
On 24.08.2021 12:50, Anthony PERARD wrote:
> GNU Make will try to rebuild every Makefile included with the
> "include" directive, so everytime Config.mk is used, make will try to
> build ".config". This would normally not be an issue, unless we happen
> to have a rules which match. This is the case with Kconfig in xen/.
> 
> While we had a workaround in "xen/Makefile", this ".config" files
> becomes an issue again in "xen/tools/kconfig/Makefile". It has a
> target "%.config".

"we had" sounds like we don't have such anymore, but I don't think I've
seen it go away. I'm also not convinced working around an isolated issue
in xen/tools/kconfig/Makefile is appropriate to be done by adding stuff
to Rules.mk.

Jan