Makefile.am 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. # hack to prevent 'check' from depending on 'all'
  2. AUTOMAKE_OPTIONS = cygnus
  3. tmpinst = _tmpinst
  4. noinst_SCRIPTS = mono-wrapper monodis-wrapper semdel-wrapper
  5. etctmp = etc
  6. symlinks = etc/mono/1.0/machine.config etc/mono/2.0/machine.config
  7. etc/mono/1.0/machine.config: $(top_srcdir)/data/net_1_1/machine.config
  8. etc/mono/2.0/machine.config: $(top_srcdir)/data/net_2_0/machine.config
  9. $(symlinks):
  10. cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
  11. SUPPORT_FILES = $(symlinks) mono-wrapper wrapper-config
  12. # The write check is to foil 'make distcheck'
  13. all-local: $(SUPPORT_FILES)
  14. if test -w $(mcs_topdir); then :; else chmod -R +w $(mcs_topdir); fi
  15. d=`pwd`; ok=:; \
  16. ( cd $(mcs_topdir) && \
  17. $(MAKE) PROFILES='$(build_profiles)' all-profiles ) || ok=false; \
  18. ./semdel-wrapper || :; $$ok
  19. if INSTALL_2_0
  20. build_profiles = default net_2_0
  21. else
  22. build_profiles = default
  23. endif
  24. # override automake
  25. install: install-exec install-data
  26. # override automake
  27. install-exec: $(SUPPORT_FILES)
  28. d=`pwd`; ok=:; \
  29. ( cd $(mcs_topdir) && \
  30. $(MAKE) PROFILES='$(build_profiles)' RUNTIME_HAS_CONSISTENT_GACDIR=yes prefix=$(prefix) install-profiles ) || ok=false; \
  31. ./semdel-wrapper || :; $$ok
  32. # override automake
  33. install-data:
  34. @:
  35. # override automake
  36. uninstall:
  37. d=`pwd`; ok=:; \
  38. ( cd $(mcs_topdir) && \
  39. $(MAKE) PROFILES='$(build_profiles)' RUNTIME_HAS_CONSISTENT_GACDIR=yes prefix=$(prefix) uninstall-profiles ) || ok=false; \
  40. ./semdel-wrapper || :; $$ok
  41. ## semdel-wrapper will probably not delete the semaphore if someone is crazy enough to do a 'make -j distclean' :-)
  42. clean-local:
  43. d=`pwd`; cd $(mcs_topdir) && $(MAKE) PROFILES='$(build_profiles)' clean-profiles
  44. -./semdel-wrapper
  45. -rm -fr $(etctmp) $(tmpinst) .wapi
  46. if INSTALL_2_0
  47. TEST_SUPPORT_FILES = $(tmpinst)/bin/mono $(tmpinst)/bin/mcs $(tmpinst)/bin/mbas $(tmpinst)/bin/ilasm $(tmpinst)/bin/gmcs
  48. else
  49. TEST_SUPPORT_FILES = $(tmpinst)/bin/mono $(tmpinst)/bin/mcs $(tmpinst)/bin/mbas $(tmpinst)/bin/ilasm
  50. endif
  51. # now a misnomer, but it'll go away soon enough.
  52. if ENABLE_NUNIT_TESTS
  53. test_select =
  54. else
  55. test_select = ONLY_CENTUM_TESTS=yes
  56. endif
  57. mcs-do-test-profiles:
  58. d=`pwd`; ok=:; \
  59. ( cd $(mcs_topdir) && $(MAKE) PROFILES='$(build_profiles)' test-profiles ) || ok=false; \
  60. ./semdel-wrapper || :; $$ok
  61. mcs-do-run-test-profiles: test-support-files
  62. d=`pwd`; ok=:; PATH=$$d/$(tmpinst)/bin:$$PATH ; export PATH ; \
  63. ( cd $(mcs_topdir) && $(MAKE) PROFILES='$(build_profiles)' run-test-profiles ) || ok=false; \
  64. ./semdel-wrapper || :; rm -fr $(tmpinst); $$ok
  65. if PLATFORM_WIN32
  66. cur_dir_cmd = cygpath -w -a .
  67. PLATFORM_PATH_SEPARATOR = ;
  68. else
  69. cur_dir_cmd = pwd
  70. PLATFORM_PATH_SEPARATOR = :
  71. endif
  72. # Use --compile-all as a poor man's PEVerify to detect invalid IL
  73. mcs-compileall: mono-wrapper wrapper-config
  74. save_MONO_PATH=$$MONO_PATH; mcs_topdir=`cd $(mcs_topdir) && $(cur_dir_cmd)`; ok=:; \
  75. for profile in $(build_profiles); do \
  76. MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; export MONO_PATH; \
  77. for i in $(mcs_topdir)/class/lib/$$profile/*.dll $(mcs_topdir)/class/lib/$$profile/*.exe $(mcs_topdir)/class/Microsoft.VisualBasic/fixup/$$profile/*.dll; do \
  78. if ./mono-wrapper --compile-all $$i; then \
  79. echo $$i verified OK; \
  80. else \
  81. echo $$i verification failed; ok=false; \
  82. fi; done; done; \
  83. ./semdel-wrapper || :; $$ok
  84. check-local: mcs-compileall mcs-do-test-profiles
  85. $(MAKE) $(test_select) mcs-do-run-test-profiles
  86. CLEANFILES = wrapper-config
  87. wrapper-config: ../data/config Makefile
  88. d=`cd ../support && pwd`; \
  89. sed 's,target="libMonoPosixHelper[^"]*",target="'$$d/libMonoPosixHelper.la'",' ../data/config > $@
  90. if test -z "$(libgdiplus_loc)"; then :; else \
  91. mv $@ $@t; \
  92. sed 's,<configuration>,& <dllmap dll="gdiplus.dll" target="$(libgdiplus_loc)" />,' $@t > $@; \
  93. rm -f $@t; \
  94. fi
  95. $(tmpinst)/bin/mono: mono-wrapper wrapper-config
  96. cp mono-wrapper $@
  97. $(tmpinst)/bin/mcs:
  98. $(MAKE) test-support-file target=$@ file=class/lib/default/mcs.exe
  99. $(tmpinst)/bin/mbas:
  100. $(MAKE) test-support-file target=$@ file=mbas/mbas.exe
  101. $(tmpinst)/bin/gmcs:
  102. $(MAKE) test-support-file target=$@ file=gmcs/gmcs.exe
  103. $(tmpinst)/bin/ilasm:
  104. $(MAKE) test-support-file target=$@ file=ilasm/ilasm.exe
  105. test-support-files:
  106. $(mkinstalldirs) $(tmpinst)/bin
  107. $(MAKE) $(TEST_SUPPORT_FILES)
  108. test-support-file:
  109. echo '#! /bin/sh' > $(target)
  110. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; echo 'exec "'"$$r/mono-wrapper"'" "'"$$m/$(file)"'" "$$@"' >> $(target)
  111. chmod +x $(target)
  112. $(tmpinst)/bin/pedump: $(srcdir)/Makefile.am
  113. $(mkdir_p) $(@D)
  114. (b=`pwd`; echo '#! /bin/sh'; echo 'exec "'"$$b/libtool"'" --mode=execute "'"$$b/mono/metadata/pedump"'" "$$@"') > $@
  115. chmod +x $@
  116. # the 'cygnus' option also disables the default 'distdir:' target, which we _do_ want
  117. MYDISTFILES = $(DIST_COMMON)
  118. distdir: $(MYDISTFILES)
  119. rm -fr $(distdir)
  120. mkdir $(distdir)
  121. test -z '$(MYDISTFILES)' || for file in ''$(MYDISTFILES); do \
  122. cp -p $$file $(distdir) ; done
  123. find $(distdir) -type f -exec chmod a+r {} ';'