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