2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / runtime / Makefile.am
1 # This is just used to copy and install the DLL files that are currently
2 # being compiled on windows.
3 #
4
5 # hack to prevent 'check' from depending on 'all'
6 AUTOMAKE_OPTIONS = cygnus
7
8 tmpinst = _tmpinst
9
10 noinst_SCRIPTS = mono-wrapper
11
12 symlinks = etc/mono/1.0/machine.config etc/mono/2.0/machine.config
13
14 etc/mono/1.0/machine.config: $(top_srcdir)/data/net_1_1/machine.config
15 etc/mono/2.0/machine.config: $(top_srcdir)/data/net_2_0/machine.config
16
17 $(symlinks):
18         cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
19
20 # The write check is to foil 'make distcheck'
21 all-local: $(symlinks) mono-wrapper
22         if test -w $(mcs_topdir); then :; else chmod -R +w $(mcs_topdir); fi
23         d=`pwd`; cd $(mcs_topdir) && $(MAKE) RUNTIME=$$d/mono-wrapper PROFILES='$(build_profiles)' all-profiles
24
25 if INSTALL_2_0
26 build_profiles = default net_2_0
27 clean_profiles = basic net_1_1_bootstrap default net_2_0_bootstrap net_2_0
28 else
29 build_profiles = default
30 clean_profiles = basic net_1_1_bootstrap default
31 endif
32
33 # override automake
34 install: install-exec install-data
35
36 # override automake
37 install-exec:
38         d=`pwd`; \
39         cd $(mcs_topdir) && $(MAKE) prefix='$(exec_prefix)' PROFILES='$(build_profiles)' \
40                                     RUNTIME=$$d/mono-wrapper RUNTIME_HAS_CONSISTENT_GACDIR=yes install-profiles
41
42 # override automake
43 install-data:
44         @:
45
46 # override automake
47 uninstall:
48         d=`pwd`; \
49         cd $(mcs_topdir) && $(MAKE) prefix='$(exec_prefix)' PROFILES='$(build_profiles)' \
50                                     RUNTIME=$$d/mono-wrapper RUNTIME_HAS_CONSISTENT_GACDIR=yes uninstall-profiles
51
52 clean-local:
53         d=`pwd`; cd $(mcs_topdir) && $(MAKE) PROFILES='$(clean_profiles)' clean-profiles
54         -rm -fr $(symlinks) $(tmpinst) .wapi
55
56 if INSTALL_2_0
57 TEST_SUPPORT_FILES = $(tmpinst)/config $(tmpinst)/bin/mono $(tmpinst)/bin/mcs $(tmpinst)/bin/mbas $(tmpinst)/bin/ilasm $(tmpinst)/bin/gmcs
58 else
59 TEST_SUPPORT_FILES = $(tmpinst)/config $(tmpinst)/bin/mono $(tmpinst)/bin/mcs $(tmpinst)/bin/mbas $(tmpinst)/bin/ilasm
60 endif
61
62 # List of NUnit testcases that should be 100% pass
63 centum_nunit_tests = \
64         class/Commons.Xml.Relaxng \
65         class/Cscompmgd \
66         class/Microsoft.JScript \
67         class/Mono.Posix \
68         class/Mono.Security \
69         class/System \
70         class/System.Configuration.Install \
71         class/System.Runtime.Remoting \
72         class/System.Runtime.Serialization.Formatters.Soap \
73         class/System.Web.Services
74
75 # now a misnomer, but it'll go away soon enough.
76 if ENABLE_NUNIT_TESTS
77 test_select =
78 else
79 test_select = TEST_SUBDIRS='$(centum_nunit_tests) tests errors'
80 endif
81
82 mcs-do-test-profiles:
83         d=`pwd`; cd $(mcs_topdir) && $(MAKE) RUNTIME=$$d/mono-wrapper PROFILES='$(build_profiles)' test-profiles
84
85 mcs-do-run-test-profiles:
86         $(mkinstalldirs) $(tmpinst)/bin
87         $(MAKE) $(TEST_SUPPORT_FILES)
88         d=`pwd`; PATH=$$d/$(tmpinst)/bin:$$PATH ; export PATH ; \
89         ( cd $(mcs_topdir) && $(MAKE) RUNTIME=$$d/$(tmpinst)/bin/mono PROFILES='$(build_profiles)' run-test-profiles ) || ret=false ; \
90         rm -fr $(tmpinst) ; $$ret
91
92 # Use --compile-all as a poor man's PEVerify to detect invalid IL
93 # This doesn't yet work on the 2.0 profile (bug #71963)
94 mcs-compileall:
95         d=`pwd`; for profile in default; do for i in $(mcs_topdir)/class/lib/$$profile/*.dll $(mcs_topdir)/class/lib/$$profile/*.exe; do echo $$i; $$d/mono-wrapper --compile-all $$i || exit 1; done; done
96
97 check-local: mcs-compileall mcs-do-test-profiles
98         $(MAKE) $(test_select) mcs-do-run-test-profiles
99
100 $(tmpinst)/config: ../data/config
101         d=`cd ../support && pwd`; \
102         sed 's,<configuration>,& <dllmap dll="MonoPosixHelper" target="'$$d/libMonoPosixHelper.la'" />,' ../data/config > $@
103
104 $(tmpinst)/bin/mono: mono-wrapper
105         sed 's,/data/config",/runtime/$(tmpinst)/config",' mono-wrapper > $@
106         chmod +x $@
107
108 $(tmpinst)/bin/mcs:
109         $(MAKE) test-support-file target=$@ file=class/lib/default/mcs.exe
110
111 $(tmpinst)/bin/mbas:
112         $(MAKE) test-support-file target=$@ file=mbas/mbas.exe
113
114 $(tmpinst)/bin/gmcs:
115         $(MAKE) test-support-file target=$@ file=gmcs/gmcs.exe
116
117 $(tmpinst)/bin/ilasm:
118         $(MAKE) test-support-file target=$@ file=ilasm/ilasm.exe
119
120 test-support-file:
121         echo '#! /bin/sh' > $(target)
122         r=`pwd`; m=`cd $(mcs_topdir) && pwd`; echo 'exec "'"$$r/mono-wrapper"'" "'"$$m/$(file)"'" "$$@"' >> $(target)
123         chmod +x $(target)
124
125 $(tmpinst)/bin/pedump: $(srcdir)/Makefile.am
126         $(mkdir_p) $(@D)
127         (b=`pwd`; echo '#! /bin/sh'; echo 'exec "'"$$b/libtool"'" --mode=execute "'"$$b/mono/metadata/pedump"'" "$$@"') > $@
128         chmod +x $@
129
130 # the 'cygnus' option also disables the default 'distdir:' target, which we _do_ want
131 MYDISTFILES = Makefile.am Makefile.in mono-wrapper.in
132 distdir: $(MYDISTFILES)
133         rm -fr $(distdir)
134         mkdir $(distdir)
135         test -z '$(MYDISTFILES)' || for file in ''$(MYDISTFILES); do \
136           if test -f $$file; then d=.; else d=$(srcdir); fi; \
137           cp -p $$d/$$file $(distdir) ; done
138         find $(distdir) -type f -exec chmod a+r {} ';'