recurs-user-override.sh 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 override of user-defined recursive targets work as
  17. # expected.
  18. . test-init.sh
  19. cat >> configure.ac <<'END'
  20. AC_CONFIG_FILES([sub/Makefile])
  21. AM_EXTRA_RECURSIVE_TARGETS([foobar zardoz])
  22. AC_OUTPUT
  23. END
  24. cat > Makefile.am <<'END'
  25. SUBDIRS = sub
  26. all-local: foobar zardoz
  27. foobar:
  28. : > foobar.out
  29. MOSTLYCLEANFILES = foobar.out
  30. check-local:
  31. test -f foobar.out
  32. test ! -r sub/foobar.out
  33. test -f sub/zardoz.out
  34. test ! -r sub/baz.out
  35. END
  36. mkdir sub
  37. cat > sub/Makefile.am <<'END'
  38. foobar foobar-local:
  39. : > foobar.out
  40. zardoz-local:
  41. : > baz.out
  42. zardoz:
  43. : > zardoz.out
  44. MOSTLYCLEANFILES = zardoz.out
  45. END
  46. $ACLOCAL
  47. $AUTOCONF
  48. AUTOMAKE_fails
  49. grep '^Makefile\.am:3:.*user target.*foobar' stderr
  50. grep '^Makefile\.am:.*foobar-local.*instead of foobar$' stderr
  51. grep '^sub/Makefile\.am:5:.*user target.*zardoz' stderr
  52. grep '^sub/Makefile\.am:.*zardoz-local.*instead of zardoz$' stderr
  53. $AUTOMAKE -Wno-override
  54. ./configure
  55. $MAKE check
  56. $MAKE distcheck
  57. :