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