Commit 90293ffa75c11bd3dc26c196e68495e3d09c1fad

Authored by Michal Marek
Committed by Greg Kroah-Hartman
1 parent 51fbc05597

kbuild: Fix removal of the debian/ directory

commit a16c5f99a28c9945165c46da27fff8e6f26f8736 upstream.

scripts/Makefile.clean treats absolute path specially, but
$(objtree)/debian is no longer an absolute path since 7e1c0477 (kbuild:
Use relative path for $(objtree). Work around this by checking if the
path starts with $(objtree)/.

Reported-and-tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Fixes: 7e1c0477 (kbuild: Use relative path for $(objtree)
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 1 changed file with 8 additions and 8 deletions Side-by-side Diff

scripts/Makefile.clean
... ... @@ -45,19 +45,19 @@
45 45  
46 46 __clean-files := $(filter-out $(no-clean-files), $(__clean-files))
47 47  
48   -# as clean-files is given relative to the current directory, this adds
49   -# a $(obj) prefix, except for absolute paths
  48 +# clean-files is given relative to the current directory, unless it
  49 +# starts with $(objtree)/ (which means "./", so do not add "./" unless
  50 +# you want to delete a file from the toplevel object directory).
50 51  
51 52 __clean-files := $(wildcard \
52   - $(addprefix $(obj)/, $(filter-out /%, $(__clean-files))) \
53   - $(filter /%, $(__clean-files)))
  53 + $(addprefix $(obj)/, $(filter-out $(objtree)/%, $(__clean-files))) \
  54 + $(filter $(objtree)/%, $(__clean-files)))
54 55  
55   -# as clean-dirs is given relative to the current directory, this adds
56   -# a $(obj) prefix, except for absolute paths
  56 +# same as clean-files
57 57  
58 58 __clean-dirs := $(wildcard \
59   - $(addprefix $(obj)/, $(filter-out /%, $(clean-dirs))) \
60   - $(filter /%, $(clean-dirs)))
  59 + $(addprefix $(obj)/, $(filter-out $(objtree)/%, $(clean-dirs))) \
  60 + $(filter $(objtree)/%, $(clean-dirs)))
61 61  
62 62 # ==========================================================================
63 63