suffix-chain.tap 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #! /bin/sh
  2. # Copyright (C) 2002-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 Automake can emit code that work round the inability of
  17. # some make implementations to automatically chain suffix rules.
  18. # See automake bug#7824 and bug#7670.
  19. required=cc
  20. . test-init.sh
  21. plan_ 8
  22. cat >> configure.ac <<'END'
  23. AC_PROG_CC
  24. AC_OUTPUT
  25. END
  26. cat > Makefile.am <<'END'
  27. bin_PROGRAMS = foo
  28. foo_SOURCES = foo.c1
  29. .c1.c0:
  30. (echo 'int main (void)' && echo '{' && cat $<) > $@
  31. .c0.c:
  32. (cat $< && echo '}') > $@
  33. CLEANFILES = foo.c0 foo.c
  34. END
  35. echo 'return 0;' > foo.c1
  36. command_ok_ "aclocal" $ACLOCAL
  37. command_ok_ "automake" $AUTOMAKE
  38. command_ok_ "autoconf" $AUTOCONF
  39. command_ok_ "configure" ./configure
  40. directive=''; make_can_chain_suffix_rules || directive=TODO
  41. for target in all distcheck; do
  42. command_ok_ "make $target" \
  43. -D "$directive" -r "suffix rules not chained" \
  44. $MAKE $target
  45. done
  46. command_ok_ "clean" $MAKE clean
  47. # Sanity check.
  48. cat >> Makefile <<'END'
  49. foo.c: foo.c0
  50. foo.c0: foo.c1
  51. END
  52. command_ok_ "make with explicit dependencies" $MAKE
  53. :