suffix-custom-subobj-and-specflg.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 suffix rules with renamed objects
  17. # and subdir objects.
  18. # Reported by Florian Briegel.
  19. required=cc
  20. . test-init.sh
  21. cat >>configure.ac <<EOF
  22. AC_PROG_CC
  23. AC_OUTPUT
  24. EOF
  25. cat >Makefile.am << 'END'
  26. AUTOMAKE_OPTIONS = subdir-objects
  27. SUFFIXES = .baz .c
  28. .baz.c:
  29. case $@ in sub/*) $(MKDIR_P) sub;; *) :;; esac
  30. ## Account for VPATH issues on weaker make implementations (e.g. IRIX 6.5).
  31. cp `test -f '$<' || echo $(srcdir)/`$< $@
  32. DISTCLEANFILES = sub/bar.c
  33. bin_PROGRAMS = foo
  34. foo_SOURCES = foo.c sub/bar.baz
  35. foo_CFLAGS =
  36. END
  37. mkdir sub
  38. cat > sub/bar.baz <<'END'
  39. extern int foo ();
  40. int main () { return foo (); }
  41. END
  42. cat > foo.c <<'END'
  43. int foo () { return 0; }
  44. END
  45. $ACLOCAL
  46. $AUTOCONF
  47. $AUTOMAKE -a
  48. ./configure
  49. $MAKE
  50. $MAKE distcheck
  51. :