extra-dist-wildcards-gnu.sh 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #! /bin/sh
  2. # Copyright (C) 2010-2017 Free Software Foundation, Inc.
  3. #
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2, or (at your option)
  7. # any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. # Check for more complex usage of wildcards in EXTRA_DIST.
  17. # Suggested by observations from Braden McDaniel.
  18. required=GNUmake
  19. . test-init.sh
  20. echo AC_OUTPUT >> configure.ac
  21. cat > Makefile.am <<'END'
  22. AUTOMAKE_OPTIONS = -Wno-portability
  23. EXTRA_DIST = $(wildcard [!c-z].t d.t [ab].dir foo.* *zardoz*)
  24. .PHONY: prereq
  25. prereq:
  26. echo a > a.t
  27. echo b > b.t
  28. echo c > c.t
  29. echo d > d.t
  30. echo m > m.t
  31. echo z > z.t
  32. mkdir a.dir b.dir c.dir
  33. echo a1 > a.dir/f1
  34. echo a2 > a.dir/f2
  35. echo bb > b.dir/f
  36. echo cc > c.dir/x
  37. echo 0 > foo
  38. echo 1 > foo.x
  39. echo 2 > foo.bar
  40. echo foo > _zardoz_
  41. .PHONY: test
  42. test: distdir
  43. ls -l $(distdir) $(distdir)/*.dir ;: For debugging.
  44. diff a.t $(distdir)/a.t
  45. diff b.t $(distdir)/b.t
  46. test ! -r $(distdir)/c.t
  47. diff d.t $(distdir)/d.t
  48. test ! -r $(distdir)/m.t
  49. test ! -r $(distdir)/z.t
  50. diff a.dir/f1 $(distdir)/a.dir/f1
  51. diff a.dir/f2 $(distdir)/a.dir/f2
  52. diff b.dir/f $(distdir)/b.dir/f
  53. test ! -r $(distdir)/c.dir
  54. diff foo.x $(distdir)/foo.x
  55. diff foo.bar $(distdir)/foo.bar
  56. test ! -r $(distdir)/foo
  57. diff _zardoz_ $(distdir)/_zardoz_
  58. check-local:
  59. ls -l . *.dir ;: For debugging.
  60. test -f $(srcdir)/a.t
  61. test -f $(srcdir)/b.t
  62. test ! -r $(srcdir)/c.t
  63. test -f $(srcdir)/d.t
  64. test ! -r $(srcdir)/m.t
  65. test ! -r $(srcdir)/z.t
  66. test -f $(srcdir)/a.dir/f1
  67. test -f $(srcdir)/a.dir/f2
  68. test -f $(srcdir)/b.dir/f
  69. test ! -r $(srcdir)/c.dir
  70. test -f $(srcdir)/foo.x
  71. test -f $(srcdir)/foo.bar
  72. test ! -r $(srcdir)/foo
  73. test -f $(srcdir)/_zardoz_
  74. END
  75. $ACLOCAL
  76. $AUTOMAKE
  77. $AUTOCONF
  78. ./configure
  79. $MAKE prereq
  80. ls -l . *.dir # For debugging.
  81. $MAKE test
  82. $MAKE distcheck
  83. :