]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - Makefile
Regenerate libc.pot
[thirdparty/glibc.git] / Makefile
index b1454882bdaade712ecb4a23f3708993ed9cb4f3..f324df7a1fa60c394ff1155aaded2e3554f27764 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1991-2022 Free Software Foundation, Inc.
+# Copyright (C) 1991-2023 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
 # The GNU C Library is free software; you can redistribute it and/or
@@ -143,7 +143,8 @@ Usage: $$0 [OPTIONS] <program> [ARGUMENTS...]
 
   --tool=TOOL  Run with the specified TOOL. It can be strace, rpctrace,
                valgrind or container. The container will run within
-               support/test-container.
+               support/test-container.  For strace and valgrind,
+               additional arguments can be passed after the tool name.
 EOF
 
   exit 1
@@ -174,16 +175,16 @@ case "$$toolname" in
     exec $(subst $(common-objdir),"$${builddir}", $(test-program-prefix)) \
       $${1+"$$@"}
     ;;
-  strace)
-    exec strace $(patsubst %, -E%, $(run-program-env)) \
+  strace*)
+    exec $$toolname $(patsubst %, -E%, $(run-program-env)) \
       $(test-via-rtld-prefix) $${1+"$$@"}
     ;;
   rpctrace)
     exec rpctrace $(patsubst %, -E%, $(run-program-env)) \
       $(test-via-rtld-prefix) $${1+"$$@"}
     ;;
-  valgrind)
-    exec env $(run-program-env) valgrind $(test-via-rtld-prefix) $${1+"$$@"}
+  valgrind*)
+    exec env $(run-program-env) $$toolname $(test-via-rtld-prefix) $${1+"$$@"}
     ;;
   container)
     exec env $(run-program-env) $(test-via-rtld-prefix) \
@@ -517,7 +518,10 @@ mostlyclean: parent-mostlyclean
        @$(MAKE) subdir_mostlyclean no_deps=t
        -rm -f $(postclean)
 
-tests-clean:
+# Remove test artifacts from the whole glibc build.
+# do-tests-clean removes test artifacts from top-level directory, and
+# subdir_testclean removes them from individual sub-directories.
+tests-clean: do-tests-clean
        @$(MAKE) subdir_testclean no_deps=t
 
 ifneq (,$(CXX))
@@ -563,11 +567,21 @@ $(objpfx)check-wrapper-headers.out: scripts/check-wrapper-headers.py $(headers)
          --generated $(common-generated) > $@; $(evaluate-test)
 endif # $(headers)
 
+# Lint all Makefiles; including this one.  Pass `pwd` as the source
+# directory since the top-level Makefile is in the root of the source
+# tree and these tests are run from there.  We add light-weight linting
+# to the 'check' target to support the existing developer workflow of:
+# edit -> make -> make check; without needing an additional step.
+tests-special += $(objpfx)lint-makefiles.out
+$(objpfx)lint-makefiles.out: scripts/lint-makefiles.sh
+       $(SHELL) $< "$(PYTHON)" `pwd` > $@ ; \
+       $(evaluate-test)
+
 define summarize-tests
-@egrep -v '^(PASS|XFAIL):' $(objpfx)$1 || true
+@grep -E -v '^(PASS|XFAIL):' $(objpfx)$1 || true
 @echo "Summary of test results$2:"
 @sed 's/:.*//' < $(objpfx)$1 | sort | uniq -c
-@! egrep -q -v '^(X?PASS|XFAIL|UNSUPPORTED):' $(objpfx)$1
+@! grep -E -q -v '^(X?PASS|XFAIL|UNSUPPORTED):' $(objpfx)$1
 endef
 
 # The intention here is to do ONE install of our build into the