recurs-user-many.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #! /bin/sh
  2. # Copyright (C) 2012-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 that many user-defined recursive targets can be supported
  17. # at once, and that calls to 'AM_EXTRA_RECURSIVE_TARGETS' are
  18. # cumulative.
  19. . test-init.sh
  20. cat >> configure.ac <<'END'
  21. AC_CONFIG_FILES([sub/Makefile])
  22. ## NOTE: extra white spaces, tabs, newlines and backslashes in the
  23. ## lines below: on purpose.
  24. AM_EXTRA_RECURSIVE_TARGETS([ foo \
  25. bar ])
  26. AC_SUBST([CLEANFILES], ['foo bar baz'])
  27. AC_OUTPUT
  28. # Yes, this appears after AC_OUTPUT. So what?
  29. AM_EXTRA_RECURSIVE_TARGETS([baz])
  30. END
  31. mkdir sub
  32. cat > Makefile.am <<'END'
  33. SUBDIRS = sub
  34. foo-local:
  35. : > foo
  36. bar-local:
  37. echo x > bar
  38. baz-local: ; touch baz
  39. check-local: foo bar baz
  40. ls -l . sub ;: For debugging.
  41. test -f foo
  42. test -f bar
  43. test -f baz
  44. test -f sub/foo
  45. test -f sub/bar
  46. test -f sub/baz
  47. END
  48. cat > sub/Makefile.am <<'END'
  49. foo-local bar-local baz-local:
  50. touch `echo $@ | sed 's/-local$$//'`
  51. END
  52. $ACLOCAL
  53. $AUTOCONF
  54. $AUTOMAKE
  55. for t in foo bar baz; do
  56. $FGREP "$t-am" Makefile.in
  57. $FGREP "$t-am" sub/Makefile.in
  58. done
  59. ./configure
  60. $MAKE check
  61. $MAKE distcheck
  62. :