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