suffix3.tap 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #! /bin/sh
  2. # Copyright (C) 1999-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. # Test to make sure that suffix rules chain.
  17. required=c++
  18. . test-init.sh
  19. plan_ 10
  20. cat >> configure.ac << 'END'
  21. AC_PROG_CXX
  22. AC_OUTPUT
  23. END
  24. cat > Makefile.am << 'END'
  25. SUFFIXES = .zoo
  26. .zoo.cc:
  27. sed 's/INTEGER/int/g' `test -f '$<' || echo $(srcdir)/`$< >$@
  28. bin_PROGRAMS = foo
  29. foo_SOURCES = foo.zoo
  30. # This is required by "make distcheck". The useless indirection is
  31. # reequired to avoid false positives by the grepping checks below.
  32. FOO = foo
  33. CLEANFILES = $(FOO).cc
  34. END
  35. command_ok_ "aclocal" $ACLOCAL
  36. command_ok_ "automake" $AUTOMAKE
  37. # The foo.cc intermediate step is implicit, it's a mistake if
  38. # Automake requires this file somewhere. Also, Automake should
  39. # not require the file 'foo.c' anywhere.
  40. command_ok_ "intermediate files not mentioned" \
  41. not $FGREP foo.c Makefile.in
  42. # However Automake must figure that foo.zoo is eventually
  43. # transformed into foo.o, and use this latter file (to link foo).
  44. command_ok_ "final object file figured out" \
  45. $FGREP 'foo.$(OBJEXT)' Makefile.in
  46. command_ok_ "autoconf" $AUTOCONF
  47. command_ok_ "configure" ./configure
  48. # This is deliberately valid C++, but invalid C.
  49. cat > foo.zoo <<'END'
  50. using namespace std;
  51. INTEGER main (void)
  52. {
  53. return 0;
  54. }
  55. END
  56. directive=''; make_can_chain_suffix_rules || directive=TODO
  57. for target in all distcheck; do
  58. command_ok_ "make $target" \
  59. -D "$directive" -r "suffix rules not chained" \
  60. $MAKE $target
  61. done
  62. # FIXME: should we check that intermediate file 'foo.cc' has
  63. # been removed? Or is this requiring too much from the make
  64. # implementation?
  65. # Intermediate files should not be distributed.
  66. command_ok_ "make distdir" $MAKE distdir
  67. command_ok_ "intermediate file not distributed" test ! -e $me-1.0/foo.cc
  68. :