Properly initialize a rgctx template. Fixes bxc #1147.
[mono-project.git] / runtime / Makefile.am
blobec9f357096a50a16e977690bc65e94d587f84a47
1 # hack to prevent 'check' from depending on 'all'
2 AUTOMAKE_OPTIONS = cygnus
4 tmpinst = _tmpinst
6 noinst_SCRIPTS = mono-wrapper monodis-wrapper
8 etctmp = etc
9 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
11 if INSTALL_4_0
12 symlinks += etc/mono/4.0/machine.config etc/mono/4.0/web.config
13 endif
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/net_2_0/Browsers/Compat.browser
19 etc/mono/4.0/machine.config: $(top_srcdir)/data/net_4_0/machine.config
20 etc/mono/4.0/web.config: $(top_srcdir)/data/net_4_0/web.config
22 $(symlinks):
23         cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
25 SUPPORT_FILES = $(symlinks) mono-wrapper etc/mono/config
27 if MOONLIGHT
28 moon-do-basic: Makefile $(SUPPORT_FILES)
29         cd $(mcs_topdir)/class/Mono.Cecil && $(MAKE) PROFILE=basic
30         cd $(mcs_topdir)/class/Mono.Cecil.Mdb && $(MAKE) PROFILE=basic
31         cd $(mcs_topdir)/tools/linker && $(MAKE) PROFILE=basic
32         cd $(mcs_topdir)/tools/tuner && $(MAKE) PROFILE=basic
34 moon-do-basic-clean:
35         cd $(mcs_topdir)/class/Mono.Cecil && $(MAKE) PROFILE=basic clean
36         cd $(mcs_topdir)/class/Mono.Cecil.Mdb && $(MAKE) PROFILE=basic clean
37         cd $(mcs_topdir)/tools/linker && $(MAKE) PROFILE=basic clean
38         cd $(mcs_topdir)/tools/tuner && $(MAKE) PROFILE=basic clean
39 endif
41 if ONLY_MOONLIGHT
42 build_profiles = moonlight_raw
43 test_profiles = moonlight_raw
44 else
46 build_profiles = net_2_0 net_3_5
47 test_profiles = $(build_profiles)
49 if MOONLIGHT
50 build_profiles += moonlight_raw
51 test_profiles += moonlight_raw
53 moon-do-moonlight-raw: Makefile $(SUPPORT_FILES)
54         cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='moonlight_raw' CC='$(CC)' all-profiles
56 moon-do-moonlight-raw-clean:
57         cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='moonlight_raw' CC='$(CC)' clean-profiles
59 moon-do-build: moon-do-moonlight-raw moon-do-basic
60 moon-do-clean: moon-do-moonlight-raw-clean moon-do-basic-clean
62 endif
64 if INSTALL_4_0
65 build_profiles += net_4_0
66 #test_profiles += net_4_0
67 endif
69 if INSTALL_MONODROID
70 build_profiles += monodroid
71 endif
73 if INSTALL_MONOTOUCH
74 build_profiles += monotouch
75 endif
77 endif
79 if BUILD_MCS
81 # The write check is to foil 'make distcheck'
82 all-local: $(SUPPORT_FILES) $(TEST_SUPPORT_FILES)
83         if test -w $(mcs_topdir); then :; else chmod -R +w $(mcs_topdir); fi
84         cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' CC='$(CC)' all-profiles
86 # override automake
87 install: install-exec install-data
89 # override automake
90 install-exec: $(SUPPORT_FILES) $(TEST_SUPPORT_FILES)
91         cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' RUNTIME_HAS_CONSISTENT_GACDIR=yes prefix=$(prefix) install-profiles
93 # override automake
94 install-data:
95         @:
97 # override automake
98 uninstall:
99         cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' RUNTIME_HAS_CONSISTENT_GACDIR=yes prefix=$(prefix) uninstall-profiles
101 ## mono --wapi=semdel will probably not delete the semaphore if someone is crazy enough to do a 'make -j distclean' :-)
102 clean-local:
103         cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' clean-profiles
104         -./mono-wrapper --wapi=semdel
105         -rm -fr $(etctmp) $(tmpinst) .wapi
107 endif BUILD_MCS
109 TEST_SUPPORT_FILES = $(tmpinst)/bin/mono $(tmpinst)/bin/ilasm $(tmpinst)/bin/gmcs $(tmpinst)/bin/dmcs $(tmpinst)/bin/al2 $(tmpinst)/bin/al
111 # now a misnomer, but it'll go away soon enough.
112 if ENABLE_NUNIT_TESTS
113 test_select =
114 else
115 test_select = ONLY_CENTUM_TESTS=yes
116 endif
118 mcs-do-test-profiles:
119         cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' test-profiles
121 mcs-do-run-test-profiles: test-support-files
122         cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' run-test-profiles
124 if HOST_WIN32
125 if CROSS_COMPILING
126 cur_dir_cmd = pwd
127 PLATFORM_PATH_SEPARATOR = :
128 else
129 cur_dir_cmd = cygpath -w -a .
130 PLATFORM_PATH_SEPARATOR = ;
131 endif
132 else
133 cur_dir_cmd = pwd
134 PLATFORM_PATH_SEPARATOR = :
135 endif
137 # Compile all assemblies with the verifier turned on. Code must be valid but not verifiable.
138 # TODO it would be nice to split assemblies without unsafe code to use the verifier with verifiable mode.
139 # Skip net 2.1 assemblies for now because of visibility problems
140 mcs-compileall: mono-wrapper etc/mono/config
141         save_MONO_PATH=$$MONO_PATH; mcs_topdir=`cd $(mcs_topdir) && $(cur_dir_cmd)`; ok=:; \
142         for profile in $(test_profiles); do \
143           if [ "moonlight" = "$$profile" ]; then \
144           break; \
145       fi; \
146           if [ "net_3_5" = "$$profile" ]; then \
147                   MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$mcs_topdir/class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \
148           else \
149                   MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \
150           fi; \
151           export MONO_PATH; \
152           for i in $(mcs_topdir)/class/lib/$$profile/*.{dll,exe}; do \
153                 if [ ! -f $$i ] ; then \
154                         continue ; \
155                 fi ;  \
156             if ./mono-wrapper --compile-all --verify-all --security=validil $$i; then \
157               echo $$i verified OK; \
158             else \
159               echo $$i verification failed; ok=false; \
160             fi; done; done; \
161         $$ok
163 check-local: mcs-compileall mcs-do-test-profiles
164         $(MAKE) $(test_select) mcs-do-run-test-profiles
166 CLEANFILES = etc/mono/config
168 # depend on $(symlinks) to ensure 'etc/mono' directory exists
169 etc/mono/config: ../data/config Makefile $(symlinks)
170         d=`cd ../support && pwd`; \
171         sed 's,target="libMonoPosixHelper[^"]*",target="'$$d/libMonoPosixHelper.la'",' ../data/config > $@t
172         if test -z "$(libgdiplus_loc)"; then :; else \
173           sed 's,<configuration>,& <dllmap dll="gdiplus.dll" target="$(libgdiplus_loc)" />,' $@t > $@tt; \
174           mv -f $@tt $@t; fi
175         mv -f $@t $@
177 $(tmpinst)/bin/mono: mono-wrapper etc/mono/config
178         $(mkinstalldirs) $(tmpinst)/bin
179         cp mono-wrapper $@
181 $(tmpinst)/bin/gmcs: $(tmpinst)/bin/mono Makefile
182         echo '#! /bin/sh' > $@ ; \
183         r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
184         echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/net_2_0/gmcs.exe"'" "$$@"' >> $@ ; \
185         chmod +x $@
187 $(tmpinst)/bin/dmcs: $(tmpinst)/bin/mono Makefile
188         echo '#! /bin/sh' > $@ ; \
189         r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
190         echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/net_4_0/dmcs.exe"'" "$$@"' >> $@ ; \
191         chmod +x $@
193 $(tmpinst)/bin/ilasm: $(tmpinst)/bin/mono Makefile
194         echo '#! /bin/sh' > $@ ; \
195         r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
196         echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/ilasm/ilasm.exe"'" "$$@"' >> $@ ; \
197         chmod +x $@
199 $(tmpinst)/bin/al2: $(tmpinst)/bin/mono Makefile
200         echo '#! /bin/sh' > $@ ; \
201         r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
202         echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/net_2_0/al.exe"'" "$$@"' >> $@ ; \
203         chmod +x $@
205 $(tmpinst)/bin/al: $(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_4_0/al.exe"'" "$$@"' >> $@ ; \
209         chmod +x $@
211 test-support-files: $(TEST_SUPPORT_FILES)
212         @:
214 # the 'cygnus' option also disables the default 'distdir:' target, which we _do_ want
215 MYDISTFILES = $(DIST_COMMON)
216 distdir: $(MYDISTFILES)
217         rm -fr $(distdir)
218         mkdir $(distdir)
219         test -z '$(MYDISTFILES)' || for file in ''$(MYDISTFILES); do \
220           cp -p $$file $(distdir) ; done
221         find $(distdir) -type f -exec chmod a+r {} ';'