remove `implicit operator String (ReadOnlySpan<char> value)`
[mono-project.git] / runtime / Makefile.am
blob633bc04135749168157665fd51c5373b5139867b
1 tmpinst = _tmpinst
3 noinst_SCRIPTS = mono-wrapper monodis-wrapper
5 etctmp = etc
6 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
8 if INSTALL_4_x
9 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
10 endif
12 # This is needed at least to build configure --with-runtime-preset=fullaot.
13 symlinks += etc/mono/4.5/machine.config
15 etc/mono/2.0/machine.config: $(top_srcdir)/data/net_2_0/machine.config
16 etc/mono/2.0/web.config: $(top_srcdir)/data/net_2_0/web.config
17 etc/mono/browscap.ini: $(top_srcdir)/data/browscap.ini
18 etc/mono/2.0/Browsers/Compat.browser: $(top_srcdir)/data/Browsers/Compat.browser
19 etc/mono/4.0/Browsers/Compat.browser: $(top_srcdir)/data/Browsers/Compat.browser
20 etc/mono/4.5/Browsers/Compat.browser: $(top_srcdir)/data/Browsers/Compat.browser
21 etc/mono/4.0/machine.config: $(top_srcdir)/data/net_4_0/machine.config
22 etc/mono/4.0/web.config: $(top_srcdir)/data/net_4_0/web.config
23 etc/mono/4.5/machine.config: $(top_srcdir)/data/net_4_5/machine.config
24 etc/mono/4.5/web.config: $(top_srcdir)/data/net_4_5/web.config
26 $(symlinks):
27         cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
29 SUPPORT_FILES = $(symlinks) mono-wrapper etc/mono/config
31 build_profiles = 
33 if INSTALL_4_x
34 build_profiles += binary_reference_assemblies net_4_x xbuild_12 xbuild_14
35 net_profile = net_4_x
36 endif
38 if INSTALL_MONODROID
39 build_profiles += monodroid monodroid_tools
40 endif
42 if INSTALL_MONOTOUCH
43 build_profiles += monotouch monotouch_runtime
44 endif
46 if INSTALL_MONOTOUCH_WATCH
47 build_profiles += monotouch_watch monotouch_watch_runtime
48 endif
50 if INSTALL_MONOTOUCH_TV
51 build_profiles += monotouch_tv monotouch_tv_runtime
52 endif
54 if INSTALL_TESTING_AOT_HYBRID
55 build_profiles += testing_aot_hybrid
56 endif
58 if INSTALL_TESTING_AOT_FULL
59 build_profiles += testing_aot_full
60 endif
62 if INSTALL_WINAOT
63 build_profiles += winaot
64 endif
66 if INSTALL_XAMMAC
67 build_profiles += xammac xammac_net_4_5
68 endif
70 if INSTALL_ORBIS
71 build_profiles += orbis
72 endif
74 if INSTALL_UNREAL
75 build_profiles += unreal
76 endif
78 if INSTALL_WASM
79 build_profiles += wasm
80 endif
82 test_profiles = $(filter-out binary_reference_assemblies monodroid_tools,$(build_profiles))
84 if BUILD_MCS
86 MAKE_FLAGS=$(if $(V),,--no-print-directory -s)
88 # The write check is to foil 'make distcheck'
89 all-local: $(SUPPORT_FILES) $(TEST_SUPPORT_FILES)
90         if test -w $(mcs_topdir); then :; else chmod -R +w $(mcs_topdir); fi
91         cd $(mcs_topdir) && $(MAKE) $(MAKE_FLAGS) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' CC='$(CC)' all-profiles
93 # override automake
94 install: install-exec install-data
96 # override automake
97 install-exec: $(SUPPORT_FILES) $(TEST_SUPPORT_FILES)
98         cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' RUNTIME_HAS_CONSISTENT_GACDIR=yes prefix=$(prefix) install-profiles
100 # override automake
101 install-data:
102         @:
104 # override automake
105 uninstall:
106         cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' RUNTIME_HAS_CONSISTENT_GACDIR=yes prefix=$(prefix) uninstall-profiles
108 clean-local:
109         cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' clean-profiles
110         -rm -fr $(etctmp) $(tmpinst)
112 endif BUILD_MCS
114 TEST_SUPPORT_FILES = $(tmpinst)/bin/mono $(tmpinst)/bin/ilasm $(tmpinst)/bin/csc $(tmpinst)/bin/mcs $(tmpinst)/bin/al
116 mcs-do-test-profiles:
117         cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' test-profiles
119 mcs-do-xunit-test-profiles:
120         cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' xunit-test-profiles
122 mcs-do-run-test-profiles: test-support-files
123         cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' run-test-profiles
125 mcs-do-xunit-run-test-profiles: test-support-files
126         cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' run-xunit-test-profiles
128 if HOST_WIN32
129 if CROSS_COMPILING
130 cur_dir_cmd = pwd
131 PLATFORM_PATH_SEPARATOR = :
132 else
133 cur_dir_cmd = cygpath -w -a .
134 PLATFORM_PATH_SEPARATOR = ;
135 endif
136 else
137 cur_dir_cmd = pwd
138 PLATFORM_PATH_SEPARATOR = :
139 endif
141 # assemblies which are excluded from testing in mcs-compileall below
142 VERIFY_TESTS_FILTER = System.Runtime.CompilerServices.Unsafe.dll
144 if HOST_WIN32
145 # Mono.WebBrowser.dll fails to verify on Windows
146 VERIFY_TESTS_FILTER += Mono.WebBrowser.dll
147 endif
149 if FULL_AOT_TESTS
150 #  ILASM.exe has features which a testing_aot_full runtime will not support.
151 #  It is invoked with an external mono when used in the runtime.
152 #  We skip it here because otherwise it will fail to verify.
153 VERIFY_TESTS_FILTER += ilasm.exe
154 endif
156 # Compile all assemblies with the verifier turned on. Code must be valid but not verifiable.
157 # TODO it would be nice to split assemblies without unsafe code to use the verifier with verifiable mode.
158 mcs-compileall: mono-wrapper etc/mono/config
159         save_MONO_PATH=$$MONO_PATH; mcs_topdir=`cd $(mcs_topdir) && $(cur_dir_cmd)`; ok=:; \
160         for profile in $(test_profiles); do \
161           if [ "xbuild_12" = "$$profile" ]; then \
162                   MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$mcs_topdir/class/lib/net_4_x$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \
163           elif [ "xbuild_14" = "$$profile" ]; then \
164                   MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$mcs_topdir/class/lib/net_4_x$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \
165           else \
166                   MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \
167           fi; \
168           export verifiable_files=`ls "$(mcs_topdir)/class/lib/$$profile/" | grep -E '\.(dll|exe)$$' $(foreach asm,$(VERIFY_TESTS_FILTER), | grep -v $(asm))` ; \
169           export MONO_PATH; \
170           for stub in $$verifiable_files; do \
171           i=$(mcs_topdir)/class/lib/$$profile/$$stub ; \
172           echo $$i ; \
173                 if [ ! -f $$i ] ; then \
174                         continue ; \
175                 fi ;  \
176             if ./mono-wrapper --compile-all --verify-all --security=verifiable $$i; then \
177               echo $$i verified OK; \
178             else \
179               echo $$i verification failed; ok=false; \
180             fi; done; done; \
181         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; \
182         $$ok
184 check-local: mcs-compileall mcs-do-test-profiles mcs-do-xunit-test-profiles
185         $(MAKE) mcs-do-run-test-profiles mcs-do-run-xunit-test-profiles
187 # Compile all mcs tests
188 test: mcs-do-test-profiles
189 xunit-test: mcs-do-xunit-test-profiles
191 CLEANFILES = etc/mono/config
193 # depend on $(symlinks) to ensure 'etc/mono' directory exists
194 etc/mono/config: ../data/config Makefile $(symlinks)
195         cp $< $@
196         if test -d "$(abs_top_builddir)/support"; then \
197                 sed 's,target="$$mono_libdir/libMonoPosixHelper$(libsuffix)",target="$(abs_top_builddir)/support/libMonoPosixHelper.la",' $@ > $@.tmp \
198                  && mv $@.tmp $@ \
199                  ; \
200         else \
201                 echo "Unknown directory '$(abs_top_builddir)/support'" && false; \
202         fi
203         if test -d "$(abs_top_builddir)/mono/metadata"; then \
204                 sed 's,target="$$mono_libdir/libmono-system-native$(libsuffix)",target="$(abs_top_builddir)/mono/metadata/libmono-system-native.la",' $@ > $@.tmp \
205                  && mv $@.tmp $@ \
206                  ; \
207         else \
208                 echo "Unknown directory '$(abs_top_builddir)/mono/metadata'" && false; \
209         fi
210         if test -d "$(abs_top_builddir)/mono/btls/build-shared"; then \
211                 sed 's,target="$$mono_libdir/libmono-btls-shared$(libsuffix)",target="$(abs_top_builddir)/mono/btls/build-shared/libmono-btls-shared$(libsuffix)",' $@ > $@.tmp \
212                  && mv $@.tmp $@ \
213                  ; \
214         else \
215                 echo "Unknown directory '$(abs_top_builddir)/mono/btls/build-shared'"; \
216         fi
217         if test -n "$(libgdiplus_loc)"; then \
218                 sed 's,target="$(libgdiplus_install_loc)",target="$(libgdiplus_loc)",' $@ > $@.tmp \
219                  && mv $@.tmp $@ \
220                  ; \
221         fi
222         cat $@
224 $(tmpinst)/bin/mono: mono-wrapper etc/mono/config
225         $(mkinstalldirs) $(tmpinst)/bin
226         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 $@
234 $(tmpinst)/bin/mcs: $(tmpinst)/bin/mono Makefile
235         echo '#! /bin/sh' > $@ ; \
236         r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
237         echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/$(net_profile)/mcs.exe"'" "$$@"' >> $@ ; \
238         chmod +x $@
240 $(tmpinst)/bin/ilasm: $(tmpinst)/bin/mono Makefile
241         echo '#! /bin/sh' > $@ ; \
242         r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
243         echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/ilasm/ilasm.exe"'" "$$@"' >> $@ ; \
244         chmod +x $@
246 $(tmpinst)/bin/al: $(tmpinst)/bin/mono Makefile
247         echo '#! /bin/sh' > $@ ; \
248         r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
249         echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/$(net_profile)/al.exe"'" "$$@"' >> $@ ; \
250         chmod +x $@
252 test-support-files: $(TEST_SUPPORT_FILES)
253         @:
255 # the 'cygnus' option also disables the default 'distdir:' target, which we _do_ want
256 MYDISTFILES = $(DIST_COMMON)
257 distdir: $(MYDISTFILES)
258         rm -fr $(distdir)
259         mkdir $(distdir)
260         test -z '$(MYDISTFILES)' || for file in ''$(MYDISTFILES); do \
261           cp -p $$file $(distdir) ; done
262         find $(distdir) -type f -exec chmod a+r {} ';'