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