Makefile.am 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. tmpinst = _tmpinst
  2. noinst_SCRIPTS = mono-wrapper monodis-wrapper
  3. EXTRA_DIST = bin/mono-hang-watchdog.in
  4. etctmp = etc
  5. symlinks = etc/mono/1.0/machine.config etc/mono/2.0/machine.config etc/mono/2.0/web.config etc/mono/browscap.ini etc/mono/2.0/Browsers/Compat.browser
  6. if INSTALL_4_x
  7. symlinks += etc/mono/4.0/machine.config etc/mono/4.0/web.config etc/mono/4.5/web.config etc/mono/4.0/Browsers/Compat.browser etc/mono/4.5/Browsers/Compat.browser
  8. endif
  9. # This is needed at least to build configure --with-runtime-preset=fullaot.
  10. symlinks += etc/mono/4.5/machine.config
  11. etc/mono/2.0/machine.config: $(top_srcdir)/data/net_2_0/machine.config
  12. etc/mono/2.0/web.config: $(top_srcdir)/data/net_2_0/web.config
  13. etc/mono/browscap.ini: $(top_srcdir)/data/browscap.ini
  14. etc/mono/2.0/Browsers/Compat.browser: $(top_srcdir)/data/Browsers/Compat.browser
  15. etc/mono/4.0/Browsers/Compat.browser: $(top_srcdir)/data/Browsers/Compat.browser
  16. etc/mono/4.5/Browsers/Compat.browser: $(top_srcdir)/data/Browsers/Compat.browser
  17. etc/mono/4.0/machine.config: $(top_srcdir)/data/net_4_0/machine.config
  18. etc/mono/4.0/web.config: $(top_srcdir)/data/net_4_0/web.config
  19. etc/mono/4.5/machine.config: $(top_srcdir)/data/net_4_5/machine.config
  20. etc/mono/4.5/web.config: $(top_srcdir)/data/net_4_5/web.config
  21. $(symlinks):
  22. cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
  23. SUPPORT_FILES = $(symlinks) mono-wrapper etc/mono/config
  24. build_profiles =
  25. if INSTALL_4_x
  26. build_profiles += binary_reference_assemblies net_4_x xbuild_12 xbuild_14
  27. net_profile = net_4_x
  28. endif
  29. if INSTALL_MONODROID
  30. build_profiles += monodroid monodroid_tools
  31. endif
  32. if INSTALL_MONOTOUCH
  33. build_profiles += monotouch monotouch_runtime
  34. endif
  35. if INSTALL_MONOTOUCH_WATCH
  36. build_profiles += monotouch_watch monotouch_watch_runtime
  37. endif
  38. if INSTALL_MONOTOUCH_TV
  39. build_profiles += monotouch_tv monotouch_tv_runtime
  40. endif
  41. if INSTALL_TESTING_AOT_FULL_INTERP
  42. build_profiles += testing_aot_full_interp
  43. endif
  44. if INSTALL_TESTING_AOT_HYBRID
  45. build_profiles += testing_aot_hybrid
  46. endif
  47. if INSTALL_TESTING_AOT_FULL
  48. build_profiles += testing_aot_full
  49. endif
  50. if INSTALL_WINAOT
  51. build_profiles += winaot
  52. endif
  53. if INSTALL_TESTING_WINAOT_INTERP
  54. build_profiles += testing_winaot_interp
  55. endif
  56. if INSTALL_XAMMAC
  57. build_profiles += xammac xammac_net_4_5
  58. endif
  59. if INSTALL_ORBIS
  60. build_profiles += orbis
  61. endif
  62. if INSTALL_UNREAL
  63. build_profiles += unreal
  64. endif
  65. if INSTALL_WASM
  66. build_profiles += wasm wasm_tools
  67. endif
  68. test_profiles = $(filter-out binary_reference_assemblies monodroid_tools wasm_tools,$(build_profiles))
  69. MAKE_FLAGS=$(if $(V),,--no-print-directory -s)
  70. # The write check is to foil 'make distcheck'
  71. all-mcs: $(SUPPORT_FILES) $(TEST_SUPPORT_FILES)
  72. if test -w $(mcs_topdir); then :; else chmod -R +w $(mcs_topdir); fi
  73. cd $(mcs_topdir) && $(MAKE) $(MAKE_FLAGS) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' CC='$(CC)' all-profiles
  74. install-mcs: install-mcs-exec install-mcs-data
  75. # override automake
  76. install-mcs-exec: $(SUPPORT_FILES) $(TEST_SUPPORT_FILES)
  77. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' RUNTIME_HAS_CONSISTENT_GACDIR=yes prefix=$(prefix) install-profiles
  78. # override automake
  79. install-mcs-data:
  80. @:
  81. # override automake
  82. uninstall-mcs:
  83. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' RUNTIME_HAS_CONSISTENT_GACDIR=yes prefix=$(prefix) uninstall-profiles
  84. clean-mcs:
  85. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' clean-profiles
  86. -rm -fr $(etctmp) $(tmpinst)
  87. if BUILD_MCS
  88. all-local: all-mcs
  89. # override automake
  90. install: install-mcs
  91. # override automake
  92. install-exec: install-mcs-exec
  93. # override automake
  94. install-data: install-mcs-data
  95. # override automake
  96. uninstall: uninstall-mcs
  97. clean-local: clean-mcs
  98. endif BUILD_MCS
  99. TEST_SUPPORT_FILES = $(tmpinst)/bin/mono $(tmpinst)/bin/ilasm $(tmpinst)/bin/csc $(tmpinst)/bin/mcs $(tmpinst)/bin/al
  100. mcs-do-test-profiles:
  101. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' test-profiles
  102. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' compiler-test-profiles
  103. mcs-do-xunit-test-profiles:
  104. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' xunit-test-profiles
  105. mcs-do-run-test-profiles: test-support-files
  106. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' run-test-profiles
  107. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' run-compiler-test-profiles
  108. mcs-do-xunit-run-test-profiles: test-support-files
  109. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' run-xunit-test-profiles
  110. test-bundle-local:
  111. mkdir -p $(TEST_BUNDLE_PATH)/_tmpinst/bin
  112. cp -L mono-test.sh $(TEST_BUNDLE_PATH)
  113. cp -L -R etc $(TEST_BUNDLE_PATH)/_tmpinst
  114. rm $(TEST_BUNDLE_PATH)/_tmpinst/etc/mono/config
  115. sed -e 's,$$mono_libdir,$$test_root_dir,g' -e 's,target="$(libgdiplus_install_loc)",target="$$test_root_dir/mono-libgdiplus$(libsuffix)",g' $(top_builddir)/data/config > $(TEST_BUNDLE_PATH)/_tmpinst/etc/mono/config.tmpl
  116. echo '#! /bin/sh' > $(TEST_BUNDLE_PATH)/_tmpinst/bin/al
  117. echo '#! /bin/sh' > $(TEST_BUNDLE_PATH)/_tmpinst/bin/mcs
  118. echo '#! /bin/sh' > $(TEST_BUNDLE_PATH)/_tmpinst/bin/ilasm
  119. echo '"$$MONO_EXECUTABLE" $$(dirname "$$MONO_EXECUTABLE")/net_4_x/al.exe "$$@"' >> $(TEST_BUNDLE_PATH)/_tmpinst/bin/al
  120. echo '"$$MONO_EXECUTABLE" $$(dirname "$$MONO_EXECUTABLE")/net_4_x/mcs.exe "$$@"' >> $(TEST_BUNDLE_PATH)/_tmpinst/bin/mcs
  121. echo '"$$MONO_EXECUTABLE" $$(dirname "$$MONO_EXECUTABLE")/net_4_x/ilasm.exe "$$@"' >> $(TEST_BUNDLE_PATH)/_tmpinst/bin/ilasm
  122. chmod +x $(TEST_BUNDLE_PATH)/_tmpinst/bin/al
  123. chmod +x $(TEST_BUNDLE_PATH)/_tmpinst/bin/mcs
  124. chmod +x $(TEST_BUNDLE_PATH)/_tmpinst/bin/ilasm
  125. for profile in $(test_profiles); do \
  126. cp -L -R $(mcs_topdir)/class/lib/$$profile $(TEST_BUNDLE_PATH); \
  127. done
  128. cp -L $(top_srcdir)/external/xunit-binaries/*.dll $(top_srcdir)/external/xunit-binaries/*.exe $(top_srcdir)/external/xunit-binaries/*.config $(TEST_BUNDLE_PATH)/net_4_x/
  129. $(MAKE) -C $(mcs_topdir)/tests test-bundle
  130. $(MAKE) -C $(mcs_topdir)/errors test-bundle
  131. $(MAKE) -C $(mcs_topdir)/packages test-bundle
  132. $(MAKE) -C $(mcs_topdir)/tools/mono-symbolicate test-bundle
  133. if HOST_WIN32
  134. if CROSS_COMPILING
  135. cur_dir_cmd = pwd
  136. PLATFORM_PATH_SEPARATOR = :
  137. else
  138. cur_dir_cmd = cygpath -w -a .
  139. PLATFORM_PATH_SEPARATOR = ;
  140. endif
  141. else
  142. cur_dir_cmd = pwd
  143. PLATFORM_PATH_SEPARATOR = :
  144. endif
  145. # assemblies which are excluded from testing in mcs-compileall below
  146. VERIFY_TESTS_FILTER = System.Runtime.CompilerServices.Unsafe.dll nunitlite.dll
  147. if HOST_WIN32
  148. # Mono.WebBrowser.dll fails to verify on Windows
  149. VERIFY_TESTS_FILTER += Mono.WebBrowser.dll
  150. endif
  151. # fails to verify with "VTable setup of type Xunit.NetCore.Extensions.SkippedTestCase failed", not sure why
  152. VERIFY_TESTS_FILTER += Xunit.NetCore.Extensions.dll
  153. if FULL_AOT_TESTS
  154. # ILASM.exe has features which a testing_aot_full runtime will not support.
  155. # It is invoked with an external mono when used in the runtime.
  156. # We skip it here because otherwise it will fail to verify.
  157. VERIFY_TESTS_FILTER += ilasm.exe
  158. endif
  159. # Compile all assemblies with the verifier turned on. Code must be valid but not verifiable.
  160. # TODO it would be nice to split assemblies without unsafe code to use the verifier with verifiable mode.
  161. mcs-compileall: mono-wrapper etc/mono/config
  162. save_MONO_PATH=$$MONO_PATH; mcs_topdir=`cd $(mcs_topdir) && $(cur_dir_cmd)`; ok=:; \
  163. for profile in $(test_profiles); do \
  164. if [ "xbuild_12" = "$$profile" ]; then \
  165. MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$mcs_topdir/class/lib/net_4_x$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \
  166. elif [ "xbuild_14" = "$$profile" ]; then \
  167. MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$mcs_topdir/class/lib/net_4_x$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \
  168. else \
  169. MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \
  170. fi; \
  171. export verifiable_files=`ls "$(mcs_topdir)/class/lib/$$profile/" | grep -E '\.(dll|exe)$$' | grep -v '\.dll\.dll$$' | grep -v '\.exe\.dll$$' $(foreach asm,$(VERIFY_TESTS_FILTER), | grep -v $(asm))` ; \
  172. export MONO_PATH; \
  173. for stub in $$verifiable_files; do \
  174. i=$(mcs_topdir)/class/lib/$$profile/$$stub ; \
  175. echo $$i ; \
  176. if [ ! -f $$i ] ; then \
  177. continue ; \
  178. fi ; \
  179. if ./mono-wrapper --compile-all --verify-all --security=verifiable $$i; then \
  180. echo $$i verified OK; \
  181. else \
  182. echo $$i verification failed; ok=false; \
  183. fi; done; done; \
  184. if [ "$$ok" = "false" ]; then echo "<?xml version='1.0' encoding='utf-8'?><test-results failures='1' total='1' not-run='0' name='verify' date='$$(date +%F)' time='$$(date +%T)'><test-suite name='mcs-compileall' success='False' time='0'><results><test-case name='fail' executed='True' success='False' time='0'><failure><message>Verifying framework assemblies failed. Check the log for more details.</message><stack-trace></stack-trace></failure></test-case></results></test-suite></test-results>" > TestResult-verify.xml; fi; \
  185. $$ok
  186. check-local: mcs-compileall mcs-do-test-profiles mcs-do-xunit-test-profiles
  187. $(MAKE) mcs-do-run-test-profiles mcs-do-run-xunit-test-profiles
  188. # Compile all mcs tests
  189. test: mcs-do-test-profiles
  190. xunit-test: mcs-do-xunit-test-profiles
  191. CLEANFILES = etc/mono/config
  192. # depend on $(symlinks) to ensure 'etc/mono' directory exists
  193. etc/mono/config: ../data/config Makefile $(symlinks)
  194. cp $< $@
  195. if test -d "$(abs_top_builddir)/support"; then \
  196. sed 's,target="$$mono_libdir/libMonoPosixHelper$(libsuffix)",target="$(abs_top_builddir)/support/libMonoPosixHelper.la",' $@ > [email protected] \
  197. && mv [email protected] $@ \
  198. ; \
  199. else \
  200. echo "Unknown directory '$(abs_top_builddir)/support'" && false; \
  201. fi
  202. if test -d "$(abs_top_builddir)/mono/native"; then \
  203. sed 's,target="$$mono_libdir/$(MONO_NATIVE_LIBRARY_NAME)$(libsuffix)",target="$(abs_top_builddir)/mono/native/$(MONO_NATIVE_LIBRARY_NAME).la",' $@ > [email protected] \
  204. && mv [email protected] $@ \
  205. ; \
  206. else \
  207. echo "Unknown directory '$(abs_top_builddir)/mono/native'" && false; \
  208. fi
  209. if test -d "$(abs_top_builddir)/mono/btls/build-shared"; then \
  210. sed 's,target="$$mono_libdir/libmono-btls-shared$(libsuffix)",target="$(abs_top_builddir)/mono/btls/build-shared/libmono-btls-shared$(libsuffix)",' $@ > [email protected] \
  211. && mv [email protected] $@ \
  212. ; \
  213. else \
  214. echo "Unknown directory '$(abs_top_builddir)/mono/btls/build-shared'"; \
  215. fi
  216. if test -n "$(libgdiplus_loc)"; then \
  217. sed 's,target="$(libgdiplus_install_loc)",target="$(libgdiplus_loc)",' $@ > [email protected] \
  218. && mv [email protected] $@ \
  219. ; \
  220. fi
  221. cat $@
  222. $(tmpinst)/bin/mono: mono-wrapper etc/mono/config
  223. $(mkinstalldirs) $(tmpinst)/bin
  224. cp mono-wrapper $@
  225. $(tmpinst)/bin/csc: $(tmpinst)/bin/mono Makefile
  226. echo '#! /bin/sh' > $@ ; \
  227. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  228. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$(CSC)"'" "$$@"' >> $@ ; \
  229. chmod +x $@
  230. $(tmpinst)/bin/mcs: $(tmpinst)/bin/mono Makefile
  231. echo '#! /bin/sh' > $@ ; \
  232. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  233. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/$(net_profile)/mcs.exe"'" "$$@"' >> $@ ; \
  234. chmod +x $@
  235. $(tmpinst)/bin/ilasm: $(tmpinst)/bin/mono Makefile
  236. echo '#! /bin/sh' > $@ ; \
  237. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  238. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/ilasm/ilasm.exe"'" "$$@"' >> $@ ; \
  239. chmod +x $@
  240. $(tmpinst)/bin/al: $(tmpinst)/bin/mono Makefile
  241. echo '#! /bin/sh' > $@ ; \
  242. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  243. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/$(net_profile)/al.exe"'" "$$@"' >> $@ ; \
  244. chmod +x $@
  245. test-support-files: $(TEST_SUPPORT_FILES)
  246. @: