recurs-user-phony.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 user-defined recursive targets and their associate
  17. # '-local', '-am' and '-recursive' targets are declared as phony.
  18. # Require GNU make, because some vendo makes (e.g., Solaris) doesn't
  19. # truly respect .PHONY.
  20. required=GNUmake
  21. . test-init.sh
  22. cat >> configure.ac <<'END'
  23. AC_CONFIG_FILES([sub/Makefile])
  24. AM_EXTRA_RECURSIVE_TARGETS([foo])
  25. AC_OUTPUT
  26. END
  27. cat > Makefile.am <<'END'
  28. SUBDIRS = sub
  29. foo-local:
  30. echo 'GOOD!' > foo
  31. END
  32. mkdir sub
  33. cat > sub/Makefile.am <<'END'
  34. foo-local:
  35. echo 'GOOD!' > foo
  36. END
  37. dummy_files='
  38. foo
  39. foo-local
  40. foo-am
  41. foo-recursive
  42. sub/foo
  43. sub/foo-local
  44. sub/foo-am
  45. '
  46. $ACLOCAL
  47. $AUTOCONF
  48. $AUTOMAKE
  49. ./configure
  50. touch $dummy_files
  51. $MAKE foo
  52. grep 'GOOD!' foo
  53. grep 'GOOD!' sub/foo
  54. :