All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libxl: fix incremental parallel build
@ 2017-08-30  7:06 Jan Beulich
  2017-09-01 15:28 ` Wei Liu
  0 siblings, 1 reply; 18+ messages in thread
From: Jan Beulich @ 2017-08-30  7:06 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Wei Liu

Short-circuit absolute paths of generated headers to their pathless
equivalents, to avoid two racing invocations of the same rule producing
them.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
This wants to be backported to 4.9 and 4.8.

--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -264,6 +264,13 @@ $(LIBXL_OBJS) $(LIBXL_TEST_OBJS) $(LIBXL
 	$(TEST_PROG_OBJS) $(SAVE_HELPER_OBJS): libxl.h
 $(LIBXL_OBJS) $(LIBXL_TEST_OBJS): libxl_internal.h
 
+# libacpi sources (living in another subdirectory) will have their inclusions
+# of headers from this directory recorded as absolute paths in the .*.o.d
+# files.  In order to not invoke the subsequent rule twice (and perhaps in a
+# racing way when doing a parallel build), short-circuit the absolute paths to
+# the local ones first.
+$(CURDIR)/_libxl_type%.h: _libxl_type%.h ;
+
 _libxl_type%.h _libxl_type%_json.h _libxl_type%_private.h _libxl_type%.c: libxl_type%.idl gentypes.py idl.py
 	$(eval stem = $(notdir $*))
 	$(PYTHON) gentypes.py libxl_type$(stem).idl __libxl_type$(stem).h __libxl_type$(stem)_private.h \




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] libxl: fix incremental parallel build
  2017-08-30  7:06 [PATCH] libxl: fix incremental parallel build Jan Beulich
@ 2017-09-01 15:28 ` Wei Liu
  2017-09-01 15:35   ` Jan Beulich
  0 siblings, 1 reply; 18+ messages in thread
From: Wei Liu @ 2017-09-01 15:28 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel, Wei Liu, Ian Jackson

On Wed, Aug 30, 2017 at 01:06:10AM -0600, Jan Beulich wrote:
> Short-circuit absolute paths of generated headers to their pathless
> equivalents, to avoid two racing invocations of the same rule producing
> them.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> This wants to be backported to 4.9 and 4.8.
> 
> --- a/tools/libxl/Makefile
> +++ b/tools/libxl/Makefile
> @@ -264,6 +264,13 @@ $(LIBXL_OBJS) $(LIBXL_TEST_OBJS) $(LIBXL
>  	$(TEST_PROG_OBJS) $(SAVE_HELPER_OBJS): libxl.h
>  $(LIBXL_OBJS) $(LIBXL_TEST_OBJS): libxl_internal.h
>  
> +# libacpi sources (living in another subdirectory) will have their inclusions
> +# of headers from this directory recorded as absolute paths in the .*.o.d
> +# files.  In order to not invoke the subsequent rule twice (and perhaps in a
> +# racing way when doing a parallel build), short-circuit the absolute paths to
> +# the local ones first.
> +$(CURDIR)/_libxl_type%.h: _libxl_type%.h ;

I don't quite get this. I normally build with -j8 and never saw a race.

Do you mean parallel build in which two makes enter libxl? Is that
possible?

Why does libacpi matter? All dependencies files (*.o.d) should be local
to libxl anyway.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] libxl: fix incremental parallel build
  2017-09-01 15:28 ` Wei Liu
@ 2017-09-01 15:35   ` Jan Beulich
  2017-09-01 17:04     ` Ian Jackson
  0 siblings, 1 reply; 18+ messages in thread
From: Jan Beulich @ 2017-09-01 15:35 UTC (permalink / raw)
  To: Wei Liu; +Cc: xen-devel, Ian Jackson

>>> On 01.09.17 at 17:28, <wei.liu2@citrix.com> wrote:
> On Wed, Aug 30, 2017 at 01:06:10AM -0600, Jan Beulich wrote:
>> Short-circuit absolute paths of generated headers to their pathless
>> equivalents, to avoid two racing invocations of the same rule producing
>> them.
>> 
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> ---
>> This wants to be backported to 4.9 and 4.8.
>> 
>> --- a/tools/libxl/Makefile
>> +++ b/tools/libxl/Makefile
>> @@ -264,6 +264,13 @@ $(LIBXL_OBJS) $(LIBXL_TEST_OBJS) $(LIBXL
>>  	$(TEST_PROG_OBJS) $(SAVE_HELPER_OBJS): libxl.h
>>  $(LIBXL_OBJS) $(LIBXL_TEST_OBJS): libxl_internal.h
>>  
>> +# libacpi sources (living in another subdirectory) will have their 
> inclusions
>> +# of headers from this directory recorded as absolute paths in the .*.o.d
>> +# files.  In order to not invoke the subsequent rule twice (and perhaps in 
> a
>> +# racing way when doing a parallel build), short-circuit the absolute paths 
> to
>> +# the local ones first.
>> +$(CURDIR)/_libxl_type%.h: _libxl_type%.h ;
> 
> I don't quite get this. I normally build with -j8 and never saw a race.

I rarely do incremental tools builds, but each time I do them
(on 4.8 or later) I run into this issue.

> Do you mean parallel build in which two makes enter libxl? Is that
> possible?

No, only a single entry into that subtree.

> Why does libacpi matter? All dependencies files (*.o.d) should be local
> to libxl anyway.

Did you check? My .build.o.d has:

build.o:  \
 /build/xen/unstable-hg/2017-08-10/tools/libxl/../../tools/libacpi/build.c \
  /build/xen/unstable-hg/2017-08-10/tools/libxl/../../tools/config.h \
  /build/xen/unstable-hg/2017-08-10/tools/libxl/libxl_x86_acpi.h \
[...]
  _libxl_list.h \
  /build/xen/unstable-hg/2017-08-10/tools/libxl/_libxl_types.h \
  libxl_event.h libxl.h \
[...]

and it is this non-local _libxl_types.h dependency which breaks
things. I've noted this with gcc 4.3.x, in case that matters (e.g.
if newer compilers are smarter in how they write out deps).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] libxl: fix incremental parallel build
  2017-09-01 15:35   ` Jan Beulich
@ 2017-09-01 17:04     ` Ian Jackson
  2017-09-04  8:38       ` Jan Beulich
  0 siblings, 1 reply; 18+ messages in thread
From: Ian Jackson @ 2017-09-01 17:04 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel, Wei Liu

Jan Beulich writes ("Re: [PATCH] libxl: fix incremental parallel build"):
> On 01.09.17 at 17:28, <wei.liu2@citrix.com> wrote:
> > Do you mean parallel build in which two makes enter libxl? Is that
> > possible?
> 
> No, only a single entry into that subtree.

Are you sure ?

> > Why does libacpi matter? All dependencies files (*.o.d) should be local
> > to libxl anyway.
> 
> Did you check? My .build.o.d has:

AFAICT you must mean tools/firmware/hvmloader/.build.o.d ?

> build.o:  \
>  /build/xen/unstable-hg/2017-08-10/tools/libxl/../../tools/libacpi/build.c \
>   /build/xen/unstable-hg/2017-08-10/tools/libxl/../../tools/config.h \
>   /build/xen/unstable-hg/2017-08-10/tools/libxl/libxl_x86_acpi.h \
> [...]
>   _libxl_list.h \
>   /build/xen/unstable-hg/2017-08-10/tools/libxl/_libxl_types.h \
>   libxl_event.h libxl.h \
> [...]
> 
> and it is this non-local _libxl_types.h dependency which breaks
> things. I've noted this with gcc 4.3.x, in case that matters (e.g.
> if newer compilers are smarter in how they write out deps).

This suggests that perhaps the problem is that something is reentering
libxl.

With recursive make, it is necessary for the overall structure of the
makefiles to sequence things so that each directory is entered exactly
once, before its dependent directories are entered.  (It is possible
to violate this rule without creating races but it is tricky and
inadvisable.)

Can you provide a complete log of a failing build ?

Thanks,
Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] libxl: fix incremental parallel build
  2017-09-01 17:04     ` Ian Jackson
@ 2017-09-04  8:38       ` Jan Beulich
  2017-09-04 10:59         ` Ian Jackson
  2017-09-04 11:33         ` Ian Jackson
  0 siblings, 2 replies; 18+ messages in thread
From: Jan Beulich @ 2017-09-04  8:38 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel, Wei Liu

>>> On 01.09.17 at 19:04, <ian.jackson@eu.citrix.com> wrote:
> Jan Beulich writes ("Re: [PATCH] libxl: fix incremental parallel build"):
>> On 01.09.17 at 17:28, <wei.liu2@citrix.com> wrote:
>> > Do you mean parallel build in which two makes enter libxl? Is that
>> > possible?
>> 
>> No, only a single entry into that subtree.
> 
> Are you sure ?

Yes.

>> > Why does libacpi matter? All dependencies files (*.o.d) should be local
>> > to libxl anyway.
>> 
>> Did you check? My .build.o.d has:
> 
> AFAICT you must mean tools/firmware/hvmloader/.build.o.d ?

No, I mean the libxl instance of the file (remember that the same
libacpi source file is being compiled twice). The hvmloader instance
looks similar, but doesn't cause the same problem (because there
are no auto-generated headers).

>> build.o:  \
>>  /build/xen/unstable-hg/2017-08-10/tools/libxl/../../tools/libacpi/build.c \
>>   /build/xen/unstable-hg/2017-08-10/tools/libxl/../../tools/config.h \
>>   /build/xen/unstable-hg/2017-08-10/tools/libxl/libxl_x86_acpi.h \
>> [...]
>>   _libxl_list.h \
>>   /build/xen/unstable-hg/2017-08-10/tools/libxl/_libxl_types.h \
>>   libxl_event.h libxl.h \
>> [...]
>> 
>> and it is this non-local _libxl_types.h dependency which breaks
>> things. I've noted this with gcc 4.3.x, in case that matters (e.g.
>> if newer compilers are smarter in how they write out deps).
> 
> This suggests that perhaps the problem is that something is reentering
> libxl.

Again, I've verified (multiple times) that this is not the case, as I
too did initially suspect this to be what is happening.

> With recursive make, it is necessary for the overall structure of the
> makefiles to sequence things so that each directory is entered exactly
> once, before its dependent directories are entered.  (It is possible
> to violate this rule without creating races but it is tricky and
> inadvisable.)

I understand that.

> Can you provide a complete log of a failing build ?

With the above, is that really needed? And if so, do you mean
just normal make output, or output from additionally passing -p.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] libxl: fix incremental parallel build
  2017-09-04  8:38       ` Jan Beulich
