Makefile.am 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. tmpinst = _tmpinst
  2. noinst_SCRIPTS = mono-wrapper monodis-wrapper
  3. etctmp = etc
  4. 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
  5. if INSTALL_4_x
  6. symlinks += etc/mono/4.0/machine.config etc/mono/4.0/web.config etc/mono/4.5/web.config etc/mono/4.5/machine.config etc/mono/4.0/Browsers/Compat.browser etc/mono/4.5/Browsers/Compat.browser
  7. endif
  8. etc/mono/2.0/machine.config: $(top_srcdir)/data/net_2_0/machine.config
  9. etc/mono/2.0/web.config: $(top_srcdir)/data/net_2_0/web.config
  10. etc/mono/browscap.ini: $(top_srcdir)/data/browscap.ini
  11. etc/mono/2.0/Browsers/Compat.browser: $(top_srcdir)/data/Browsers/Compat.browser
  12. etc/mono/4.0/Browsers/Compat.browser: $(top_srcdir)/data/Browsers/Compat.browser
  13. etc/mono/4.5/Browsers/Compat.browser: $(top_srcdir)/data/Browsers/Compat.browser
  14. etc/mono/4.0/machine.config: $(top_srcdir)/data/net_4_0/machine.config
  15. etc/mono/4.0/web.config: $(top_srcdir)/data/net_4_0/web.config
  16. etc/mono/4.5/machine.config: $(top_srcdir)/data/net_4_5/machine.config
  17. etc/mono/4.5/web.config: $(top_srcdir)/data/net_4_5/web.config
  18. $(symlinks):
  19. cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
  20. SUPPORT_FILES = $(symlinks) mono-wrapper etc/mono/config
  21. build_profiles =
  22. if INSTALL_4_x
  23. build_profiles += binary_reference_assemblies net_4_x xbuild_12 xbuild_14
  24. net_profile = net_4_x
  25. endif
  26. if INSTALL_MONODROID
  27. build_profiles += monodroid monodroid_tools
  28. endif
  29. if INSTALL_MONOTOUCH
  30. build_profiles += monotouch monotouch_runtime
  31. endif
  32. if INSTALL_MONOTOUCH_WATCH
  33. build_profiles += monotouch_watch monotouch_watch_runtime
  34. endif
  35. if INSTALL_MONOTOUCH_TV
  36. build_profiles += monotouch_tv monotouch_tv_runtime
  37. endif
  38. if INSTALL_TESTING_AOT_HYBRID
  39. build_profiles += testing_aot_hybrid
  40. endif
  41. if INSTALL_TESTING_AOT_FULL
  42. build_profiles += testing_aot_full
  43. endif
  44. if INSTALL_WINAOT
  45. build_profiles += winaot
  46. endif
  47. if INSTALL_XAMMAC
  48. build_profiles += xammac xammac_net_4_5
  49. endif
  50. if INSTALL_ORBIS
  51. build_profiles += orbis
  52. endif
  53. if INSTALL_UNREAL
  54. build_profiles += unreal
  55. endif
  56. if INSTALL_WASM
  57. build_profiles += wasm
  58. endif
  59. test_profiles = $(filter-out binary_reference_assemblies monodroid_tools,$(build_profiles))
  60. if BUILD_MCS
  61. MAKE_FLAGS=$(if $(V),,--no-print-directory -s)
  62. # The write check is to foil 'make distcheck'
  63. all-local: $(SUPPORT_FILES) $(TEST_SUPPORT_FILES)
  64. if test -w $(mcs_topdir); then :; else chmod -R +w $(mcs_topdir); fi
  65. cd $(mcs_topdir) && $(MAKE) $(MAKE_FLAGS) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' CC='$(CC)' all-profiles
  66. # override automake
  67. install: install-exec install-data
  68. # override automake
  69. install-exec: $(SUPPORT_FILES) $(TEST_SUPPORT_FILES)
  70. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' RUNTIME_HAS_CONSISTENT_GACDIR=yes prefix=$(prefix) install-profiles
  71. # override automake
  72. install-data:
  73. @:
  74. # override automake
  75. uninstall:
  76. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' RUNTIME_HAS_CONSISTENT_GACDIR=yes prefix=$(prefix) uninstall-profiles
  77. clean-local:
  78. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' clean-profiles
  79. -rm -fr $(etctmp) $(tmpinst)
  80. endif BUILD_MCS
  81. TEST_SUPPORT_FILES = $(tmpinst)/bin/mono $(tmpinst)/bin/ilasm $(tmpinst)/bin/csc $(tmpinst)/bin/mcs $(tmpinst)/bin/al
  82. mcs-do-test-profiles:
  83. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' test-profiles
  84. mcs-do-run-test-profiles: test-support-files
  85. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' run-test-profiles
  86. if HOST_WIN32
  87. if CROSS_COMPILING
  88. cur_dir_cmd = pwd
  89. PLATFORM_PATH_SEPARATOR = :
  90. else
  91. cur_dir_cmd = cygpath -w -a .
  92. PLATFORM_PATH_SEPARATOR = ;
  93. endif
  94. else
  95. cur_dir_cmd = pwd
  96. PLATFORM_PATH_SEPARATOR = :
  97. endif
  98. # assemblies which are excluded from testing in mcs-compileall below
  99. VERIFY_TESTS_FILTER = System.Runtime.CompilerServices.Unsafe.dll
  100. if HOST_WIN32
  101. # Mono.WebBrowser.dll fails to verify on Windows
  102. VERIFY_TESTS_FILTER += Mono.WebBrowser.dll
  103. endif
  104. if FULL_AOT_TESTS
  105. # ILASM.exe has features which a testing_aot_full runtime will not support.
  106. # It is invoked with an external mono when used in the runtime.
  107. # We skip it here because otherwise it will fail to verify.
  108. VERIFY_TESTS_FILTER += ilasm.exe
  109. endif
  110. # Compile all assemblies with the verifier turned on. Code must be valid but not verifiable.
  111. # TODO it would be nice to split assemblies without unsafe code to use the verifier with verifiable mode.
  112. mcs-compileall: mono-wrapper etc/mono/config
  113. save_MONO_PATH=$$MONO_PATH; mcs_topdir=`cd $(mcs_topdir) && $(cur_dir_cmd)`; ok=:; \
  114. for profile in $(test_profiles); do \
  115. if [ "xbuild_12" = "$$profile" ]; then \
  116. MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$mcs_topdir/class/lib/net_4_x$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \
  117. elif [ "xbuild_14" = "$$profile" ]; then \
  118. MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$mcs_topdir/class/lib/net_4_x$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \
  119. else \
  120. MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \
  121. fi; \
  122. export verifiable_files=`ls "$(mcs_topdir)/class/lib/$$profile/" | grep -E '\.(dll|exe)$$' $(foreach asm,$(VERIFY_TESTS_FILTER), | grep -v $(asm))` ; \
  123. export MONO_PATH; \
  124. for stub in $$verifiable_files; do \
  125. i=$(mcs_topdir)/class/lib/$$profile/$$stub ; \
  126. echo $$i ; \
  127. if [ ! -f $$i ] ; then \
  128. continue ; \
  129. fi ; \
  130. if ./mono-wrapper --compile-all --verify-all --security=verifiable $$i; then \
  131. echo $$i verified OK; \
  132. else \
  133. echo $$i verification failed; ok=false; \
  134. fi; done; done; \
  135. 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; \
  136. $$ok
  137. check-local: mcs-compileall mcs-do-test-profiles
  138. $(MAKE) mcs-do-run-test-profiles
  139. # Compile all mcs tests
  140. test: mcs-do-test-profiles
  141. CLEANFILES = etc/mono/config
  142. # depend on $(symlinks) to ensure 'etc/mono' directory exists
  143. etc/mono/config: ../data/config Makefile $(symlinks)
  144. d=`cd ../support && pwd`; \
  145. sed 's,target="$$mono_libdir/libMonoPosixHelper$(libsuffix)",target="'$$d'/libMonoPosixHelper.la",' ../data/config > $@t
  146. d=`cd ../mono/btls/build-shared && pwd`; \
  147. sed 's,target="$$mono_libdir/libmono-btls-shared$(libsuffix)",target="'$$d'/libmono-btls-shared$(libsuffix)",' $@t > $@tt
  148. if test -z "$(libgdiplus_loc)"; then :; else \
  149. sed 's,target="$(libgdiplus_install_loc)",target="$(libgdiplus_loc)",' $@tt > $@ttt; \
  150. mv -f $@ttt $@tt; fi
  151. mv -f $@tt $@
  152. rm -f $@t
  153. $(tmpinst)/bin/mono: mono-wrapper etc/mono/config
  154. $(mkinstalldirs) $(tmpinst)/bin
  155. cp mono-wrapper $@
  156. $(tmpinst)/bin/csc: $(tmpinst)/bin/mono Makefile
  157. echo '#! /bin/sh' > $@ ; \
  158. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  159. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$(CSC)"'" "$$@"' >> $@ ; \
  160. chmod +x $@
  161. $(tmpinst)/bin/mcs: $(tmpinst)/bin/mono Makefile
  162. echo '#! /bin/sh' > $@ ; \
  163. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  164. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/$(net_profile)/mcs.exe"'" "$$@"' >> $@ ; \
  165. chmod +x $@
  166. $(tmpinst)/bin/ilasm: $(tmpinst)/bin/mono Makefile
  167. echo '#! /bin/sh' > $@ ; \
  168. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  169. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/ilasm/ilasm.exe"'" "$$@"' >> $@ ; \
  170. chmod +x $@
  171. $(tmpinst)/bin/al: $(tmpinst)/bin/mono Makefile
  172. echo '#! /bin/sh' > $@ ; \
  173. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  174. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/$(net_profile)/al.exe"'" "$$@"' >> $@ ; \
  175. chmod +x $@
  176. test-support-files: $(TEST_SUPPORT_FILES)
  177. @:
  178. # the 'cygnus' option also disables the default 'distdir:' target, which we _do_ want
  179. MYDISTFILES = $(DIST_COMMON)
  180. distdir: $(MYDISTFILES)
  181. rm -fr $(distdir)
  182. mkdir $(distdir)
  183. test -z '$(MYDISTFILES)' || for file in ''$(MYDISTFILES); do \
  184. cp -p $$file $(distdir) ; done
  185. find $(distdir) -type f -exec chmod a+r {} ';'