Makefile.am 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  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. if ENABLE_NETCORE
  69. build_profiles += netcore
  70. endif
  71. test_profiles = $(filter-out binary_reference_assemblies monodroid_tools wasm_tools,$(build_profiles))
  72. MAKE_FLAGS=$(if $(V),,--no-print-directory -s)
  73. # The write check is to foil 'make distcheck'
  74. all-mcs: $(SUPPORT_FILES) $(TEST_SUPPORT_FILES)
  75. if test -w $(mcs_topdir); then :; else chmod -R +w $(mcs_topdir); fi
  76. cd $(mcs_topdir) && $(MAKE) $(MAKE_FLAGS) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' CC='$(CC)' all-profiles
  77. install-mcs: install-mcs-exec install-mcs-data
  78. # override automake
  79. install-mcs-exec: $(SUPPORT_FILES) $(TEST_SUPPORT_FILES)
  80. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' RUNTIME_HAS_CONSISTENT_GACDIR=yes prefix=$(prefix) install-profiles
  81. # override automake
  82. install-mcs-data:
  83. @:
  84. # override automake
  85. uninstall-mcs:
  86. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' RUNTIME_HAS_CONSISTENT_GACDIR=yes prefix=$(prefix) uninstall-profiles
  87. clean-mcs:
  88. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' clean-profiles
  89. -rm -fr $(etctmp) $(tmpinst)
  90. if BUILD_MCS
  91. all-local: all-mcs
  92. # override automake
  93. install: install-mcs
  94. # override automake
  95. install-exec: install-mcs-exec
  96. # override automake
  97. install-data: install-mcs-data
  98. # override automake
  99. uninstall: uninstall-mcs
  100. clean-local: clean-mcs
  101. endif BUILD_MCS
  102. TEST_SUPPORT_FILES = $(tmpinst)/bin/mono $(tmpinst)/bin/ilasm $(tmpinst)/bin/csc $(tmpinst)/bin/mcs $(tmpinst)/bin/al
  103. mcs-do-test-profiles:
  104. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' test-profiles
  105. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' compiler-test-profiles
  106. mcs-do-xunit-test-profiles:
  107. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' xunit-test-profiles
  108. mcs-do-run-test-profiles: test-support-files
  109. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' run-test-profiles
  110. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' run-compiler-test-profiles
  111. mcs-do-xunit-run-test-profiles: test-support-files
  112. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' run-xunit-test-profiles
  113. test-bundle-local:
  114. mkdir -p $(TEST_BUNDLE_PATH)/_tmpinst/bin
  115. cp -L mono-test.sh $(TEST_BUNDLE_PATH)
  116. cp -L -R etc $(TEST_BUNDLE_PATH)/_tmpinst
  117. rm $(TEST_BUNDLE_PATH)/_tmpinst/etc/mono/config
  118. 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
  119. echo '#! /bin/sh' > $(TEST_BUNDLE_PATH)/_tmpinst/bin/al
  120. echo '#! /bin/sh' > $(TEST_BUNDLE_PATH)/_tmpinst/bin/mcs
  121. echo '#! /bin/sh' > $(TEST_BUNDLE_PATH)/_tmpinst/bin/ilasm
  122. echo '"$$MONO_EXECUTABLE" $$(dirname "$$MONO_EXECUTABLE")/net_4_x/al.exe "$$@"' >> $(TEST_BUNDLE_PATH)/_tmpinst/bin/al
  123. echo '"$$MONO_EXECUTABLE" $$(dirname "$$MONO_EXECUTABLE")/net_4_x/mcs.exe "$$@"' >> $(TEST_BUNDLE_PATH)/_tmpinst/bin/mcs
  124. echo '"$$MONO_EXECUTABLE" $$(dirname "$$MONO_EXECUTABLE")/net_4_x/ilasm.exe "$$@"' >> $(TEST_BUNDLE_PATH)/_tmpinst/bin/ilasm
  125. chmod +x $(TEST_BUNDLE_PATH)/_tmpinst/bin/al
  126. chmod +x $(TEST_BUNDLE_PATH)/_tmpinst/bin/mcs
  127. chmod +x $(TEST_BUNDLE_PATH)/_tmpinst/bin/ilasm
  128. for profile in $(test_profiles); do \
  129. cp -L -R $(mcs_topdir)/class/lib/$$profile $(TEST_BUNDLE_PATH); \
  130. done
  131. 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/
  132. $(MAKE) -C $(mcs_topdir)/tests test-bundle
  133. $(MAKE) -C $(mcs_topdir)/errors test-bundle
  134. $(MAKE) -C $(mcs_topdir)/packages test-bundle
  135. $(MAKE) -C $(mcs_topdir)/tools/mono-symbolicate test-bundle
  136. if HOST_WIN32
  137. if CROSS_COMPILING
  138. cur_dir_cmd = pwd
  139. PLATFORM_PATH_SEPARATOR = :
  140. else
  141. cur_dir_cmd = cygpath -w -a .
  142. PLATFORM_PATH_SEPARATOR = ;
  143. endif
  144. else
  145. cur_dir_cmd = pwd
  146. PLATFORM_PATH_SEPARATOR = :
  147. endif
  148. # assemblies which are excluded from testing in mcs-compileall below
  149. VERIFY_TESTS_FILTER = System.Runtime.CompilerServices.Unsafe.dll nunitlite.dll
  150. if HOST_WIN32
  151. # Mono.WebBrowser.dll fails to verify on Windows
  152. VERIFY_TESTS_FILTER += Mono.WebBrowser.dll
  153. endif
  154. # fails to verify with "VTable setup of type Xunit.NetCore.Extensions.SkippedTestCase failed", not sure why
  155. VERIFY_TESTS_FILTER += Xunit.NetCore.Extensions.dll
  156. if FULL_AOT_TESTS
  157. # ILASM.exe has features which a testing_aot_full runtime will not support.
  158. # It is invoked with an external mono when used in the runtime.
  159. # We skip it here because otherwise it will fail to verify.
  160. VERIFY_TESTS_FILTER += ilasm.exe
  161. endif
  162. # Compile all assemblies with the verifier turned on. Code must be valid but not verifiable.
  163. # TODO it would be nice to split assemblies without unsafe code to use the verifier with verifiable mode.
  164. mcs-compileall: mono-wrapper etc/mono/config
  165. save_MONO_PATH=$$MONO_PATH; mcs_topdir=`cd $(mcs_topdir) && $(cur_dir_cmd)`; ok=:; \
  166. for profile in $(test_profiles); do \
  167. if [ "xbuild_12" = "$$profile" ]; then \
  168. MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$mcs_topdir/class/lib/net_4_x$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \
  169. elif [ "xbuild_14" = "$$profile" ]; then \
  170. MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$mcs_topdir/class/lib/net_4_x$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \
  171. else \
  172. MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \
  173. fi; \
  174. 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))` ; \
  175. export MONO_PATH; \
  176. for stub in $$verifiable_files; do \
  177. i=$(mcs_topdir)/class/lib/$$profile/$$stub ; \
  178. echo $$i ; \
  179. if [ ! -f $$i ] ; then \
  180. continue ; \
  181. fi ; \
  182. if ./mono-wrapper --compile-all --verify-all --security=verifiable $$i; then \
  183. echo $$i verified OK; \
  184. else \
  185. echo $$i verification failed; ok=false; \
  186. fi; done; done; \
  187. 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; \
  188. $$ok
  189. check-local: mcs-compileall mcs-do-test-profiles mcs-do-xunit-test-profiles
  190. $(MAKE) mcs-do-run-test-profiles mcs-do-run-xunit-test-profiles
  191. # Compile all mcs tests
  192. test: mcs-do-test-profiles
  193. xunit-test: mcs-do-xunit-test-profiles
  194. CLEANFILES = etc/mono/config
  195. # depend on $(symlinks) to ensure 'etc/mono' directory exists
  196. etc/mono/config: ../data/config Makefile $(symlinks)
  197. cp $< $@
  198. if test -d "$(abs_top_builddir)/support"; then \
  199. sed 's,target="$$mono_libdir/libMonoPosixHelper$(libsuffix)",target="$(abs_top_builddir)/support/libMonoPosixHelper.la",' $@ > [email protected] \
  200. && mv [email protected] $@ \
  201. ; \
  202. else \
  203. echo "Unknown directory '$(abs_top_builddir)/support'" && false; \
  204. fi
  205. if test -d "$(abs_top_builddir)/mono/native"; then \
  206. sed 's,target="$$mono_libdir/$(MONO_NATIVE_LIBRARY_NAME)$(libsuffix)",target="$(abs_top_builddir)/mono/native/$(MONO_NATIVE_LIBRARY_NAME).la",' $@ > [email protected] \
  207. && mv [email protected] $@ \
  208. ; \
  209. else \
  210. echo "Unknown directory '$(abs_top_builddir)/mono/native'" && false; \
  211. fi
  212. if test -d "$(abs_top_builddir)/mono/btls/build-shared"; then \
  213. sed 's,target="$$mono_libdir/libmono-btls-shared$(libsuffix)",target="$(abs_top_builddir)/mono/btls/build-shared/libmono-btls-shared$(libsuffix)",' $@ > [email protected] \
  214. && mv [email protected] $@ \
  215. ; \
  216. else \
  217. echo "Unknown directory '$(abs_top_builddir)/mono/btls/build-shared'"; \
  218. fi
  219. if test -n "$(libgdiplus_loc)"; then \
  220. sed 's,target="$(libgdiplus_install_loc)",target="$(libgdiplus_loc)",' $@ > [email protected] \
  221. && mv [email protected] $@ \
  222. ; \
  223. fi
  224. cat $@
  225. $(tmpinst)/bin/mono: mono-wrapper etc/mono/config
  226. $(mkinstalldirs) $(tmpinst)/bin
  227. cp mono-wrapper $@
  228. $(tmpinst)/bin/csc: $(tmpinst)/bin/mono Makefile
  229. echo '#! /bin/sh' > $@ ; \
  230. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  231. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$(CSC)"'" "$$@"' >> $@ ; \
  232. chmod +x $@
  233. $(tmpinst)/bin/mcs: $(tmpinst)/bin/mono Makefile
  234. echo '#! /bin/sh' > $@ ; \
  235. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  236. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/$(net_profile)/mcs.exe"'" "$$@"' >> $@ ; \
  237. chmod +x $@
  238. $(tmpinst)/bin/ilasm: $(tmpinst)/bin/mono Makefile
  239. echo '#! /bin/sh' > $@ ; \
  240. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  241. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/ilasm/ilasm.exe"'" "$$@"' >> $@ ; \
  242. chmod +x $@
  243. $(tmpinst)/bin/al: $(tmpinst)/bin/mono Makefile
  244. echo '#! /bin/sh' > $@ ; \
  245. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  246. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/$(net_profile)/al.exe"'" "$$@"' >> $@ ; \
  247. chmod +x $@
  248. test-support-files: $(TEST_SUPPORT_FILES)
  249. @: