Skip to content

Commit 90293ff

Browse files
michal42gregkh
authored andcommitted
kbuild: Fix removal of the debian/ directory
commit a16c5f9 upstream. scripts/Makefile.clean treats absolute path specially, but $(objtree)/debian is no longer an absolute path since 7e1c047 (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: 7e1c047 (kbuild: Use relative path for $(objtree) Signed-off-by: Michal Marek <mmarek@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 51fbc05 commit 90293ff

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

‎scripts/Makefile.clean‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,19 @@ __clean-files := $(extra-y) $(extra-m) $(extra-) \
4545

4646
__clean-files := $(filter-out $(no-clean-files), $(__clean-files))
4747

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).
5051

5152
__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)))
5455

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
5757

5858
__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)))
6161

6262
# ==========================================================================
6363

0 commit comments

Comments
 (0)