java-clean.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #! /bin/sh
  2. # Copyright (C) 1998-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. # Test cleaning of Java class files and timestamps.
  17. required=javac
  18. . test-init.sh
  19. cat >> configure.ac <<'END'
  20. AC_OUTPUT
  21. END
  22. cat > Makefile.am << 'END'
  23. javadir = $(datadir)/java
  24. java_JAVA = Class.java
  25. dist_java_JAVA = ClassDist.java
  26. nodist_java_JAVA = ClassNodist.java
  27. nobase_java_JAVA = ClassNobase.java
  28. nobase_dist_java_JAVA = ClassNobaseDist.java
  29. nobase_nodist_java_JAVA = ClassNobaseNodist.java
  30. END
  31. for base in '' Nobase; do
  32. for dist in '' Dist Nodist; do
  33. echo "class Class$base$dist {}" > Class$base$dist.java
  34. done
  35. done
  36. $ACLOCAL
  37. $AUTOCONF
  38. $AUTOMAKE
  39. ./configure
  40. $MAKE
  41. ls -l
  42. test -f classjava.stamp
  43. for base in '' Nobase; do
  44. for dist in '' Dist Nodist; do
  45. test -f Class$base$dist.class
  46. done
  47. done
  48. $MAKE clean
  49. find . -name '*.class' -o -name '*.stamp' | grep . && exit 1
  50. # We should not remove unrelated stamp files.
  51. echo timestamp > classjava2.stamp
  52. echo timestamp > classdist_java.stamp
  53. $MAKE clean
  54. test -f classjava2.stamp
  55. test -f classdist_java.stamp
  56. :