diff mbox series

[v2,09/15] libtracefs: Quiet mv: cannot stat message for libtracefs.a

Message ID 20211217055041.19559-10-rostedt@goodmis.org (mailing list archive)
State Accepted
Commit 6081ed7364fc16cdf1a031886c5fcc3b788dfb37
Headers show
Series libtracefs: Updates to the Makefile | expand

Commit Message

Steven Rostedt Dec. 17, 2021, 5:50 a.m. UTC
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

The following shows up on a normal make:

  mv: cannot stat '/work/git/libtracefs.git/lib/tracefs/libtracefs.a': No such file or directory

In order to help with a multithreaded make, the moving of the libtracefs.a
before removing it appears to fix some issues. But now we get a message if
it doesn't already exist. Only move it and remove it if it already exists.

Fixes: 550d8358 ("libtracefs: make the libtracefs.a gen more robust")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 scripts/utils.mk | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/scripts/utils.mk b/scripts/utils.mk
index c9b908f1c5d9..af0f14fcbfa7 100644
--- a/scripts/utils.mk
+++ b/scripts/utils.mk
@@ -60,7 +60,10 @@  do_app_build =						\
 
 do_build_static_lib =				\
 	($(print_static_lib_build)		\
-	mv $@ $@.rm; $(RM) $@.rm;  $(AR) rcs $@ $^)
+	if [ -f $@ ]; then			\
+	    mv $@ $@.rm; $(RM) $@.rm;		\
+	fi;					\
+	$(AR) rcs $@ $^)
 
 do_compile_shared_library =			\
 	($(print_shared_lib_compile)		\