2
0

dejagnu.am 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. ## automake - create Makefile.in from Makefile.am
  2. ## Copyright (C) 1994-2017 Free Software Foundation, Inc.
  3. ## This program is free software; you can redistribute it and/or modify
  4. ## it under the terms of the GNU General Public License as published by
  5. ## the Free Software Foundation; either version 2, or (at your option)
  6. ## any later version.
  7. ## This program is distributed in the hope that it will be useful,
  8. ## but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. ## GNU General Public License for more details.
  11. ## You should have received a copy of the GNU General Public License
  12. ## along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. ## Name of tool to use. Default is the same as the package.
  14. DEJATOOL = $(PACKAGE)
  15. ## Default flags to pass to dejagnu. The user can override this.
  16. RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
  17. EXPECT = expect
  18. RUNTEST = runtest
  19. .PHONY: check-DEJAGNU
  20. check-DEJAGNU: site.exp
  21. ## Life is easiest with an absolute srcdir, so do that.
  22. srcdir='$(srcdir)'; export srcdir; \
  23. EXPECT=$(EXPECT); export EXPECT; \
  24. ## If runtest can't be found, print a warning but don't die. It is
  25. ## pointless to cause a failure if the tests cannot be run at all.
  26. if $(SHELL) -c "$(RUNTEST) --version" > /dev/null 2>&1; then \
  27. exit_status=0; l='$(DEJATOOL)'; for tool in $$l; do \
  28. if $(RUNTEST) $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \
  29. then :; else exit_status=1; fi; \
  30. done; \
  31. else echo "WARNING: could not find '$(RUNTEST)'" 1>&2; :;\
  32. fi; \
  33. exit $$exit_status
  34. ## ------------------- ##
  35. ## Building site.exp. ##
  36. ## ------------------- ##
  37. ## Note that in the rule we don't directly generate site.exp to avoid
  38. ## the possibility of a corrupted site.exp if make is interrupted.
  39. ## Jim Meyering has some useful text on this topic.
  40. site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG)
  41. @echo 'Making a new site.exp file ...'
  42. @echo '## these variables are automatically generated by make ##' >site.tmp
  43. @echo '# Do not edit here. If you wish to override these values' >>site.tmp
  44. @echo '# edit the last section' >>site.tmp
  45. @echo 'set srcdir "$(srcdir)"' >>site.tmp
  46. @echo "set objdir `pwd`" >>site.tmp
  47. ## Quote the *_alias variables because they might be empty.
  48. ?BUILD? @echo 'set build_alias "$(build_alias)"' >>site.tmp
  49. ?BUILD? @echo 'set build_triplet $(build_triplet)' >>site.tmp
  50. ?HOST? @echo 'set host_alias "$(host_alias)"' >>site.tmp
  51. ?HOST? @echo 'set host_triplet $(host_triplet)' >>site.tmp
  52. ?TARGET? @echo 'set target_alias "$(target_alias)"' >>site.tmp
  53. ?TARGET? @echo 'set target_triplet $(target_triplet)' >>site.tmp
  54. ## Allow the package author to extend site.exp.
  55. @list='$(EXTRA_DEJAGNU_SITE_CONFIG)'; for f in $$list; do \
  56. echo "## Begin content included from file $$f. Do not modify. ##" \
  57. && cat `test -f "$$f" || echo '$(srcdir)/'`$$f \
  58. && echo "## End content included from file $$f. ##" \
  59. || exit 1; \
  60. done >> site.tmp
  61. @echo "## End of auto-generated content; you can edit from here. ##" >> site.tmp
  62. @if test -f site.exp; then \
  63. sed -e '1,/^## End of auto-generated content.*##/d' site.exp >> site.tmp; \
  64. fi
  65. @-rm -f site.bak
  66. @test ! -f site.exp || mv site.exp site.bak
  67. @mv site.tmp site.exp
  68. ## ---------- ##
  69. ## Cleaning. ##
  70. ## ---------- ##
  71. .PHONY distclean-am: distclean-DEJAGNU
  72. distclean-DEJAGNU:
  73. ## Any other cleaning must be done by the user or by the test suite
  74. ## itself. We can't predict what dejagnu or the test suite might
  75. ## generate.
  76. -rm -f site.exp site.bak
  77. -l='$(DEJATOOL)'; for tool in $$l; do \
  78. rm -f $$tool.sum $$tool.log; \
  79. done