2
0

maintclean.sh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #! /bin/sh
  2. # Copyright (C) 2001-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. # Make sure distclean and maintainer-clean erase the right files.
  17. # This test is for in-tree builds; see sister test 'maintclean-vpath.sh'
  18. # for VPATH builds.
  19. . test-init.sh
  20. cat >> configure.ac << 'END'
  21. AC_CONFIG_FILES([bar sub/Makefile])
  22. AC_OUTPUT
  23. END
  24. cat > Makefile.am <<'END'
  25. SUBDIRS = sub
  26. noinst_DATA = foo.c
  27. foo.c:
  28. touch foo.c
  29. MAINTAINERCLEANFILES = foo.c
  30. END
  31. mkdir sub
  32. cat > sub/Makefile.am <<'END'
  33. noinst_SCRIPTS = zap
  34. zap: zap.sh
  35. cp $(srcdir)/zap.sh $@ && chmod a+x $@
  36. MAINTAINERCLEANFILES = zap
  37. END
  38. : > bar.in
  39. : > sub/zap.sh
  40. $ACLOCAL
  41. $AUTOCONF
  42. $AUTOMAKE
  43. # Users can disable autom4te.cache.
  44. if test -d autom4te.cache; then
  45. test_cache='test -d autom4te.cache'
  46. else
  47. test_cache=:
  48. fi
  49. ./configure
  50. test -f bar
  51. $MAKE
  52. test -f foo.c
  53. test -f sub/zap
  54. $test_cache
  55. $MAKE distclean
  56. test ! -e bar
  57. test ! -e Makefile
  58. test ! -e sub/Makefile
  59. test ! -e config.status
  60. test -f foo.c
  61. test -f sub/zap
  62. test -f sub/zap.sh
  63. $test_cache
  64. ./configure
  65. test -f bar
  66. $MAKE foo.c
  67. test -f foo.c
  68. cd sub
  69. $MAKE zap
  70. test -f zap
  71. cd ..
  72. $MAKE maintainer-clean
  73. test -f sub/zap.sh
  74. test ! -e bar
  75. test ! -e foo.c
  76. test ! -e sub/zap
  77. test ! -e Makefile
  78. test ! -e sub/Makefile
  79. test ! -e config.status
  80. test ! -e autom4te.cache
  81. :