remake-subdir-from-subdir.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #! /bin/sh
  2. # Copyright (C) 2009-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 remake rules works for adding a new subdirectory from a
  17. # pre-existing subdirectory.
  18. # See also the other similar tests 'remake-subdir*.sh', and the
  19. # related test 'aclocal5.sh'.
  20. . test-init.sh
  21. cat >> configure.ac <<'END'
  22. m4_include([subdirs.m4])
  23. AC_SUBST([MAGIC], [magic])
  24. AC_OUTPUT
  25. END
  26. echo 'AC_CONFIG_FILES([sub/Makefile])' > subdirs.m4
  27. echo 'SUBDIRS = sub' > Makefile.am
  28. mkdir sub
  29. : > sub/Makefile.am
  30. $ACLOCAL
  31. $AUTOCONF
  32. $AUTOMAKE
  33. ./configure
  34. $MAKE
  35. cd sub
  36. $sleep
  37. echo 'AC_CONFIG_FILES([sub/subsub/Makefile])' >> ../subdirs.m4
  38. echo 'SUBDIRS = subsub' >> Makefile.am
  39. mkdir subsub
  40. cat > subsub/Makefile.am <<'END'
  41. all-local:
  42. : > ok-it-works
  43. END
  44. using_gmake || $MAKE Makefile
  45. $MAKE
  46. test -f subsub/ok-it-works
  47. :