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