2
0

remake-subdir-no-makefile.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #! /bin/sh
  2. # Copyright (C) 2010-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. # Ensure that remake rules work for files in a subdirectory even when
  17. # there is no Makefile for that subdirectory.
  18. . test-init.sh
  19. cat >> configure.ac << 'END'
  20. AC_CONFIG_FILES([sub/foo])
  21. AC_OUTPUT
  22. END
  23. cat > Makefile.am <<'END'
  24. all-local: sub/foo
  25. END
  26. mkdir sub
  27. : > sub/foo.in
  28. $ACLOCAL
  29. $AUTOCONF
  30. $AUTOMAKE
  31. # First a VPATH build.
  32. mkdir build
  33. cd build
  34. ../configure
  35. $sleep
  36. test -f sub/foo
  37. test ! -s sub/foo
  38. echo '#GrepMe#' > ../sub/foo.in
  39. $MAKE
  40. grep '#GrepMe#' sub/foo
  41. cd ..
  42. # Now try an in-tree build.
  43. : > sub/foo.in # Restore its original (empty) content.
  44. ./configure
  45. $sleep
  46. test -f sub/foo
  47. test ! -s sub/foo
  48. echo '#GrepMe#' > sub/foo.in
  49. $MAKE
  50. grep '#GrepMe#' sub/foo
  51. # Finally try to check the distribution.
  52. $sleep
  53. echo '%GrepMe%' > sub/foo.in
  54. cat >>Makefile.am <<END
  55. check-local:
  56. grep '%GrepMe%' sub/foo
  57. END
  58. $MAKE
  59. grep "grep '%GrepMe%' sub/foo" Makefile.in # Sanity check.
  60. $MAKE distcheck
  61. :