4 noinst_SCRIPTS = mono-wrapper monodis-wrapper
7 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
10 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
13 # This is needed at least to build configure --with-runtime-preset=fullaot.
14 symlinks += etc/mono/4.5/machine.config
16 etc/mono/2.0/machine.config: $(top_srcdir)/data/net_2_0/machine.config
17 etc/mono/2.0/web.config: $(top_srcdir)/data/net_2_0/web.config
18 etc/mono/browscap.ini: $(top_srcdir)/data/browscap.ini
19 etc/mono/2.0/Browsers/Compat.browser: $(top_srcdir)/data/Browsers/Compat.browser
20 etc/mono/4.0/Browsers/Compat.browser: $(top_srcdir)/data/Browsers/Compat.browser
21 etc/mono/4.5/Browsers/Compat.browser: $(top_srcdir)/data/Browsers/Compat.browser
22 etc/mono/4.0/machine.config: $(top_srcdir)/data/net_4_0/machine.config
23 etc/mono/4.0/web.config: $(top_srcdir)/data/net_4_0/web.config
24 etc/mono/4.5/machine.config: $(top_srcdir)/data/net_4_5/machine.config
25 etc/mono/4.5/web.config: $(top_srcdir)/data/net_4_5/web.config
28 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
30 SUPPORT_FILES = $(symlinks) mono-wrapper etc/mono/config
35 build_profiles += binary_reference_assemblies net_4_x xbuild_12 xbuild_14
40 build_profiles += monodroid monodroid_tools
44 build_profiles += monotouch monotouch_runtime
47 if INSTALL_MONOTOUCH_WATCH
48 build_profiles += monotouch_watch monotouch_watch_runtime
51 if INSTALL_MONOTOUCH_TV
52 build_profiles += monotouch_tv monotouch_tv_runtime
55 if INSTALL_TESTING_AOT_FULL_INTERP
56 build_profiles += testing_aot_full_interp
59 if INSTALL_TESTING_AOT_HYBRID
60 build_profiles += testing_aot_hybrid
63 if INSTALL_TESTING_AOT_FULL
64 build_profiles += testing_aot_full
68 build_profiles += winaot
72 build_profiles += xammac xammac_net_4_5
76 build_profiles += orbis
80 build_profiles += unreal
84 build_profiles += wasm wasm_tools
87 test_profiles = $(filter-out binary_reference_assemblies monodroid_tools wasm_tools,$(build_profiles))
89 MAKE_FLAGS=$(if $(V),,--no-print-directory -s)
91 # The write check is to foil 'make distcheck'
92 all-mcs: $(SUPPORT_FILES) $(TEST_SUPPORT_FILES)
93 if test -w $(mcs_topdir); then :; else chmod -R +w $(mcs_topdir); fi
94 cd $(mcs_topdir) && $(MAKE) $(MAKE_FLAGS) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' CC='$(CC)' all-profiles
96 install-mcs: install-mcs-exec install-mcs-data
99 install-mcs-exec: $(SUPPORT_FILES) $(TEST_SUPPORT_FILES)
100 cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' RUNTIME_HAS_CONSISTENT_GACDIR=yes prefix=$(prefix) install-profiles
108 cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' RUNTIME_HAS_CONSISTENT_GACDIR=yes prefix=$(prefix) uninstall-profiles
111 cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' clean-profiles
112 -rm -fr $(etctmp) $(tmpinst)
122 install-exec: install-mcs-exec
125 install-data: install-mcs-data
128 uninstall: uninstall-mcs
130 clean-local: clean-mcs
134 TEST_SUPPORT_FILES = $(tmpinst)/bin/mono $(tmpinst)/bin/ilasm $(tmpinst)/bin/csc $(tmpinst)/bin/mcs $(tmpinst)/bin/al
136 mcs-do-test-profiles:
137 cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' test-profiles
139 mcs-do-xunit-test-profiles:
140 cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' xunit-test-profiles
142 mcs-do-run-test-profiles: test-support-files
143 cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' run-test-profiles
145 mcs-do-xunit-run-test-profiles: test-support-files
146 cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' run-xunit-test-profiles
151 PLATFORM_PATH_SEPARATOR = :
153 cur_dir_cmd = cygpath -w -a .
154 PLATFORM_PATH_SEPARATOR = ;
158 PLATFORM_PATH_SEPARATOR = :
161 # assemblies which are excluded from testing in mcs-compileall below
162 VERIFY_TESTS_FILTER = System.Runtime.CompilerServices.Unsafe.dll
165 # Mono.WebBrowser.dll fails to verify on Windows
166 VERIFY_TESTS_FILTER += Mono.WebBrowser.dll
169 # fails to verify with "VTable setup of type Xunit.NetCore.Extensions.SkippedTestCase failed", not sure why
170 VERIFY_TESTS_FILTER += Xunit.NetCore.Extensions.dll
173 # ILASM.exe has features which a testing_aot_full runtime will not support.
174 # It is invoked with an external mono when used in the runtime.
175 # We skip it here because otherwise it will fail to verify.
176 VERIFY_TESTS_FILTER += ilasm.exe
179 # Compile all assemblies with the verifier turned on. Code must be valid but not verifiable.
180 # TODO it would be nice to split assemblies without unsafe code to use the verifier with verifiable mode.
181 mcs-compileall: mono-wrapper etc/mono/config
182 save_MONO_PATH=$$MONO_PATH; mcs_topdir=`cd $(mcs_topdir) && $(cur_dir_cmd)`; ok=:; \
183 for profile in $(test_profiles); do \
184 if [ "xbuild_12" = "$$profile" ]; then \
185 MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$mcs_topdir/class/lib/net_4_x$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \
186 elif [ "xbuild_14" = "$$profile" ]; then \
187 MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$mcs_topdir/class/lib/net_4_x$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \
189 MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \
191 export verifiable_files=`ls "$(mcs_topdir)/class/lib/$$profile/" | grep -E '\.(dll|exe)$$' $(foreach asm,$(VERIFY_TESTS_FILTER), | grep -v $(asm))` ; \
193 for stub in $$verifiable_files; do \
194 i=$(mcs_topdir)/class/lib/$$profile/$$stub ; \
196 if [ ! -f $$i ] ; then \
199 if ./mono-wrapper --compile-all --verify-all --security=verifiable $$i; then \
200 echo $$i verified OK; \
202 echo $$i verification failed; ok=false; \
204 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; \
207 check-local: mcs-compileall mcs-do-test-profiles mcs-do-xunit-test-profiles
208 $(MAKE) mcs-do-run-test-profiles mcs-do-run-xunit-test-profiles
210 # Compile all mcs tests
211 test: mcs-do-test-profiles
212 xunit-test: mcs-do-xunit-test-profiles
214 CLEANFILES = etc/mono/config
216 # depend on $(symlinks) to ensure 'etc/mono' directory exists
217 etc/mono/config: ../data/config Makefile $(symlinks)
219 if test -d "$(abs_top_builddir)/support"; then \
220 sed 's,target="$$mono_libdir/libMonoPosixHelper$(libsuffix)",target="$(abs_top_builddir)/support/libMonoPosixHelper.la",' $@ > $@.tmp \
224 echo "Unknown directory '$(abs_top_builddir)/support'" && false; \
226 if test -d "$(abs_top_builddir)/mono/native"; then \
227 sed 's,target="$$mono_libdir/$(MONO_NATIVE_LIBRARY_NAME)$(libsuffix)",target="$(abs_top_builddir)/mono/native/$(MONO_NATIVE_LIBRARY_NAME).la",' $@ > $@.tmp \
231 echo "Unknown directory '$(abs_top_builddir)/mono/native'" && false; \
233 if test -d "$(abs_top_builddir)/mono/btls/build-shared"; then \
234 sed 's,target="$$mono_libdir/libmono-btls-shared$(libsuffix)",target="$(abs_top_builddir)/mono/btls/build-shared/libmono-btls-shared$(libsuffix)",' $@ > $@.tmp \
238 echo "Unknown directory '$(abs_top_builddir)/mono/btls/build-shared'"; \
240 if test -n "$(libgdiplus_loc)"; then \
241 sed 's,target="$(libgdiplus_install_loc)",target="$(libgdiplus_loc)",' $@ > $@.tmp \
247 $(tmpinst)/bin/mono: mono-wrapper etc/mono/config
248 $(mkinstalldirs) $(tmpinst)/bin
251 $(tmpinst)/bin/csc: $(tmpinst)/bin/mono Makefile
252 echo '#! /bin/sh' > $@ ; \
253 r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
254 echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$(CSC)"'" "$$@"' >> $@ ; \
257 $(tmpinst)/bin/mcs: $(tmpinst)/bin/mono Makefile
258 echo '#! /bin/sh' > $@ ; \
259 r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
260 echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/$(net_profile)/mcs.exe"'" "$$@"' >> $@ ; \
263 $(tmpinst)/bin/ilasm: $(tmpinst)/bin/mono Makefile
264 echo '#! /bin/sh' > $@ ; \
265 r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
266 echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/ilasm/ilasm.exe"'" "$$@"' >> $@ ; \
269 $(tmpinst)/bin/al: $(tmpinst)/bin/mono Makefile
270 echo '#! /bin/sh' > $@ ; \
271 r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
272 echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/$(net_profile)/al.exe"'" "$$@"' >> $@ ; \
275 test-support-files: $(TEST_SUPPORT_FILES)
278 # the 'cygnus' option also disables the default 'distdir:' target, which we _do_ want
279 MYDISTFILES = $(DIST_COMMON)
280 distdir: $(MYDISTFILES)
283 test -z '$(MYDISTFILES)' || for file in ''$(MYDISTFILES); do \
284 cp -p $$file $(distdir) ; done
285 find $(distdir) -type f -exec chmod a+r {} ';'