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