@ 2017-09-04 10:59         ` Ian Jackson
  2017-09-04 11:33         ` Ian Jackson
  1 sibling, 0 replies; 18+ messages in thread
From: Ian Jackson @ 2017-09-04 10:59 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel, Wei Liu

Jan Beulich writes ("Re: [PATCH] libxl: fix incremental parallel build"):
> On 01.09.17 at 19:04, <ian.jackson@eu.citrix.com> wrote:
> > AFAICT you must mean tools/firmware/hvmloader/.build.o.d ?
> 
> No, I mean the libxl instance of the file (remember that the same
> libacpi source file is being compiled twice). The hvmloader instance
> looks similar, but doesn't cause the same problem (because there
> are no auto-generated headers).

I had an out of date tree somehow, so I didn't find the build.o.

> > Can you provide a complete log of a failing build ?
> 
> With the above, is that really needed? And if so, do you mean
> just normal make output, or output from additionally passing -p.

I still think it would be helpful.  But in the meantime I'm looking
again at this log of a successful build.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] libxl: fix incremental parallel build
  2017-09-04  8:38       ` Jan Beulich
  2017-09-04 10:59         ` Ian Jackson
@ 2017-09-04 11:33         ` Ian Jackson
  2017-09-04 12:51           ` Jan Beulich
  1 sibling, 1 reply; 18+ messages in thread
From: Ian Jackson @ 2017-09-04 11:33 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel, Wei Liu

I have investigated this further and have made the following
discoveries:

1. make distinguishes targets purely textually.  It will canonicalise a
  target name by removing ./ before comparison (so `foo' and `./foo'
  are considered the same target) but it won't examine the filesystem
  AFAICT.  So `foo' and `../../this/subdir/foo' are different targets.
  (You seem to have already observed or known this.)

2. If you use gcc -MMD to generate a .d file, and say -I. to include
  things from the cwd, but invoke gcc to compile a file elsewhere, eg
     gcc -MMD -I -o build.o /other/path/build.c
  and build.c #includes `foo.h', then the -MMD output mentions
  `/absolute/path/to/this/subdir/foo.h', even though it could refer
  to `foo.h'.  (VPATH and vpath are obvious ways for this to happen.)
  This is presumably because gcc has noticed that `.' in this context
  must mean relative to the invocation cwd, not relative to build.c.

3. If foo.h is autogenerated using some kind of pattern rule,
  you end up with two `copies' of the rule, which can run
  simultaneously, once for build.c -> build.o and once for normal
  files in the same cwd.

I think (2) is a bug in gcc.  But we can't sensibly expect to fix
that.  Sadly I think the right fix is to seddery the pointless paths
out of the .d files.

I don't think going round all our Makefiles adding rules of the form
   $(ABS_PATH_TO_HERE)/auto-%-generated.: auto-%-generated.h
is sensible.  There are too many and this is too ad-hoc.

Do people agree ?

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] libxl: fix incremental parallel build
  2017-09-04 11:33         ` Ian Jackson
@ 2017-09-04 12:51           ` Jan Beulich
  2017-09-04 13:33             ` Ian Jackson
  0 siblings, 1 reply; 18+ messages in thread
From: Jan Beulich @ 2017-09-04 12:51 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel, Wei Liu

>>> On 04.09.17 at 13:33, <ian.jackson@eu.citrix.com> wrote:
> I have investigated this further and have made the following
> discoveries:
> 
> 1. make distinguishes targets purely textually.  It will canonicalise a
>   target name by removing ./ before comparison (so `foo' and `./foo'
>   are considered the same target) but it won't examine the filesystem
>   AFAICT.  So `foo' and `../../this/subdir/foo' are different targets.
>   (You seem to have already observed or known this.)
> 
> 2. If you use gcc -MMD to generate a .d file, and say -I. to include
>   things from the cwd, but invoke gcc to compile a file elsewhere, eg
>      gcc -MMD -I -o build.o /other/path/build.c
>   and build.c #includes `foo.h', then the -MMD output mentions
>   `/absolute/path/to/this/subdir/foo.h', even though it could refer
>   to `foo.h'.  (VPATH and vpath are obvious ways for this to happen.)
>   This is presumably because gcc has noticed that `.' in this context
>   must mean relative to the invocation cwd, not relative to build.c.
> 
> 3. If foo.h is autogenerated using some kind of pattern rule,
>   you end up with two `copies' of the rule, which can run
>   simultaneously, once for build.c -> build.o and once for normal
>   files in the same cwd.
> 
> I think (2) is a bug in gcc.  But we can't sensibly expect to fix
> that.  Sadly I think the right fix is to seddery the pointless paths
> out of the .d files.
> 
> I don't think going round all our Makefiles adding rules of the form
>    $(ABS_PATH_TO_HERE)/auto-%-generated.: auto-%-generated.h
> is sensible.  There are too many and this is too ad-hoc.

Well, the absolute paths in there are a problem only when compiling
files from a different subdirectory. Is that something that happens
in many places? I would agree to the sed approach you suggest if
this was a widespread problem, but I don't think it is (and hence I
went this other route).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] libxl: fix incremental parallel build
  2017-09-04 12:51           ` Jan Beulich
@ 2017-09-04 13:33             ` Ian Jackson
  2017-09-04 14:36               ` Jan Beulich
  0 siblings, 1 reply; 18+ messages in thread
From: Ian Jackson @ 2017-09-04 13:33 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel, Wei Liu

Jan Beulich writes ("Re: [PATCH] libxl: fix incremental parallel build"):
> Well, the absolute paths in there are a problem only when compiling
> files from a different subdirectory. Is that something that happens
> in many places?

It seems to be not wholly uncommon in xen.git, primarily because of a
desire to build the same code for execution in userland and in the
hypervisor (or guest firmware images or similar).

So far we have

 mariner:xen.git> git-grep '^vpath' | wc -l
 8

and that clearly leaves some out because it contains none of the
hypervisor instances.

And my key point is that the need for a workaround is not the fault of
the autogenerated .h files.  Your proposed workaround needs adjusting
every time the set of autogenerated .h files (or the set of Makefiles
which make .h files) changes.

I would like to make a single change which will always work.  After
all we have no way to automatically verify that we don't have bugs of
this form, and when we do write a bug of this form it's a race bug
(and race bugs are horrible to find and debug).

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] libxl: fix incremental parallel build
  2017-09-04 13:33             ` Ian Jackson
@ 2017-09-04 14:36               ` Jan Beulich
  2017-09-04 14:39                 ` Ian Jackson
  0 siblings, 1 reply; 18+ messages in thread
From: Jan Beulich @ 2017-09-04 14:36 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel, Wei Liu

>>> On 04.09.17 at 15:33, <ian.jackson@eu.citrix.com> wrote:
> I would like to make a single change which will always work.  After
> all we have no way to automatically verify that we don't have bugs of
> this form, and when we do write a bug of this form it's a race bug
> (and race bugs are horrible to find and debug).

Well, okay - I take that you're intending to put together such a
change then in the not too distant future.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] libxl: fix incremental parallel build
  2017-09-04 14:36               ` Jan Beulich
@ 2017-09-04 14:39                 ` Ian Jackson
  2017-09-04 16:46                   ` [PATCH 1/4] DEPS handling: Provide DEPS_RM and DEPS_INCLUDE Ian Jackson
  0 siblings, 1 reply; 18+ messages in thread
From: Ian Jackson @ 2017-09-04 14:39 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel, Wei Liu

Jan Beulich writes ("Re: [PATCH] libxl: fix incremental parallel build"):
> On 04.09.17 at 15:33, <ian.jackson@eu.citrix.com> wrote:
> > I would like to make a single change which will always work.  After
> > all we have no way to automatically verify that we don't have bugs of
> > this form, and when we do write a bug of this form it's a race bug
> > (and race bugs are horrible to find and debug).
> 
> Well, okay - I take that you're intending to put together such a
> change then in the not too distant future.

Sure, I was indeed volunteering :-).

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 1/4] DEPS handling: Provide DEPS_RM and DEPS_INCLUDE
  2017-09-04 14:39                 ` Ian Jackson
@ 2017-09-04 16:46                   ` Ian Jackson
  2017-09-04 16:46                     ` [PATCH 2/4] DEPS handling: Use DEPS_RM everywhere Ian Jackson
                                       ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Ian Jackson @ 2017-09-04 16:46 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Wei Liu, Jan Beulich

These are not used anywhere yet, so no functional change.

