about summary refs log tree commit diff
path: root/Makerules
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2023-06-15 15:25:47 +0000
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-06-26 10:37:25 -0300
commit7c507f4473911a13273ac535b02fd55edc8e19f9 (patch)
tree3b32dd70aeca9e9f7945206b7a9d80fa78f234b9 /Makerules
parent9a17a193b4ea5730aed0b9e532ae741418dd10d3 (diff)
downloadglibc-7c507f4473911a13273ac535b02fd55edc8e19f9.tar.gz
glibc-7c507f4473911a13273ac535b02fd55edc8e19f9.tar.xz
glibc-7c507f4473911a13273ac535b02fd55edc8e19f9.zip
Fix tests-clean Makefile target (bug 30545)
This patch improves tests-clean Makefile target to reliably clean
test artifacts from a build directory.  Before this patch tests-clean
missed around 3k (out of total 9k) .out and .test-result files.

Signed-off-by: Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'Makerules')
-rw-r--r--Makerules23
1 files changed, 5 insertions, 18 deletions
diff --git a/Makerules b/Makerules
index 2ccf26d320..018780c818 100644
--- a/Makerules
+++ b/Makerules
@@ -1334,18 +1334,13 @@ echo-headers:
 clean: common-clean
 mostlyclean: common-mostlyclean
 
+# Remove test artifacts from a given directory
 do-tests-clean:
-	-rm -f $(addprefix $(objpfx),$(addsuffix .out,$(tests) \
-						      $(tests-internal) \
-						      $(xtests) \
-						      $(test-srcs)) \
-				     $(addsuffix .test-result,$(tests) \
-							      $(tests-internal) \
-							      $(xtests) \
-							      $(test-srcs)))
+	-find $(objpfx) -name '*.out' -delete
+	-find $(objpfx) -name '*.test-result' -delete
 
 # Remove the object files.
-common-mostlyclean:
+common-mostlyclean: do-tests-clean
 	-rm -f $(addprefix $(objpfx),$(tests) $(tests-internal) $(xtests) \
 				     $(test-srcs) \
 				     $(others) $(sysdep-others) stubs \
@@ -1354,15 +1349,7 @@ common-mostlyclean:
 						    $(xtests) \
 						    $(test-srcs) \
 						    $(others) \
-						    $(sysdep-others)) \
-				     $(addsuffix .out,$(tests) \
-						      $(tests-internal) \
-						      $(xtests) \
-						      $(test-srcs)) \
-				     $(addsuffix .test-result,$(tests) \
-							      $(tests-internal) \
-							      $(xtests) \
-							      $(test-srcs)))
+						    $(sysdep-others)))
 	-rm -f $(addprefix $(objpfx),$(extra-objs) $(extra-test-objs) \
 				     $(install-lib) $(install-lib.so) \
 				     $(install-lib.so:%.so=%_pic.a))