Merge branch 'master' of github.com:mono/mono
[mono.git] / mcs / Makefile
1 thisdir := .
2
3 SUBDIRS := build jay mcs class nunit24 ilasm tools tests errors docs
4
5 basic_SUBDIRS := build jay mcs class tools
6 net_2_0_bootstrap_SUBDIRS := build tools
7 net_2_0_SUBDIRS := build mcs class nunit24 ilasm tools tests errors 
8 moonlight_bootstrap_SUBDIRS := build mcs class
9 moonlight_raw_SUBDIRS := build mcs class tools
10 moonlight_SUBDIRS := tools tests errors
11 monodroid_bootstrap_SUBDIRS := build mcs class
12 monodroid_SUBDIRS := build mcs class
13 monotouch_bootstrap_SUBDIRS := build mcs class
14 monotouch_SUBDIRS := build mcs class
15 net_3_5_SUBDIRS := build class tools/xbuild
16 net_4_0_bootstrap_SUBDIRS := build mcs class tools 
17 net_4_0_SUBDIRS := build mcs class nunit24 ilasm tools tests errors docs
18
19 # List of test subdirs that should pass 100%
20 centum_tests := \
21         class/corlib                                            \
22         class/System                                            \
23         class/System.XML                                        \
24         class/Commons.Xml.Relaxng                               \
25         class/Cscompmgd                                         \
26         class/Microsoft.JScript                                 \
27         class/Mono.Posix                                        \
28         class/Mono.Security                                     \
29         class/System.Design                                     \
30         class/System.DirectoryServices          \
31         class/System.Drawing                            \
32         class/System.Runtime.Remoting                           \
33         class/System.Runtime.Serialization.Formatters.Soap      \
34         class/System.Security                                   \
35         class/System.ServiceProcess                             \
36         class/System.Web                                                \
37         class/System.Web.Services                               \
38         tests                                                   \
39         errors
40
41 default_centum_tests := \
42         $(centum_tests)         \
43         class/System.Data
44
45 net_2_0_centum_tests := \
46         $(centum_tests)                         \
47         class/System.Core                       \
48         class/System.Configuration              \
49         class/System.Data.DataSetExtensions     \
50         class/System.Xml.Linq                   \
51         class/System.Transactions               \
52         class/Microsoft.Build.Framework         \
53         class/Microsoft.Build.Utilities         \
54         class/Microsoft.Build.Engine            \
55         class/System.Runtime.Serialization      \
56         class/System.IdentityModel              \
57         class/System.ServiceModel               \
58         class/System.ServiceModel.Web           \
59         class/Mono.C5
60
61 #       class/System.Web.Extensions
62 #       class/Microsoft.Build.Tasks     
63
64 # note that System.Xml.Linq is here to prevent this from being empty
65 net_3_5_centum_tests := \
66         class/System.Xml.Linq
67
68 ifdef ONLY_CENTUM_TESTS
69 TEST_SUBDIRS := $($(PROFILE)_centum_tests)
70 endif
71
72 ifdef TEST_SUBDIRS
73 $(PROFILE)_SUBDIRS := $(TEST_SUBDIRS)
74 endif
75
76 include build/rules.make
77
78 all-recursive $(STD_TARGETS:=-recursive): dir-check platform-check profile-check
79
80 .PHONY: all-local $(STD_TARGETS:=-local)
81 all-local $(STD_TARGETS:=-local):
82         @:
83
84 dir-check:
85         @if [ "$(NO_DIR_CHECK)" = "" -a "$(PROFILE)" != "basic" ]; then echo "Running make from the mcs directory is not supported. Run make from the parent directory."; exit 1; fi
86
87 # fun specialty targets
88
89 PROFILES = net_2_0 net_3_5 net_4_0
90
91 .PHONY: all-profiles $(STD_TARGETS:=-profiles)
92 all-profiles $(STD_TARGETS:=-profiles): %-profiles: profiles-do--%
93         @:
94
95 profiles-do--%:
96         $(MAKE) $(PROFILES:%=profile-do--%--$*)
97
98 # The % below looks like profile-name--target-name
99 profile-do--%:
100         $(MAKE) PROFILE=$(subst --, ,$*)
101
102 # We don't want to run the tests in parallel.  We want behaviour like -k.
103 profiles-do--run-test:
104         ret=:; $(foreach p,$(PROFILES), { $(MAKE) PROFILE=$(p) run-test || ret=false; }; ) $$ret
105
106 # Orchestrate the bootstrap here.
107 _boot_ = all clean install
108 $(_boot_:%=profile-do--net_4_0--%):           profile-do--net_4_0--%:           profile-do--net_4_0_bootstrap--%
109 $(_boot_:%=profile-do--net_4_0_bootstrap--%): profile-do--net_4_0_bootstrap--%: profile-do--net_2_0--%
110 $(_boot_:%=profile-do--net_3_5--%):           profile-do--net_3_5--%:           profile-do--net_2_0--%
111 $(_boot_:%=profile-do--moonlight--%):           profile-do--moonlight--%:           profile-do--moonlight_raw--%
112 $(_boot_:%=profile-do--monodroid--%):         profile-do--monodroid--%:         profile-do--monodroid_bootstrap--%
113 $(_boot_:%=profile-do--monodroid_bootstrap--%): profile-do--monodroid_bootstrap--%: profile-do--net_2_0--%
114 $(_boot_:%=profile-do--monotouch--%):         profile-do--monotouch--%:         profile-do--monotouch_bootstrap--%
115 $(_boot_:%=profile-do--monotouch_bootstrap--%): profile-do--monotouch_bootstrap--%: profile-do--net_2_0--%
116 $(_boot_:%=profile-do--moonlight_raw--%):       profile-do--moonlight_raw--%:       profile-do--moonlight_bootstrap--%
117 $(_boot_:%=profile-do--moonlight_bootstrap--%): profile-do--moonlight_bootstrap--%: profile-do--basic--%
118 $(_boot_:%=profile-do--net_2_0--%):           profile-do--net_2_0--%:           profile-do--net_2_0_bootstrap--%
119 $(_boot_:%=profile-do--net_2_0_bootstrap--%): profile-do--net_2_0_bootstrap--%: profile-do--basic--%
120
121 testcorlib:
122         @cd class/corlib && $(MAKE) test run-test
123
124 compiler-tests:
125         $(MAKE) TEST_SUBDIRS="tests errors" run-test-profiles
126
127 package := mcs-$(VERSION)
128
129 DISTFILES = \
130         AUTHORS                 \
131         ChangeLog               \
132         COPYING                 \
133         COPYING.LIB             \
134         INSTALL.txt             \
135         LICENSE                 \
136         LICENSE.GPL             \
137         LICENSE.LGPL            \
138         LICENSE.MPL             \
139         Makefile                \
140         mkinstalldirs           \
141         MIT.X11                 \
142         MonoIcon.png            \
143         README                  \
144         ScalableMonoIcon.svg    \
145         winexe.in               \
146         nunit.key
147
148 dist-local: dist-default
149
150 csproj-local:
151
152 dist-pre:
153         rm -rf $(package)
154         mkdir $(package)
155
156 dist-tarball: dist-pre
157         $(MAKE) distdir='$(package)' dist-recursive
158         tar cvjf $(package).tar.bz2 $(package)
159
160 dist: dist-tarball
161         rm -rf $(package)
162
163 # the egrep -v is kind of a hack (to get rid of the makefrags)
164 # but otherwise we have to make dist then make clean which
165 # is sort of not kosher. And it breaks with DIST_ONLY_SUBDIRS.
166 #
167 # We need to set prefix on make so class/System/Makefile can find
168 # the installed System.Xml to build properly
169
170 distcheck: dist-tarball
171         rm -rf InstallTest Distcheck-MCS ; \
172         mkdir InstallTest ; \
173         destdir=`cd InstallTest && pwd` ; \
174         mv $(package) Distcheck-MCS ; \
175         (cd Distcheck-MCS && \
176             $(MAKE) prefix=$(prefix) && $(MAKE) test && $(MAKE) install DESTDIR="$$destdir" && \
177             $(MAKE) clean && $(MAKE) dist || exit 1) || exit 1 ; \
178         mv Distcheck-MCS $(package) ; \
179         tar tjf $(package)/$(package).tar.bz2 |sed -e 's,/$$,,' |sort >distdist.list ; \
180         rm $(package)/$(package).tar.bz2 ; \
181         tar tjf $(package).tar.bz2 |sed -e 's,/$$,,' |sort >before.list ; \
182         find $(package) |egrep -v '(makefrag|response)' |sed -e 's,/$$,,' |sort >after.list ; \
183         cmp before.list after.list || exit 1 ; \
184         cmp before.list distdist.list || exit 1 ; \
185         rm -f before.list after.list distdist.list ; \
186         rm -rf $(package) InstallTest
187
188 monocharge:
189         chargedir=monocharge-`date -u +%Y%m%d` ; \
190         mkdir "$$chargedir" ; \
191         DESTDIR=`cd "$$chargedir" && pwd` ; \
192         $(MAKE) install DESTDIR="$$DESTDIR" || exit 1 ; \
193         tar cvjf "$$chargedir".tar.bz2 "$$chargedir" ; \
194         rm -rf "$$chargedir"
195
196 # A bare-bones monocharge.
197
198 monocharge-lite:
199         chargedir=monocharge-lite-`date -u +%Y%m%d` ; \
200         mkdir "$$chargedir" ; \
201         DESTDIR=`cd "$$chargedir" && pwd` ; \
202         $(MAKE) -C mcs install DESTDIR="$$DESTDIR" || exit 1; \
203         $(MAKE) -C class/corlib install DESTDIR="$$DESTDIR" || exit 1; \
204         $(MAKE) -C class/System install DESTDIR="$$DESTDIR" || exit 1; \
205         $(MAKE) -C class/System.XML install DESTDIR="$$DESTDIR" || exit 1; \
206         $(MAKE) -C class/Mono.CSharp.Debugger install DESTDIR="$$DESTDIR" || exit 1; \
207         tar cvjf "$$chargedir".tar.bz2 "$$chargedir" ; \
208         rm -rf "$$chargedir"