2
0

remake-all-1.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. # Check that the "all" target triggers rebuilt of outdated Makefiles.
  17. # See also sister test 'remake-all-2.sh'.
  18. . test-init.sh
  19. mkfile=Makefile
  20. magic1=::MagicStringOne::
  21. magic2=__MagicStringTwo__
  22. magic3=%%MagicStringThree%%
  23. cat > configure.ac <<END
  24. AC_INIT([$me], [1.0])
  25. AM_INIT_AUTOMAKE
  26. AC_CONFIG_FILES([$mkfile sub/$mkfile])
  27. FOO='$magic1'
  28. AC_OUTPUT
  29. END
  30. mkdir sub
  31. echo SUBDIRS = sub > $mkfile.am
  32. : > sub/$mkfile.am
  33. $ACLOCAL
  34. $AUTOMAKE
  35. $EGREP "^all-am:.* $mkfile( |$)" $mkfile.in sub/$mkfile.in
  36. $AUTOCONF
  37. ./configure
  38. $FGREP "$magic1" mkfile.in && exit 1 # Sanity check.
  39. # Two code paths in configure.am:
  40. # - either a file in $(am__configure_deps) has been updated ...
  41. $sleep
  42. echo "AC_SUBST([FOO])" >> configure.ac
  43. $MAKE
  44. $FGREP FOO $mkfile # For debugging.
  45. $FGREP $magic1 $mkfile
  46. # - ... or not; i.e., Makefile.am or an included file has.
  47. $sleep
  48. echo "# $magic2" >> $mkfile.am
  49. echo "# $magic3" >> sub/$mkfile.am
  50. $MAKE
  51. $FGREP $magic2 $mkfile
  52. $FGREP $magic3 sub/$mkfile
  53. :