Makefile.am 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. # Make findutils.
  2. # Copyright (C) 1996-2021 Free Software Foundation, Inc.
  3. # This program is free software: you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation, either version 3 of the License, or
  6. # (at your option) any later version.
  7. # This program is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. # GNU General Public License for more details.
  11. # You should have received a copy of the GNU General Public License
  12. # along with this program. If not, see <https://www.gnu.org/licenses/>.
  13. AUTOMAKE_OPTIONS = gnu std-options readme-alpha
  14. AM_CFLAGS = $(WARN_CFLAGS)
  15. EXTRA_DIST = \
  16. COPYING \
  17. ChangeLog \
  18. README-hacking \
  19. THANKS \
  20. TODO \
  21. build-aux/git-version-gen \
  22. config.h.in \
  23. stamp-h.in \
  24. tests/GNUmakefile \
  25. tool-versions.txt
  26. DISTCLEANFILES = tool-versions.txt
  27. # "gnulib-tests" is the gnulib unit test dir.
  28. SUBDIRS = gl build-aux lib find xargs locate doc po m4 gnulib-tests
  29. ALL_RECURSIVE_TARGETS =
  30. ACLOCAL_AMFLAGS = -I gl/m4 -I m4
  31. TESTFILE_SUFFIXES = .exp .xo .xe .xi
  32. tool-versions.txt: Makefile
  33. ( automake --version ; echo ; \
  34. autoconf --version ; echo ; \
  35. $(CC) --version ; echo ; \
  36. m4 --version ; echo ; \
  37. gettext --version ; echo ; \
  38. runtest --version ; echo ; \
  39. makeinfo --version ) > $@
  40. # Have .tarball-version based versions only in tarball builds.
  41. dist-hook: gen-ChangeLog findutils-check-testfiles
  42. $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
  43. # gen-Changelog must still work when $(top_srcdir)/.git does not exist
  44. # because "make distcheck" verifies that you can "make dist" from the
  45. # tarball generated by "make dist". We still need that to work.
  46. .PHONY: gen-ChangeLog
  47. gen-ChangeLog:
  48. $(AM_V_GEN)if test -d $(top_srcdir)/.git; then \
  49. $(AUXDIR)/gen-changelog.sh $(top_srcdir) > $(distdir)/cl-t \
  50. && { rm -f $(distdir)/ChangeLog \
  51. && mv $(distdir)/cl-t $(distdir)/ChangeLog; } \
  52. else \
  53. echo "WARNING: $@: cannot generate ChangeLog since" >&2 && \
  54. echo "$(top_srcdir) has no .git subdirectory" >&2 ; \
  55. fi
  56. ## Check that we actually shipped all the test files that exist in the source.
  57. ## runtest will run all the .exp files it finds, and so if we don't ship all
  58. ## of them, there will be some tests which people using the CVS code will be
  59. ## running, but people using the source distribution will not.
  60. findutils-check-testfiles:
  61. @echo
  62. $(AUXDIR)/check-testfiles.sh "$(distdir)" "$(srcdir)" $(TESTFILE_SUFFIXES)
  63. findutils-check-smells:
  64. find $(srcdir) \( -path $(srcdir)/autom4te.cache -o \
  65. -path $(srcdir)/gnulib -o \
  66. -path $(srcdir)/gl -o \
  67. -path $(srcdir)/gnulib-tests -o \
  68. -name .git -o \
  69. \( -type d -name CVS \) \
  70. \) -prune -o \
  71. \( -type f -o -type l \) \
  72. \! \( -name '*~' -o -name '*.xo' -o -name '*.xi' \) \
  73. -print0 | \
  74. xargs -0 python $(AUXDIR)/src-sniff.py
  75. # Update gnulib to latest, merging some additional files we take from there
  76. # as well. This only works if the working tree of both findutils and gnulib
  77. # are clean (which is checked first).
  78. # The following is a good start to find additional candidates for copying:
  79. # git ls-files \
  80. # | sed 's,^.*/,,g; /^gnulib$/d; /^t-t$/d; /\.c$/d' \
  81. # | grep -Ff - <( cd gnulib && git ls-files )
  82. .PHONY: gnulib-sync update-gnulib-to-latest
  83. gnulib-sync update-gnulib-to-latest:
  84. @( cd $(srcdir) \
  85. && { printf 'gnulib: ' && git -C gnulib describe --always --dirty \
  86. && printf 'findutils: ' && git describe --always --dirty \
  87. || echo dirty; \
  88. } | grep 'dirty$$' \
  89. && { echo "error: tree is dirty" >&2; exit 1; } || : \
  90. && git submodule foreach git pull origin master \
  91. && cp -v gnulib/doc/COPYINGv3 COPYING \
  92. && cp -v gnulib/doc/fdl-1.3.texi doc/fdl.texi \
  93. && cp -v gnulib/build-aux/bootstrap bootstrap \
  94. && cp -v gnulib/tests/init.sh tests/init.sh \
  95. && git status --short -- gnulib COPYING doc/fdl.texi bootstrap \
  96. tests/init.sh \
  97. )
  98. # Clean coverage files generated by running binaries built with gcc
  99. # -fprofile-arcs -ftest-coverage. We touch subdirectories here
  100. # because the relevant Makefile.am files (which we would otherwise
  101. # edit to add an $(RM) command in their own coverage-clean rule) are
  102. # generated by gnulib-tool and therefore we cannot add the rule to
  103. # those files.
  104. coverage-clean:
  105. for dir in . gl/lib gl/lib/glthread gl/lib/uniwidth gnulib-tests \
  106. gnulib-tests/uniwidth; do \
  107. rm -f $${dir}/*.gcno $${dir}/*.gcda $${dir}/*.gcov $${dir}/*.lcov; \
  108. done
  109. clean-local: coverage-clean
  110. include $(top_srcdir)/tests/local.mk