Makefile.am 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. ## Process this file with automake to produce Makefile.in.
  2. AUTOMAKE_OPTIONS = foreign
  3. # May be used by various substitution variables.
  4. gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
  5. EXPECT = $(shell if test -f $(top_builddir)/../expect/expect; then \
  6. echo $(top_builddir)/../expect/expect; else echo expect; fi)
  7. _RUNTEST = $(shell if test -f $(top_srcdir)/../dejagnu/runtest; then \
  8. echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi)
  9. RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
  10. EXTRA_DEJAGNU_SITE_CONFIG = libgomp-site-extra.exp
  11. # Instead of directly in ../testsuite/libgomp-test-support.exp.in, the
  12. # following variables have to be "routed through" this Makefile, for expansion
  13. # of the several (Makefile) variables used therein.
  14. libgomp-test-support.exp: libgomp-test-support.pt.exp Makefile
  15. cp $< $@.tmp
  16. echo >> $@.tmp \
  17. 'set offload_additional_options "$(offload_additional_options)"'
  18. echo >> $@.tmp \
  19. 'set offload_additional_lib_paths "$(offload_additional_lib_paths)"'
  20. mv $@.tmp $@
  21. check-DEJAGNU: site.exp
  22. srcdir='$(srcdir)'; export srcdir; \
  23. EXPECT=$(EXPECT); export EXPECT; \
  24. if $(SHELL) -c "$(_RUNTEST) --version" > /dev/null 2>&1; then \
  25. exit_status=0; l='$(PACKAGE)'; for tool in $$l; do \
  26. if $(_RUNTEST) $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \
  27. then :; else exit_status=1; fi; \
  28. done; \
  29. else echo "WARNING: could not find '$(_RUNTEST)'" 1>&2; :;\
  30. fi; \
  31. exit $$exit_status
  32. site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG)
  33. @echo 'Making a new site.exp file ...'
  34. @echo '## these variables are automatically generated by make ##' >site.tmp
  35. @echo '# Do not edit here. If you wish to override these values' >>site.tmp
  36. @echo '# edit the last section' >>site.tmp
  37. @echo 'set srcdir "$(srcdir)"' >>site.tmp
  38. @echo "set objdir `pwd`" >>site.tmp
  39. @echo 'set build_alias "$(build_alias)"' >>site.tmp
  40. @echo 'set build_triplet $(build_triplet)' >>site.tmp
  41. @echo 'set host_alias "$(host_alias)"' >>site.tmp
  42. @echo 'set host_triplet $(host_triplet)' >>site.tmp
  43. @echo 'set target_alias "$(target_alias)"' >>site.tmp
  44. @echo 'set target_triplet $(target_triplet)' >>site.tmp
  45. @list='$(EXTRA_DEJAGNU_SITE_CONFIG)'; for f in $$list; do \
  46. echo "## Begin content included from file $$f. Do not modify. ##" \
  47. && cat `test -f "$$f" || echo '$(srcdir)/'`$$f \
  48. && echo "## End content included from file $$f. ##" \
  49. || exit 1; \
  50. done >> site.tmp
  51. @echo "## End of auto-generated content; you can edit from here. ##" >> site.tmp
  52. @if test -f site.exp; then \
  53. sed -e '1,/^## End of auto-generated content.*##/d' site.exp >> site.tmp; \
  54. fi
  55. @-rm -f site.bak
  56. @test ! -f site.exp || mv site.exp site.bak
  57. @mv site.tmp site.exp
  58. distclean-DEJAGNU:
  59. -rm -f site.exp site.bak
  60. -l='$(PACKAGE)'; for tool in $$l; do \
  61. rm -f $$tool.sum $$tool.log; \
  62. done
  63. distclean-am: distclean-DEJAGNU
  64. check-am:
  65. @if test -n "$(filter -j%, $(MFLAGS))"; then \
  66. num_cpus=@CPU_COUNT@; \
  67. if type -p getconf 2>/dev/null >/dev/null; then \
  68. num_cpus=`getconf _NPROCESSORS_ONLN 2>/dev/null`; \
  69. case "$$num_cpus" in \
  70. '' | 0* | *[!0-9]*) num_cpus=@CPU_COUNT@;; \
  71. esac; \
  72. fi; \
  73. if test $$num_cpus -gt 8 && test -z "$$OMP_NUM_THREADS"; then \
  74. OMP_NUM_THREADS=8; export OMP_NUM_THREADS; \
  75. echo @@@ libgomp OMP_NUM_THREADS adjusted to 8 because of parallel make check and too many CPUs; \
  76. fi; \
  77. fi; \
  78. $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
  79. all-local: libgomp-test-support.exp
  80. .PHONY: check-DEJAGNU distclean-DEJAGNU