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