Reported-by: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 Config.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Config.mk b/Config.mk
index 1bc922e..5aca4bf 100644
--- a/Config.mk
+++ b/Config.mk
@@ -56,6 +56,8 @@ HOSTCC ?= clang
 HOSTCXX ?= clang++
 endif
 
+DEPS_RM = $(DEPS)
+DEPS_INCLUDE = $(DEPS)
 
 include $(XEN_ROOT)/config/$(XEN_OS).mk
 include $(XEN_ROOT)/config/$(XEN_TARGET_ARCH).mk
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 2/4] DEPS handling: Use DEPS_RM everywhere
  2017-09-04 16:46                   ` [PATCH 1/4] DEPS handling: Provide DEPS_RM and DEPS_INCLUDE Ian Jackson
@ 2017-09-04 16:46                     ` Ian Jackson
  2017-09-04 16:46                     ` [PATCH 3/4] DEPS handling: Use DEPS_INCLUDE everywhere Ian Jackson
  2017-09-04 16:46                     ` [PATCH 4/4] DEPS handling: Remove absolute paths from references to cwd Ian Jackson
  2 siblings, 0 replies; 18+ messages in thread
From: Ian Jackson @ 2017-09-04 16:46 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Wei Liu, Jan Beulich

DEPS_RM is currently the same as DEPS, so no functional change.

This patch is the result of two perl runes:

  git-grep -l 'rm.*DEPS' | xargs perl -i~ -pe 'next unless m/^\t+rm\b/; s/\bDEPS\b/DEPS_RM/;'

  git-grep -l 'RM.*DEPS' | xargs perl -i~ -pe 'next unless m/^\t+\$\(RM\)/; s/\bDEPS\b/DEPS_RM/;'

And editing  tools/xenstat/libxenstat/Makefile  by hand.

I verified that I didn't miss anything with this rune:

  git-grep '\bDEPS\b' | grep -v include |less

Reported-by: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/blktap2/Makefile                        | 2 +-
 tools/blktap2/control/Makefile                | 2 +-
 tools/blktap2/lvm/Makefile                    | 2 +-
 tools/blktap2/vhd/Makefile                    | 2 +-
 tools/blktap2/vhd/lib/Makefile                | 2 +-
 tools/console/Makefile                        | 2 +-
 tools/debugger/kdd/Makefile                   | 2 +-
 tools/firmware/hvmloader/Makefile             | 2 +-
 tools/firmware/rombios/32bit/Makefile         | 2 +-
 tools/firmware/rombios/32bit/tcgbios/Makefile | 2 +-
 tools/firmware/rombios/Makefile               | 2 +-
 tools/flask/utils/Makefile                    | 2 +-
 tools/helpers/Makefile                        | 2 +-
 tools/libfsimage/Rules.mk                     | 2 +-
 tools/libs/call/Makefile                      | 2 +-
 tools/libs/devicemodel/Makefile               | 2 +-
 tools/libs/evtchn/Makefile                    | 2 +-
 tools/libs/foreignmemory/Makefile             | 2 +-
 tools/libs/gnttab/Makefile                    | 2 +-
 tools/libs/toollog/Makefile                   | 2 +-
 tools/libvchan/Makefile                       | 2 +-
 tools/libxc/Makefile                          | 2 +-
 tools/libxl/Makefile                          | 2 +-
 tools/memshr/Makefile                         | 2 +-
 tools/misc/Makefile                           | 2 +-
 tools/pygrub/Makefile                         | 2 +-
 tools/python/Makefile                         | 2 +-
 tools/tests/mem-sharing/Makefile              | 2 +-
 tools/tests/xen-access/Makefile               | 2 +-
 tools/tests/xenstore/Makefile                 | 2 +-
 tools/xcutils/Makefile                        | 2 +-
 tools/xenbackendd/Makefile                    | 2 +-
 tools/xenmon/Makefile                         | 2 +-
 tools/xenpaging/Makefile                      | 2 +-
 tools/xenpmd/Makefile                         | 2 +-
 tools/xenstat/libxenstat/Makefile             | 2 +-
 tools/xenstat/xentop/Makefile                 | 2 +-
 tools/xenstore/Makefile                       | 2 +-
 tools/xentrace/Makefile                       | 2 +-
 tools/xl/Makefile                             | 2 +-
 xen/Rules.mk                                  | 2 +-
 xen/xsm/flask/Makefile                        | 2 +-
 42 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/tools/blktap2/Makefile b/tools/blktap2/Makefile
index f4758ef..f4ac1eb 100644
--- a/tools/blktap2/Makefile
+++ b/tools/blktap2/Makefile
@@ -12,7 +12,7 @@ SUBDIRS-$(CONFIG_Linux) += drivers
 SUBDIRS-$(CONFIG_Linux) += control
 
 clean:
-	rm -rf *.a *.so *.o *.rpm $(LIB) *~ $(DEPS) TAGS
+	rm -rf *.a *.so *.o *.rpm $(LIB) *~ $(DEPS_RM) TAGS
 
 distclean: clean
 
diff --git a/tools/blktap2/control/Makefile b/tools/blktap2/control/Makefile
index c168283..49ec153 100644
--- a/tools/blktap2/control/Makefile
+++ b/tools/blktap2/control/Makefile
@@ -87,7 +87,7 @@ install: build
 	$(INSTALL_DATA) xenblktapctl.pc $(DESTDIR)$(PKG_INSTALLDIR)
 
 clean:
-	rm -f $(OBJS) $(PICS) $(DEPS) $(IBIN) $(LIB_STATIC) $(LIB_SHARED)
+	rm -f $(OBJS) $(PICS) $(DEPS_RM) $(IBIN) $(LIB_STATIC) $(LIB_SHARED)
 	rm -f $(LIBNAME).so $(LIBSONAME)
 	rm -f *~
 	rm -f xenblktapctl.pc
diff --git a/tools/blktap2/lvm/Makefile b/tools/blktap2/lvm/Makefile
index 72fea0a..4a2e2b5 100644
--- a/tools/blktap2/lvm/Makefile
+++ b/tools/blktap2/lvm/Makefile
@@ -29,7 +29,7 @@ lvm-util: lvm-util.o
 	$(CC) -DLVM_UTIL $(LDFLAGS) -o lvm-util lvm-util.c
 
 clean:
-	rm -rf *.o *.opic *~ $(DEPS) $(IBIN)
+	rm -rf *.o *.opic *~ $(DEPS_RM) $(IBIN)
 
 distclean: clean
 
diff --git a/tools/blktap2/vhd/Makefile b/tools/blktap2/vhd/Makefile
index e60b7af..815d151 100644
--- a/tools/blktap2/vhd/Makefile
+++ b/tools/blktap2/vhd/Makefile
@@ -46,7 +46,7 @@ uninstall:
 	rm -f $(addprefix $(DESTDIR)$(INST_DIR)/, $(IBIN))
 
 clean: subdirs-clean
-	rm -rf *.o *~ $(DEPS) $(IBIN)
+	rm -rf *.o *~ $(DEPS_RM) $(IBIN)
 
 distclean: clean
 
diff --git a/tools/blktap2/vhd/lib/Makefile b/tools/blktap2/vhd/lib/Makefile
index 3bf603e..cd2744e 100644
--- a/tools/blktap2/vhd/lib/Makefile
+++ b/tools/blktap2/vhd/lib/Makefile
@@ -79,7 +79,7 @@ uninstall:
 	rm -f $(DESTDIR)$(INST-DIR)/libvhd.a
 
 clean:
-	rm -rf *.a *.so* *.o *.opic *~ $(DEPS) $(LIBVHD)
+	rm -rf *.a *.so* *.o *.opic *~ $(DEPS_RM) $(LIBVHD)
 
 distclean: clean
 
diff --git a/tools/console/Makefile b/tools/console/Makefile
index abe77b2..d1fedc6 100644
--- a/tools/console/Makefile
+++ b/tools/console/Makefile
@@ -19,7 +19,7 @@ all: $(BIN)
 
 .PHONY: clean
 clean:
