suffix11.tap 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. # Tests that Automake understands multiple suffix rules on the same line.
  17. # PR/371 and PR/372: Reported by Duncan Gibson.
  18. # We also check for suffixes containing '-'.
  19. required=cc
  20. . test-init.sh
  21. plan_ 10
  22. cat >>configure.ac <<EOF
  23. AC_PROG_CC
  24. AC_OUTPUT
  25. EOF
  26. cat >Makefile.am << 'END'
  27. bin_PROGRAMS = foo bar baz
  28. foo_SOURCES = foo.x_
  29. bar_SOURCES = bar.y-z
  30. baz_SOURCES = baz1.x_ baz2.y-z
  31. .y-z.c .x_.c:
  32. ## Account for VPATH issues on weaker make implementations (e.g. IRIX 6.5).
  33. sed 's/INTEGER/int/g' `test -f '$<' || echo $(srcdir)/`$< >$@
  34. CLEANFILES = foo.c bar.c baz1.c baz2.c
  35. .PHONY: test-real test-fake
  36. test-fake:
  37. echo $(foo_OBJECTS) | grep '^foo\.foo$$'
  38. echo $(bar_OBJECTS) | grep '^bar\.foo$$'
  39. echo $(baz_OBJECTS) | grep '^baz1\.foo baz2\.foo$$'
  40. test-real:
  41. echo $(foo_OBJECTS) | grep '^foo\.$(OBJEXT)$$'
  42. echo $(bar_OBJECTS) | grep '^bar\.$(OBJEXT)$$'
  43. echo $(baz_OBJECTS) | grep '^baz1\.$(OBJEXT) baz2\.$(OBJEXT)$$'
  44. check-local: test-real
  45. END
  46. echo 'INTEGER main(void) { return 0; }' > foo.x_
  47. echo 'INTEGER main(void) { return 0; }' > bar.y-z
  48. echo 'INTEGER main(void) { INTEGER baz(void); return baz(); }' > baz1.x_
  49. echo 'INTEGER baz(void) { return 0; }' > baz2.y-z
  50. command_ok_ "aclocal" $ACLOCAL
  51. command_ok_ "autoconf" $AUTOCONF
  52. # What we do is not portable. Automake should warn.
  53. AUTOMAKE_fails -a
  54. command_ok_ "warn about unportable make usage" \
  55. grep '[iI]nference rules can have only one target before the colon' stderr
  56. # But this should work anyway.
  57. command_ok_ "automake" $AUTOMAKE -a -Wno-portability
  58. command_ok_ "configure" ./configure
  59. command_ok_ "make test-fake" run_make OBJEXT=foo test-fake
  60. command_ok_ "make test-real" $MAKE test-real
  61. directive=''; make_can_chain_suffix_rules || directive=TODO
  62. for target in '' distcheck; do
  63. command_ok_ "make $target" \
  64. -D "$directive" -r "suffix rules not chained" \
  65. $MAKE $target
  66. done
  67. :