From: Lei YU <mine260309@gmail.com>
To: Philippe Ombredanne <pombredanne@nexb.com>,
Kate Stewart <kstewart@linuxfoundation.org>,
Laura Abbott <labbott@redhat.com>,
Masahiro Yamada <yamada.masahiro@socionext.com>,
Thomas Gleixner <tglx@linutronix.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Lei YU <mine260309@gmail.com>,
linux-kernel@vger.kernel.org, Joel Stanley <joel@jms.id.au>
Subject: [PATCH v2] perf: Fix clean error
Date: Mon, 3 Sep 2018 10:50:28 +0800 [thread overview]
Message-ID: <1535943028-60049-1-git-send-email-mine260309@gmail.com> (raw)
When make perf with -O, it gets error when make clean with below log:
$ make -C tools/perf O=<output/dir> # OK
$ make -C tools/perf O=<output/dir> clean # Got below error
find: cannot delete ‘<output/dir>/builtin-script.o’: No such file or directory
find: cannot delete ‘<output/dir>/.subcmd-config.o.cmd’: No such file or directory
...
Makefile:38: recipe for target 'clean' failed
make[2]: *** [clean] Error 1
make[1]: *** [fixdep-clean] Error 2
Makefile:90: recipe for target 'clean' failed
make: *** [clean] Error 2
It happens because both fixdep-clean and libsubcmd-clean will delete
files by `find`, where libsubcmd-clean uses `| xargs $(RM)` and
fixdep-clean uses `-delete`.
When a file is find by fixdep-clean, and tries to delete it, it's found
that the file does not exist because it is deleted by libsubcmd-clean.
This commit changes the delete method of fixdep-clean to use
`| xargs $(RM)` as well, where RM is defined as `rm -f` so it does not
return error when file does not exist.
Signed-off-by: Lei YU <mine260309@gmail.com>
---
v2: Fix missing "make clean" in commit message
---
tools/build/Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/build/Makefile b/tools/build/Makefile
index 5edf65e..ae38db2 100644
--- a/tools/build/Makefile
+++ b/tools/build/Makefile
@@ -18,6 +18,7 @@ $(call allow-override,LD,$(CROSS_COMPILE)ld)
HOSTCC ?= gcc
HOSTLD ?= ld
HOSTAR ?= ar
+RM = rm -f
export HOSTCC HOSTLD HOSTAR
@@ -36,7 +37,7 @@ all: $(OUTPUT)fixdep
clean:
$(call QUIET_CLEAN, fixdep)
- $(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
+ $(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -o -name '\.*.cmd' -o -name '\.*.d' | xargs $(RM)
$(Q)rm -f $(OUTPUT)fixdep
$(OUTPUT)fixdep-in.o: FORCE
--
2.7.4
next reply other threads:[~2018-09-03 2:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-03 2:50 Lei YU [this message]
2018-09-03 4:49 ` Lei YU
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1535943028-60049-1-git-send-email-mine260309@gmail.com \
--to=mine260309@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=joel@jms.id.au \
--cc=kstewart@linuxfoundation.org \
--cc=labbott@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pombredanne@nexb.com \
--cc=tglx@linutronix.de \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®