-	$(RM) *.a *.so *.o *.rpm $(BIN) $(DEPS)
+	$(RM) *.a *.so *.o *.rpm $(BIN) $(DEPS_RM)
 	$(RM) client/*.o daemon/*.o
 	$(RM) client/_paths.h
 	$(RM) daemon/_paths.h
diff --git a/tools/debugger/kdd/Makefile b/tools/debugger/kdd/Makefile
index bcec440a..5509eee 100644
--- a/tools/debugger/kdd/Makefile
+++ b/tools/debugger/kdd/Makefile
@@ -16,7 +16,7 @@ kdd: $(OBJS)
 
 .PHONY: clean
 clean:
-	rm -f $(OBJS) $(DEPS) kdd
+	rm -f $(OBJS) $(DEPS_RM) kdd
 
 .PHONY: distclean
 distclean: clean
diff --git a/tools/firmware/hvmloader/Makefile b/tools/firmware/hvmloader/Makefile
index 7d52ed8..1043823 100644
--- a/tools/firmware/hvmloader/Makefile
+++ b/tools/firmware/hvmloader/Makefile
@@ -116,7 +116,7 @@ endif
 .PHONY: clean
 clean: subdirs-clean
 	rm -f roms.inc roms.inc.new acpi.h
-	rm -f hvmloader hvmloader.tmp *.o $(DEPS)
+	rm -f hvmloader hvmloader.tmp *.o $(DEPS_RM)
 	$(MAKE) -C $(ACPI_PATH)  ACPI_BUILD_DIR=$(CURDIR) clean
 
 .PHONY: distclean
diff --git a/tools/firmware/rombios/32bit/Makefile b/tools/firmware/rombios/32bit/Makefile
index 28c1544..f6e0fd4 100644
--- a/tools/firmware/rombios/32bit/Makefile
+++ b/tools/firmware/rombios/32bit/Makefile
@@ -15,7 +15,7 @@ all: subdirs-all
 
 .PHONY: clean
 clean: subdirs-clean
-	rm -rf *.o $(TARGET) $(DEPS)
+	rm -rf *.o $(TARGET) $(DEPS_RM)
 
 .PHONY: distclean
 distclean: subdirs-distclean
diff --git a/tools/firmware/rombios/32bit/tcgbios/Makefile b/tools/firmware/rombios/32bit/tcgbios/Makefile
index 5cff4ef..c5f9004 100644
--- a/tools/firmware/rombios/32bit/tcgbios/Makefile
+++ b/tools/firmware/rombios/32bit/tcgbios/Makefile
@@ -12,7 +12,7 @@ all: $(TARGET)
 
 .PHONY: clean
 clean:
-	rm -rf *.o $(TARGET) $(DEPS)
+	rm -rf *.o $(TARGET) $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
diff --git a/tools/firmware/rombios/Makefile b/tools/firmware/rombios/Makefile
index 94e65db..2ad165b 100644
--- a/tools/firmware/rombios/Makefile
+++ b/tools/firmware/rombios/Makefile
@@ -13,7 +13,7 @@ clean: subdirs-clean
 	rm -f  as86-sym.txt ld86-sym.txt 
 	rm -f  rombios*.txt rombios*.sym usage biossums
 	rm -f  BIOS-bochs-*
-	rm -f  $(DEPS)
+	rm -f  $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
diff --git a/tools/flask/utils/Makefile b/tools/flask/utils/Makefile
index fc047e9..4c0e052 100644
--- a/tools/flask/utils/Makefile
+++ b/tools/flask/utils/Makefile
@@ -37,7 +37,7 @@ flask-set-bool: set-bool.o
 clean: 
 	rm -f *.o *.opic *.so
 	rm -f $(CLIENTS)
-	$(RM) $(DEPS)
+	$(RM) $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
diff --git a/tools/helpers/Makefile b/tools/helpers/Makefile
index fcfca46..4f3bbe6 100644
--- a/tools/helpers/Makefile
+++ b/tools/helpers/Makefile
@@ -50,7 +50,7 @@ endif
 
 .PHONY: clean
 clean:
-	$(RM) -f *.o $(PROGS) $(DEPS) _paths.h
+	$(RM) -f *.o $(PROGS) $(DEPS_RM) _paths.h
 
 distclean: clean
 
diff --git a/tools/libfsimage/Rules.mk b/tools/libfsimage/Rules.mk
index ee7de44..4d01098 100644
--- a/tools/libfsimage/Rules.mk
+++ b/tools/libfsimage/Rules.mk
@@ -29,6 +29,6 @@ $(FSLIB): $(PIC_OBJS)
 	$(CC) $(LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $^ -lfsimage $(FS_LIBDEPS) $(APPEND_LDFLAGS)
 
 clean distclean::
-	rm -f $(PIC_OBJS) $(FSLIB) $(DEPS)
+	rm -f $(PIC_OBJS) $(FSLIB) $(DEPS_RM)
 
 -include $(DEPS)
diff --git a/tools/libs/call/Makefile b/tools/libs/call/Makefile
index bd3d1f0..1ccd5fd 100644
--- a/tools/libs/call/Makefile
+++ b/tools/libs/call/Makefile
@@ -90,7 +90,7 @@ TAGS:
 
 .PHONY: clean
 clean:
-	rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
+	rm -rf *.rpm $(LIB) *~ $(DEPS_RM) $(LIB_OBJS) $(PIC_OBJS)
 	rm -f libxencall.so.$(MAJOR).$(MINOR) libxencall.so.$(MAJOR)
 	rm -f headers.chk
 	rm -f xencall.pc
diff --git a/tools/libs/devicemodel/Makefile b/tools/libs/devicemodel/Makefile
index e41fd20..f0e1e6c 100644
--- a/tools/libs/devicemodel/Makefile
+++ b/tools/libs/devicemodel/Makefile
@@ -91,7 +91,7 @@ TAGS:
 
 .PHONY: clean
 clean:
-	rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
+	rm -rf *.rpm $(LIB) *~ $(DEPS_RM) $(LIB_OBJS) $(PIC_OBJS)
 	rm -f libxendevicemodel.so.$(MAJOR).$(MINOR) libxendevicemodel.so.$(MAJOR)
 	rm -f headers.chk
 	rm -f xendevicemodel.pc
diff --git a/tools/libs/evtchn/Makefile b/tools/libs/evtchn/Makefile
index c9537ff..5444ec7 100644
--- a/tools/libs/evtchn/Makefile
+++ b/tools/libs/evtchn/Makefile
@@ -89,7 +89,7 @@ TAGS:
 
 .PHONY: clean
 clean:
-	rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
+	rm -rf *.rpm $(LIB) *~ $(DEPS_RM) $(LIB_OBJS) $(PIC_OBJS)
 	rm -f libxenevtchn.so.$(MAJOR).$(MINOR) libxenevtchn.so.$(MAJOR)
 	rm -f headers.chk
 	rm -f xenevtchn.pc
diff --git a/tools/libs/foreignmemory/Makefile b/tools/libs/foreignmemory/Makefile
index b110076..ab7f873 100644
--- a/tools/libs/foreignmemory/Makefile
+++ b/tools/libs/foreignmemory/Makefile
@@ -90,7 +90,7 @@ TAGS:
 
 .PHONY: clean
 clean:
-	rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
+	rm -rf *.rpm $(LIB) *~ $(DEPS_RM) $(LIB_OBJS) $(PIC_OBJS)
 	rm -f libxenforeignmemory.so.$(MAJOR).$(MINOR) libxenforeignmemory.so.$(MAJOR)
 	rm -f headers.chk
 	rm -f xenforeignmemory.pc
diff --git a/tools/libs/gnttab/Makefile b/tools/libs/gnttab/Makefile
index 3363bd5..afb924f 100644
--- a/tools/libs/gnttab/Makefile
+++ b/tools/libs/gnttab/Makefile
@@ -92,7 +92,7 @@ TAGS:
 
 .PHONY: clean
 clean:
-	rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
+	rm -rf *.rpm $(LIB) *~ $(DEPS_RM) $(LIB_OBJS) $(PIC_OBJS)
 	rm -f libxengnttab.so.$(MAJOR).$(MINOR) libxengnttab.so.$(MAJOR)
 	rm -f headers.chk
 	rm -f xengnttab.pc
diff --git a/tools/libs/toollog/Makefile b/tools/libs/toollog/Makefile
index 01619ec..8aae2c8 100644
--- a/tools/libs/toollog/Makefile
+++ b/tools/libs/toollog/Makefile
@@ -84,7 +84,7 @@ TAGS:
 
 .PHONY: clean
 clean:
-	rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
+	rm -rf *.rpm $(LIB) *~ $(DEPS_RM) $(LIB_OBJS) $(PIC_OBJS)
 	rm -f libxentoollog.so.$(MAJOR).$(MINOR) libxentoollog.so.$(MAJOR)
 	rm -f headers.chk
 	rm -f xentoollog.pc
diff --git a/tools/libvchan/Makefile b/tools/libvchan/Makefile
index 277c1c0..4a7e018 100644
--- a/tools/libvchan/Makefile
+++ b/tools/libvchan/Makefile
@@ -81,7 +81,7 @@ uninstall:
 
 .PHONY: clean
 clean:
-	$(RM) -f *.o *.opic *.so* *.a vchan-node1 vchan-node2 $(DEPS)
+	$(RM) -f *.o *.opic *.so* *.a vchan-node1 vchan-node2 $(DEPS_RM)
 	$(RM) -f xenvchan.pc
 
 distclean: clean
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 83e3416..9ae80a7 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -225,7 +225,7 @@ TAGS:
 
 .PHONY: clean
 clean:
-	rm -rf *.rpm $(LIB) *~ $(DEPS) \
+	rm -rf *.rpm $(LIB) *~ $(DEPS_RM) \
             _paths.h \
 	    xencontrol.pc xenguest.pc \
             $(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS) \
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 082af8f..bf48897 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -343,7 +343,7 @@ uninstall:
 
 .PHONY: clean
 clean:
-	$(RM) -f _*.h *.o *.so* *.a $(CLIENTS) $(DEPS)
+	$(RM) -f _*.h *.o *.so* *.a $(CLIENTS) $(DEPS_RM)
 	$(RM) -f _*.c *.pyc _paths.*.tmp _*.api-for-check
 	$(RM) -f testidl.c.new testidl.c *.api-ok
 	$(RM) -f xenlight.pc
diff --git a/tools/memshr/Makefile b/tools/memshr/Makefile
index cb5ea61..6321bdd 100644
--- a/tools/memshr/Makefile
+++ b/tools/memshr/Makefile
@@ -39,7 +39,7 @@ install: all
 uninstall:
 
 clean:
-	rm -rf *.a *.o *~ $(DEPS)
+	rm -rf *.a *.o *~ $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
diff --git a/tools/misc/Makefile b/tools/misc/Makefile
index 54f6e2e..af579a7 100644
--- a/tools/misc/Makefile
+++ b/tools/misc/Makefile
@@ -70,7 +70,7 @@ uninstall:
 
 .PHONY: clean
 clean:
-	$(RM) *.o $(TARGETS_BUILD) *~ $(DEPS)
+	$(RM) *.o $(TARGETS_BUILD) *~ $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
diff --git a/tools/pygrub/Makefile b/tools/pygrub/Makefile
index 3a6074b..acdab8a 100644
--- a/tools/pygrub/Makefile
+++ b/tools/pygrub/Makefile
@@ -33,7 +33,7 @@ uninstall:
 
 .PHONY: clean
 clean:
-	rm -rf build tmp *.pyc *.pyo *.o *.a *~ a.out $(INSTALL_LOG) $(DEPS)
+	rm -rf build tmp *.pyc *.pyo *.o *.a *~ a.out $(INSTALL_LOG) $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
diff --git a/tools/python/Makefile b/tools/python/Makefile
index e7a3c51..012358b 100644
--- a/tools/python/Makefile
+++ b/tools/python/Makefile
@@ -39,7 +39,7 @@ test:
 clean:
 	find . \( -name "*.py[ocd]" -o -name "*~" -o -name "_*.[hc]" \) -delete
 	rm -rf build/
-	rm -f $(DEPS)
+	rm -f $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
diff --git a/tools/tests/mem-sharing/Makefile b/tools/tests/mem-sharing/Makefile
index d89e283..5d46a3b 100644
--- a/tools/tests/mem-sharing/Makefile
+++ b/tools/tests/mem-sharing/Makefile
@@ -18,7 +18,7 @@ build: $(TARGETS)
 
 .PHONY: clean
 clean:
-	$(RM) *.o $(TARGETS) *~ $(DEPS)
+	$(RM) *.o $(TARGETS) *~ $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
diff --git a/tools/tests/xen-access/Makefile b/tools/tests/xen-access/Makefile
index e11f639..fc6555c 100644
--- a/tools/tests/xen-access/Makefile
+++ b/tools/tests/xen-access/Makefile
@@ -20,7 +20,7 @@ build: $(TARGETS)
 
 .PHONY: clean
 clean:
-	$(RM) *.o $(TARGETS) *~ $(DEPS)
+	$(RM) *.o $(TARGETS) *~ $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
diff --git a/tools/tests/xenstore/Makefile b/tools/tests/xenstore/Makefile
index 6c85f98..dc53519 100644
--- a/tools/tests/xenstore/Makefile
+++ b/tools/tests/xenstore/Makefile
@@ -16,7 +16,7 @@ build: $(TARGETS)
 
 .PHONY: clean
 clean:
-	$(RM) *.o $(TARGETS) *~ $(DEPS)
+	$(RM) *.o $(TARGETS) *~ $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
diff --git a/tools/xcutils/Makefile b/tools/xcutils/Makefile
index 6bc9062..173182f 100644
--- a/tools/xcutils/Makefile
+++ b/tools/xcutils/Makefile
@@ -43,7 +43,7 @@ uninstall:
 .PHONY: clean
 clean:
 	$(RM) *.o $(PROGRAMS)
-	$(RM) $(DEPS)
+	$(RM) $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
diff --git a/tools/xenbackendd/Makefile b/tools/xenbackendd/Makefile
index 80ac7f4..36c6c6c 100644
--- a/tools/xenbackendd/Makefile
+++ b/tools/xenbackendd/Makefile
@@ -30,7 +30,7 @@ install: build
 
 .PHONY: clean
 clean:
-	$(RM) *.a *.so *.o $(DEPS) xenbackendd _paths.h
+	$(RM) *.a *.so *.o $(DEPS_RM) xenbackendd _paths.h
 
 .PHONY: distclean
 distclean: clean
diff --git a/tools/xenmon/Makefile b/tools/xenmon/Makefile
index 537c176..b547621 100644
--- a/tools/xenmon/Makefile
+++ b/tools/xenmon/Makefile
@@ -42,7 +42,7 @@ uninstall:
 
 .PHONY: clean
 clean:
-	$(RM) -f $(DEPS)
+	$(RM) -f $(DEPS_RM)
 	$(RM) -f xenbaked xenbaked.o
 	$(RM) -f xentrace_setmask setmask.o
 
diff --git a/tools/xenpaging/Makefile b/tools/xenpaging/Makefile
index ba083ca..7b84c85 100644
--- a/tools/xenpaging/Makefile
+++ b/tools/xenpaging/Makefile
@@ -32,7 +32,7 @@ uninstall:
 	rm -f $(addprefix $(DESTDIR)$(LIBEXEC_BIN)/, $(IBINS))
 
 clean:
-	rm -f *.o *~ $(DEPS) xen TAGS $(IBINS) $(LIB)
+	rm -f *.o *~ $(DEPS_RM) xen TAGS $(IBINS) $(LIB)
 
 distclean: clean
 
diff --git a/tools/xenpmd/Makefile b/tools/xenpmd/Makefile
index e0d0697..9d677b8 100644
--- a/tools/xenpmd/Makefile
+++ b/tools/xenpmd/Makefile
@@ -16,7 +16,7 @@ install: all
 
 .PHONY: clean
 clean:
-	$(RM) -f xenpmd xenpmd.o $(DEPS)
+	$(RM) -f xenpmd xenpmd.o $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
diff --git a/tools/xenstat/libxenstat/Makefile b/tools/xenstat/libxenstat/Makefile
index 4b94d81..d6a4268 100644
--- a/tools/xenstat/libxenstat/Makefile
+++ b/tools/xenstat/libxenstat/Makefile
@@ -178,7 +178,7 @@ endif
 .PHONY: clean
 clean:
 	rm -f $(LIB) $(SHLIB) $(SHLIB_LINKS) $(OBJECTS-y) \
-	      $(BINDINGS) $(BINDINGSRC) $(DEPS) src/_paths.h
+	      $(BINDINGS) $(BINDINGSRC) $(DEPS_RM) src/_paths.h
 	rm -f xenstat.pc
 
 .PHONY: distclean
diff --git a/tools/xenstat/xentop/Makefile b/tools/xenstat/xentop/Makefile
index 2e156f1..ca34135 100644
--- a/tools/xenstat/xentop/Makefile
+++ b/tools/xenstat/xentop/Makefile
@@ -42,7 +42,7 @@ endif
 
 .PHONY: clean
 clean:
-	rm -f xentop xentop.o $(DEPS)
+	rm -f xentop xentop.o $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index 108c942..a6c8ed1 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -132,7 +132,7 @@ clean:
 	rm -f xs_tdb_dump xenstore-control init-xenstore-domain
 	rm -f xenstore $(CLIENTS)
 	rm -f xenstore.pc
-	$(RM) $(DEPS)
+	$(RM) $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
diff --git a/tools/xentrace/Makefile b/tools/xentrace/Makefile
index bcd8f5b..67ed076 100644
--- a/tools/xentrace/Makefile
+++ b/tools/xentrace/Makefile
@@ -44,7 +44,7 @@ endif
 
 .PHONY: clean
 clean:
-	$(RM) *.a *.so *.o *.rpm $(BIN) $(SBIN) $(LIBBIN) $(DEPS)
+	$(RM) *.a *.so *.o *.rpm $(BIN) $(SBIN) $(LIBBIN) $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
diff --git a/tools/xl/Makefile b/tools/xl/Makefile
index c868899..8aa8e72 100644
--- a/tools/xl/Makefile
+++ b/tools/xl/Makefile
@@ -51,7 +51,7 @@ uninstall:
 
 .PHONY: clean
 clean:
-	$(RM) -f *.o xl _paths.h $(DEPS)
+	$(RM) -f *.o xl _paths.h $(DEPS_RM)
 
 distclean: clean
 
diff --git a/xen/Rules.mk b/xen/Rules.mk
index 77bcd44..01aabfe 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -166,7 +166,7 @@ FORCE:
 
 .PHONY: clean
 clean:: $(addprefix _clean_, $(subdir-all))
-	rm -f *.o *~ core $(DEPS)
+	rm -f *.o *~ core $(DEPS_RM)
 _clean_%/: FORCE
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C $* clean
 
diff --git a/xen/xsm/flask/Makefile b/xen/xsm/flask/Makefile
index 898cc20..e22ed7c 100644
--- a/xen/xsm/flask/Makefile
+++ b/xen/xsm/flask/Makefile
@@ -41,4 +41,4 @@ policy.c: policy.bin gen-policy.py
 
 .PHONY: clean
 clean::
-	rm -f $(ALL_H_FILES) *.o $(DEPS) policy.* $(POLICY_SRC)
+	rm -f $(ALL_H_FILES) *.o $(DEPS_RM) policy.* $(POLICY_SRC)
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 3/4] DEPS handling: Use DEPS_INCLUDE everywhere
  2017-09-04 16:46                   ` [PATCH 1/4] DEPS handling: Provide DEPS_RM and DEPS_INCLUDE Ian Jackson
  2017-09-04 16:46                     ` [PATCH 2/4] DEPS handling: Use DEPS_RM everywhere Ian Jackson
@ 2017-09-04 16:46                     ` Ian Jackson
  2017-09-04 16:46                     ` [PATCH 4/4] DEPS handling: Remove absolute paths from references to cwd Ian Jackson
  2 siblings, 0 replies; 18+ messages in thread
From: Ian Jackson @ 2017-09-04 16:46 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Wei Liu, Jan Beulich

DEPS_INCLUDE is currently the same as DEPS, so no functional change.

This patch is the result of this perl rune:

  git-grep -l 'include.*DEPS' | xargs perl -i -pe 'next unless m/^-?include/; s/\bDEPS\b/DEPS_INCLUDE/'

I have verified that I haven't missed anything, with this rune:

  git-grep '\bDEPS\b'

Reported-by: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/blktap2/control/Makefile                | 2 +-
 tools/blktap2/lvm/Makefile                    | 2 +-
 tools/blktap2/vhd/Makefile                    | 2 +-
 tools/blktap2/vhd/lib/Makefile                | 2 +-
 tools/console/Makefile                        | 2 +-
 tools/firmware/hvmloader/Makefile             | 2 +-
 tools/firmware/rombios/32bit/Makefile         | 2 +-
 tools/firmware/rombios/32bit/tcgbios/Makefile | 2 +-
 tools/firmware/rombios/Makefile               | 2 +-
 tools/flask/utils/Makefile                    | 2 +-
 tools/golang/xenlight/Makefile                | 2 +-
 tools/libacpi/Makefile                        | 2 +-
 tools/libfsimage/Rules.mk                     | 2 +-
 tools/libfsimage/common/Makefile              | 2 +-
 tools/libvchan/Makefile                       | 2 +-
 tools/libxc/Makefile                          | 2 +-
 tools/libxl/Makefile                          | 2 +-
 tools/memshr/Makefile                         | 2 +-
 tools/misc/Makefile                           | 2 +-
 tools/pygrub/Makefile                         | 2 +-
 tools/python/Makefile                         | 2 +-
 tools/tests/mem-sharing/Makefile              | 2 +-
 tools/tests/xen-access/Makefile               | 2 +-
 tools/tests/xenstore/Makefile                 | 2 +-
 tools/xcutils/Makefile                        | 2 +-
 tools/xenbackendd/Makefile                    | 2 +-
 tools/xenmon/Makefile                         | 2 +-
 tools/xenpaging/Makefile                      | 2 +-
 tools/xenpmd/Makefile                         | 2 +-
 tools/xenstat/libxenstat/Makefile             | 2 +-
 tools/xenstat/xentop/Makefile                 | 2 +-
 tools/xenstore/Makefile                       | 2 +-
 tools/xentrace/Makefile                       | 2 +-
 tools/xl/Makefile                             | 2 +-
 xen/Rules.mk                                  | 2 +-
 35 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/tools/blktap2/control/Makefile b/tools/blktap2/control/Makefile
index 49ec153..1ea5df8 100644
--- a/tools/blktap2/control/Makefile
+++ b/tools/blktap2/control/Makefile
@@ -104,4 +104,4 @@ distclean: clean
 
 .PHONY: all build clean distclean install uninstall
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/blktap2/lvm/Makefile b/tools/blktap2/lvm/Makefile
index 4a2e2b5..9ea6969 100644
--- a/tools/blktap2/lvm/Makefile
+++ b/tools/blktap2/lvm/Makefile
@@ -35,4 +35,4 @@ distclean: clean
 
 .PHONY: all build clean distclean install lvm-util uninstall
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/blktap2/vhd/Makefile b/tools/blktap2/vhd/Makefile
index 815d151..9c4ee83 100644
--- a/tools/blktap2/vhd/Makefile
+++ b/tools/blktap2/vhd/Makefile
@@ -52,4 +52,4 @@ distclean: clean
 
 .PHONY: all build clean distclean install uninstall vhd-util vhd-update
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/blktap2/vhd/lib/Makefile b/tools/blktap2/vhd/lib/Makefile
index cd2744e..c4e9ec5 100644
--- a/tools/blktap2/vhd/lib/Makefile
+++ b/tools/blktap2/vhd/lib/Makefile
@@ -85,4 +85,4 @@ distclean: clean
 
 .PHONY: all build clean distclean install libvhd uninstall
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/console/Makefile b/tools/console/Makefile
index d1fedc6..c5f3f5c 100644
--- a/tools/console/Makefile
+++ b/tools/console/Makefile
@@ -54,4 +54,4 @@ uninstall:
 	rm -f $(DESTDIR)$(LIBEXEC_BIN)/xenconsole
 	rm -f $(DESTDIR)$(sbindir)/xenconsoled
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/firmware/hvmloader/Makefile b/tools/firmware/hvmloader/Makefile
index 1043823..7c4c0ce 100644
--- a/tools/firmware/hvmloader/Makefile
+++ b/tools/firmware/hvmloader/Makefile
@@ -122,4 +122,4 @@ clean: subdirs-clean
 .PHONY: distclean
 distclean: clean
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/firmware/rombios/32bit/Makefile b/tools/firmware/rombios/32bit/Makefile
index f6e0fd4..c058c71 100644
--- a/tools/firmware/rombios/32bit/Makefile
+++ b/tools/firmware/rombios/32bit/Makefile
@@ -32,4 +32,4 @@ $(TARGET): 32bitbios_all.o
 	    exit 11;                                         \
 	  } || :
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/firmware/rombios/32bit/tcgbios/Makefile b/tools/firmware/rombios/32bit/tcgbios/Makefile
index c5f9004..4dbc713 100644
--- a/tools/firmware/rombios/32bit/tcgbios/Makefile
+++ b/tools/firmware/rombios/32bit/tcgbios/Makefile
@@ -20,4 +20,4 @@ distclean: clean
 $(TARGET): tcgbios.o tpm_drivers.o
 	$(LD) $(LDFLAGS_DIRECT) -r $^ -o $@
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/firmware/rombios/Makefile b/tools/firmware/rombios/Makefile
index 2ad165b..78237fd 100644
--- a/tools/firmware/rombios/Makefile
+++ b/tools/firmware/rombios/Makefile
@@ -31,4 +31,4 @@ BIOS-bochs-latest: rombios.c biossums 32bitgateway.c tcgbios.c
 biossums: biossums.c
 	gcc -o biossums biossums.c
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/flask/utils/Makefile b/tools/flask/utils/Makefile
index 4c0e052..ae87102 100644
--- a/tools/flask/utils/Makefile
+++ b/tools/flask/utils/Makefile
@@ -59,4 +59,4 @@ install: all
 uninstall:
 	rm -f $(addprefix $(DESTDIR)$(sbindir)/, $(CLIENTS))
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/golang/xenlight/Makefile b/tools/golang/xenlight/Makefile
index 88202a6..0987305 100644
--- a/tools/golang/xenlight/Makefile
+++ b/tools/golang/xenlight/Makefile
@@ -49,4 +49,4 @@ clean:
 .PHONY: distclean
 distclean: clean
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/libacpi/Makefile b/tools/libacpi/Makefile
index fd7af1b..a47a658 100644
--- a/tools/libacpi/Makefile
+++ b/tools/libacpi/Makefile
@@ -102,4 +102,4 @@ distclean: clean
 
 install: all
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/libfsimage/Rules.mk b/tools/libfsimage/Rules.mk
index 4d01098..eab4ecb 100644
--- a/tools/libfsimage/Rules.mk
+++ b/tools/libfsimage/Rules.mk
@@ -31,4 +31,4 @@ $(FSLIB): $(PIC_OBJS)
 clean distclean::
 	rm -f $(PIC_OBJS) $(FSLIB) $(DEPS_RM)
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/libfsimage/common/Makefile b/tools/libfsimage/common/Makefile
index af6f67e..0791fc9 100644
--- a/tools/libfsimage/common/Makefile
+++ b/tools/libfsimage/common/Makefile
@@ -51,5 +51,5 @@ libfsimage.so.$(MAJOR): libfsimage.so.$(MAJOR).$(MINOR)
 libfsimage.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
 	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libfsimage.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
 
diff --git a/tools/libvchan/Makefile b/tools/libvchan/Makefile
index 4a7e018..ca9fc63 100644
--- a/tools/libvchan/Makefile
+++ b/tools/libvchan/Makefile
@@ -86,4 +86,4 @@ clean:
 
 distclean: clean
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 9ae80a7..9a019e8 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -280,5 +280,5 @@ libxenguest.so.$(MAJOR).$(MINOR): COMPRESSION_LIBS = $(filter -l%,$(zlib-options
 libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so
 	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(GUEST_PIC_OBJS) $(COMPRESSION_LIBS) -lz $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
 
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index bf48897..74c70ab 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -355,4 +355,4 @@ distclean: clean
 realclean: distclean
 	$(RM) -f $(AUTOSRCS) $(AUTOINCS)
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/memshr/Makefile b/tools/memshr/Makefile
index 6321bdd..31d2dd7 100644
--- a/tools/memshr/Makefile
+++ b/tools/memshr/Makefile
@@ -46,4 +46,4 @@ distclean: clean
 
 .PHONY: all build clean install distclean uninstall
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/misc/Makefile b/tools/misc/Makefile
index af579a7..eaa2879 100644
--- a/tools/misc/Makefile
+++ b/tools/misc/Makefile
@@ -118,4 +118,4 @@ xen-lowmemd: xen-lowmemd.o
 xencov: xencov.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/pygrub/Makefile b/tools/pygrub/Makefile
index acdab8a..536af07 100644
--- a/tools/pygrub/Makefile
+++ b/tools/pygrub/Makefile
@@ -38,4 +38,4 @@ clean:
 .PHONY: distclean
 distclean: clean
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/python/Makefile b/tools/python/Makefile
index 012358b..541858e 100644
--- a/tools/python/Makefile
+++ b/tools/python/Makefile
@@ -44,4 +44,4 @@ clean:
 .PHONY: distclean
 distclean: clean
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/tests/mem-sharing/Makefile b/tools/tests/mem-sharing/Makefile
index 5d46a3b..497696f 100644
--- a/tools/tests/mem-sharing/Makefile
+++ b/tools/tests/mem-sharing/Makefile
@@ -26,4 +26,4 @@ distclean: clean
 memshrtool: memshrtool.o
 	$(CC) -o $@ $< $(LDFLAGS) $(LDLIBS_libxenctrl)
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/tests/xen-access/Makefile b/tools/tests/xen-access/Makefile
index fc6555c..0ca3f6f 100644
--- a/tools/tests/xen-access/Makefile
+++ b/tools/tests/xen-access/Makefile
@@ -28,4 +28,4 @@ distclean: clean
 xen-access: xen-access.o Makefile
 	$(CC) -o $@ $< $(LDFLAGS) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenevtchn)
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/tests/xenstore/Makefile b/tools/tests/xenstore/Makefile
index dc53519..b37b90d 100644
--- a/tools/tests/xenstore/Makefile
+++ b/tools/tests/xenstore/Makefile
@@ -24,4 +24,4 @@ distclean: clean
 xs-test: xs-test.o Makefile
 	$(CC) -o $@ $< $(LDFLAGS) $(LDLIBS_libxenstore)
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/xcutils/Makefile b/tools/xcutils/Makefile
index 173182f..2811893 100644
--- a/tools/xcutils/Makefile
+++ b/tools/xcutils/Makefile
@@ -48,4 +48,4 @@ clean:
 .PHONY: distclean
 distclean: clean
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/xenbackendd/Makefile b/tools/xenbackendd/Makefile
index 36c6c6c..ba53bbf 100644
--- a/tools/xenbackendd/Makefile
+++ b/tools/xenbackendd/Makefile
@@ -42,4 +42,4 @@ xenbackendd: xenbackendd.o
 genpath-target = $(call buildmakevars2header,_paths.h)
 $(eval $(genpath-target))
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/xenmon/Makefile b/tools/xenmon/Makefile
index b547621..e45c5b8 100644
--- a/tools/xenmon/Makefile
+++ b/tools/xenmon/Makefile
@@ -55,4 +55,4 @@ xenbaked: xenbaked.o Makefile
 xentrace_setmask: setmask.o Makefile
 	$(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) $(APPEND_LDFLAGS)
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/xenpaging/Makefile b/tools/xenpaging/Makefile
index 7b84c85..968678c 100644
--- a/tools/xenpaging/Makefile
+++ b/tools/xenpaging/Makefile
@@ -42,4 +42,4 @@ distclean: clean
 TAGS:
 	etags -t $(SRCS) *.h
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/xenpmd/Makefile b/tools/xenpmd/Makefile
index 9d677b8..e0d3f06 100644
--- a/tools/xenpmd/Makefile
+++ b/tools/xenpmd/Makefile
@@ -28,4 +28,4 @@ uninstall:
 xenpmd: xenpmd.o Makefile
 	$(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) $(APPEND_LDFLAGS)
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/xenstat/libxenstat/Makefile b/tools/xenstat/libxenstat/Makefile
index d6a4268..8979fa1 100644
--- a/tools/xenstat/libxenstat/Makefile
+++ b/tools/xenstat/libxenstat/Makefile
@@ -184,7 +184,7 @@ clean:
 .PHONY: distclean
 distclean: clean
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
 
 genpath-target = $(call buildmakevars2header,src/_paths.h)
 $(eval $(genpath-target))
diff --git a/tools/xenstat/xentop/Makefile b/tools/xenstat/xentop/Makefile
index ca34135..ec612db 100644
--- a/tools/xenstat/xentop/Makefile
+++ b/tools/xenstat/xentop/Makefile
@@ -47,4 +47,4 @@ clean:
 .PHONY: distclean
 distclean: clean
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index a6c8ed1..ff428e2 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -211,7 +211,7 @@ clients-install: clients
 		ln -f $(DESTDIR)$(bindir)/xenstore $(DESTDIR)$(bindir)/$${c} ; \
 	done
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
 
 # never delete any intermediate files.
 .SECONDARY:
diff --git a/tools/xentrace/Makefile b/tools/xentrace/Makefile
index 67ed076..0bad942 100644
--- a/tools/xentrace/Makefile
+++ b/tools/xentrace/Makefile
@@ -61,5 +61,5 @@ xentrace_setsize: setsize.o
 xenalyze: xenalyze.o mread.o
 	$(CC) $(LDFLAGS) -o $@ $^ $(ARGP_LDFLAGS) $(APPEND_LDFLAGS)
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
 
diff --git a/tools/xl/Makefile b/tools/xl/Makefile
index 8aa8e72..bafd5a8 100644
--- a/tools/xl/Makefile
+++ b/tools/xl/Makefile
@@ -56,4 +56,4 @@ clean:
 distclean: clean
 
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
diff --git a/xen/Rules.mk b/xen/Rules.mk
index 01aabfe..cafc67b 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -204,4 +204,4 @@ $(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): %.init.o: %.o Makefile
 %.s: %.S Makefile
 	$(CPP) $(AFLAGS) $< -o $@
 
--include $(DEPS)
+-include $(DEPS_INCLUDE)
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 4/4] DEPS handling: Remove absolute paths from references to cwd
  2017-09-04 16:46                   ` [PATCH 1/4] DEPS handling: Provide DEPS_RM and DEPS_INCLUDE Ian Jackson
  2017-09-04 16:46                     ` [PATCH 2/4] DEPS handling: Use DEPS_RM everywhere Ian Jackson
  2017-09-04 16:46                     ` [PATCH 3/4] DEPS handling: Use DEPS_INCLUDE everywhere Ian Jackson
@ 2017-09-04 16:46                     ` Ian Jackson
  2017-09-05 14:44                       ` Jan Beulich
  2 siblings, 1 reply; 18+ messages in thread
From: Ian Jackson @ 2017-09-04 16:46 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Wei Liu, Jan Beulich

In some directories we use gcc on source files elsewhere, to generate
a .o here in the current directory.  Eg in tools/libxl/,
   gcc -I -o build.o /path/to/libacpi/build.c
We pass -MMD and -MF options to generate a .d file right here.

In the general case this .c file might need to include things from the
directory here, eg libacpi/build.c eventually #includes various
*libxl*.h.  We pass gcc -I. for this, which means things from the cwd
where we invoked gcc, not the directory of the #including file.

When we do this, gcc's -MMD output mentions /path/to/libxl/*libxl*.h,
even though it could refer to simply *libxl*.h.  This is presumably
because gcc has noticed that `.' in this context must mean relative to
the invocation cwd, not relative to build.c, and gcc doesn't realise
that references in the .d file are also wrt the invocation cwd.

make distinguishes targets purely textually.  It will canonicalise a
target name by removing ./ before comparison (so _libxl_types.h and
./_libxl_types.h are considered the same target) but it won't examine
the filesystem.  So _libxl_types.h and
/path/to/tools/libxl/_libxl_types.h are different targets.

And, _libxl_types.h is generated from a pattern rule.  This pattern
rule is therefore instatiated twice, and the two instances may be run
concurrently - but use the same tempfiles and can therefore fail.

The thing that is wrong here is gcc's choice to output an absolute
path.

We could work around it by adding a rule to teach make about a
relationship between these `two different files'.  But this has to be
done for every autogenerated file and is therefore fragile (leaving a
race bug when we get it wrong).

Ideally we would fix the problem by fixing the .d file as it is
generated.  But the .d files are generated by many many rules
mentioning $(CC) and $(CFLAGS).  (We might in theory pass a bash
process substitution to -MF, but 1. that's not portable to people who
don't have bash and 2. it hangs, anyway.)

So instead we do this conversion at include time.  That is, we tell
make to include not the raw .d files, but the sedded ones.

The sedding removes occurrences of ` $PWD/'.  We use the shell
variable PWD because the make variable sometimes refers to the xen
toplevel.  If gcc's output format should change, then this sed rune
may not work any more, but that doesn't seem very likely.

The rune is only effective for dependencies on files which are exactly
in the current directory, or a subdirectory of it named simply by its
subdirectory name.  If there are autogenerated include files which
exist in a sibling (or worse, somewhere completely else), this
approach will not work, because we'd have to figure out what name this
Makefile usually uses to refer to them.  Hopefully such things don't
exist.

The indirect variables DEPS_RM and DEPS_INCLUDE are necessary to
preserve the assumptions made in the various Makefiles.  Specifically,
xen/ Makefiles assume that it is ok to say DEPS+=something (where
something is in a subdirectory); tools/ Makefiles all used to include
DEPS themselves (but now they include DEPS_INCLUDE); and many
Makefiles tended to explictly rm DEPS (but now rm DEPS_RM).

In the new scheme of things: DEPS is the files that come out of gcc
(or perhaps an assembler or something) and may be assigned to by
Makefiles.  DEPS_INCLUDE is the processed form.  And DEPS_RM is both
combined, so that they both get cleaned.

We need to explicitly use $(wildcard ) to do the wildcard expansion on
DEPS a bit earlier.  If we didn't, then DEPS_INCLUDE would contain
`.*.d2' which would not exist.

Evaluation order: DEPS_RM and DEPS_INCLUDE are recursively expanded
variables, so that although they are defined early (in Config.mk),
their actual values are computed at the time of use, using the value
of DEPS that is prevailing at that time.

Reported-by: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 .gitignore | 2 ++
 Config.mk  | 7 +++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index 594ffd9..ecb198f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,9 +1,11 @@
 .hg
+.*.tmp
 *.orig
 *~
 *.swp
 *.o
 *.d
+*.d2
 *.opic
 *.a
 *.so
diff --git a/Config.mk b/Config.mk
index 5aca4bf..bba81be 100644
--- a/Config.mk
+++ b/Config.mk
@@ -56,8 +56,11 @@ HOSTCC ?= clang
 HOSTCXX ?= clang++
 endif
 
-DEPS_RM = $(DEPS)
-DEPS_INCLUDE = $(DEPS)
+DEPS_INCLUDE = $(addsuffix .d2, $(basename $(wildcard $(DEPS))))
+DEPS_RM = $(DEPS) $(DEPS_INCLUDE)
+
+%.d2: %.d
+	sed "s! $$PWD/! !" $^ >$@.tmp && mv -f $@.tmp $@
 
 include $(XEN_ROOT)/config/$(XEN_OS).mk
 include $(XEN_ROOT)/config/$(XEN_TARGET_ARCH).mk
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/4] DEPS handling: Remove absolute paths from references to cwd
  2017-09-04 16:46                     ` [PATCH 4/4] DEPS handling: Remove absolute paths from references to cwd Ian Jackson
@ 2017-09-05 14:44                       ` Jan Beulich
  2017-09-05 15:32                         ` Ian Jackson
  0 siblings, 1 reply; 18+ messages in thread
From: Jan Beulich @ 2017-09-05 14:44 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel, Wei Liu

>>> On 04.09.17 at 18:46, <ian.jackson@eu.citrix.com> wrote:
> In some directories we use gcc on source files elsewhere, to generate
> a .o here in the current directory.  Eg in tools/libxl/,
>    gcc -I -o build.o /path/to/libacpi/build.c
> We pass -MMD and -MF options to generate a .d file right here.
> 
> In the general case this .c file might need to include things from the
> directory here, eg libacpi/build.c eventually #includes various
> *libxl*.h.  We pass gcc -I. for this, which means things from the cwd
> where we invoked gcc, not the directory of the #including file.
> 
> When we do this, gcc's -MMD output mentions /path/to/libxl/*libxl*.h,
> even though it could refer to simply *libxl*.h.  This is presumably
> because gcc has noticed that `.' in this context must mean relative to
> the invocation cwd, not relative to build.c, and gcc doesn't realise
> that references in the .d file are also wrt the invocation cwd.
> 
> make distinguishes targets purely textually.  It will canonicalise a
> target name by removing ./ before comparison (so _libxl_types.h and
> ./_libxl_types.h are considered the same target) but it won't examine
> the filesystem.  So _libxl_types.h and
> /path/to/tools/libxl/_libxl_types.h are different targets.
> 
> And, _libxl_types.h is generated from a pattern rule.  This pattern
> rule is therefore instatiated twice, and the two instances may be run
> concurrently - but use the same tempfiles and can therefore fail.
> 
> The thing that is wrong here is gcc's choice to output an absolute
> path.
> 
> We could work around it by adding a rule to teach make about a
> relationship between these `two different files'.  But this has to be
> done for every autogenerated file and is therefore fragile (leaving a
> race bug when we get it wrong).
> 
> Ideally we would fix the problem by fixing the .d file as it is
> generated.  But the .d files are generated by many many rules
> mentioning $(CC) and $(CFLAGS).  (We might in theory pass a bash
> process substitution to -MF, but 1. that's not portable to people who
> don't have bash and 2. it hangs, anyway.)
> 
> So instead we do this conversion at include time.  That is, we tell
> make to include not the raw .d files, but the sedded ones.
> 
> The sedding removes occurrences of ` $PWD/'.  We use the shell
> variable PWD because the make variable sometimes refers to the xen
> toplevel.  If gcc's output format should change, then this sed rune
> may not work any more, but that doesn't seem very likely.
> 
> The rune is only effective for dependencies on files which are exactly
> in the current directory, or a subdirectory of it named simply by its
> subdirectory name.  If there are autogenerated include files which
> exist in a sibling (or worse, somewhere completely else), this
> approach will not work, because we'd have to figure out what name this
> Makefile usually uses to refer to them.  Hopefully such things don't
> exist.
> 
> The indirect variables DEPS_RM and DEPS_INCLUDE are necessary to
> preserve the assumptions made in the various Makefiles.  Specifically,
> xen/ Makefiles assume that it is ok to say DEPS+=something (where
> something is in a subdirectory); tools/ Makefiles all used to include
> DEPS themselves (but now they include DEPS_INCLUDE); and many
> Makefiles tended to explictly rm DEPS (but now rm DEPS_RM).
> 
> In the new scheme of things: DEPS is the files that come out of gcc
> (or perhaps an assembler or something) and may be assigned to by
> Makefiles.  DEPS_INCLUDE is the processed form.  And DEPS_RM is both
> combined, so that they both get cleaned.
> 
> We need to explicitly use $(wildcard ) to do the wildcard expansion on
> DEPS a bit earlier.  If we didn't, then DEPS_INCLUDE would contain
> `.*.d2' which would not exist.
> 
> Evaluation order: DEPS_RM and DEPS_INCLUDE are recursively expanded
> variables, so that although they are defined early (in Config.mk),
> their actual values are computed at the time of use, using the value
> of DEPS that is prevailing at that time.
> 
> Reported-by: Jan Beulich <JBeulich@suse.com>
> CC: Wei Liu <wei.liu2@citrix.com>
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>
(also extending to the non-tools parts of patches 1-3) with
one question:

> --- a/Config.mk
> +++ b/Config.mk
> @@ -56,8 +56,11 @@ HOSTCC ?= clang
>  HOSTCXX ?= clang++
>  endif
>  
> -DEPS_RM = $(DEPS)
> -DEPS_INCLUDE = $(DEPS)
> +DEPS_INCLUDE = $(addsuffix .d2, $(basename $(wildcard $(DEPS))))
> +DEPS_RM = $(DEPS) $(DEPS_INCLUDE)
> +
> +%.d2: %.d

Wouldn't it be better to use .%.d2 and .%.d here?

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/4] DEPS handling: Remove absolute paths from references to cwd
  2017-09-05 14:44                       ` Jan Beulich
@ 2017-09-05 15:32                         ` Ian Jackson
  2017-09-05 15:53                           ` Jan Beulich
  0 siblings, 1 reply; 18+ messages in thread
From: Ian Jackson @ 2017-09-05 15:32 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel, Wei Liu

Jan Beulich writes ("Re: [PATCH 4/4] DEPS handling: Remove absolute paths from references to cwd"):
> On 04.09.17 at 18:46, <ian.jackson@eu.citrix.com> wrote:
> > +%.d2: %.d
> 
> Wouldn't it be better to use .%.d2 and .%.d here?

Perhaps.  That makes the assumption that nothing anywhere adds
anything to DEPS which does not match `.*.d'

My formulation makes a smaller assumption about DEPS (nothing adds
anything not ending with .d) but a larger assumption about .d (there
are no Makefile pattern targets which use .d for other purposes).

I think the 2nd assumption is reasonable and the expanded 1st
assumption is questionable.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/4] DEPS handling: Remove absolute paths from references to cwd
  2017-09-05 15:32                         ` Ian Jackson
@ 2017-09-05 15:53                           ` Jan Beulich
  0 siblings, 0 replies; 18+ messages in thread
From: Jan Beulich @ 2017-09-05 15:53 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel, Wei Liu

>>> On 05.09.17 at 17:32, <ian.jackson@eu.citrix.com> wrote:
> Jan Beulich writes ("Re: [PATCH 4/4] DEPS handling: Remove absolute paths 
> from references to cwd"):
>> On 04.09.17 at 18:46, <ian.jackson@eu.citrix.com> wrote:
>> > +%.d2: %.d
>> 
>> Wouldn't it be better to use .%.d2 and .%.d here?
> 
> Perhaps.  That makes the assumption that nothing anywhere adds
> anything to DEPS which does not match `.*.d'
> 
> My formulation makes a smaller assumption about DEPS (nothing adds
> anything not ending with .d) but a larger assumption about .d (there
> are no Makefile pattern targets which use .d for other purposes).
> 
> I think the 2nd assumption is reasonable and the expanded 1st
> assumption is questionable.

Well, these dependency files start with a dot for a reason. Plus
my consideration on *.d (without leading dot) was that this may
have a conventional use for D language source files (but that's
a guess, nothing I know). Anyway, as expressed I'm not meaning
to insist on the change, just put it out for consideration.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2017-09-05 15:53 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-30  7:06 [PATCH] libxl: fix incremental parallel build Jan Beulich
2017-09-01 15:28 ` Wei Liu
2017-09-01 15:35   ` Jan Beulich
2017-09-01 17:04     ` Ian Jackson
2017-09-04  8:38       ` Jan Beulich
2017-09-04 10:59         ` Ian Jackson
2017-09-04 11:33         ` Ian Jackson
2017-09-04 12:51           ` Jan Beulich
2017-09-04 13:33             ` Ian Jackson
2017-09-04 14:36               ` Jan Beulich
2017-09-04 14:39                 ` Ian Jackson
2017-09-04 16:46                   ` [PATCH 1/4] DEPS handling: Provide DEPS_RM and DEPS_INCLUDE Ian Jackson
2017-09-04 16:46                     ` [PATCH 2/4] DEPS handling: Use DEPS_RM everywhere Ian Jackson
2017-09-04 16:46                     ` [PATCH 3/4] DEPS handling: Use DEPS_INCLUDE everywhere Ian Jackson
2017-09-04 16:46                     ` [PATCH 4/4] DEPS handling: Remove absolute paths from references to cwd Ian Jackson
2017-09-05 14:44                       ` Jan Beulich
2017-09-05 15:32                         ` Ian Jackson
2017-09-05 15:53                           ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.