Merge pull request #409 from Alkarex/patch-1
[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 monotouch_runtime_SUBDIRS := build class
14 mobile_SUBDIRS := build class
15 net_3_5_SUBDIRS := build class tools/xbuild
16 net_4_0_SUBDIRS := build class
17 net_4_5_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 make -C ../runtime; fi
86
87 # fun specialty targets
88
89 PROFILES = net_2_0 net_3_5 net_4_0 net_4_5
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_5--%):           profile-do--net_4_5--%:           profile-do--build--%
109 $(_boot_:%=profile-do--net_4_0--%):           profile-do--net_4_0--%:           profile-do--build--%
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--build--%
113 $(_boot_:%=profile-do--monotouch--%):         profile-do--monotouch--%:         profile-do--build--%
114 $(_boot_:%=profile-do--monotouch_runtime--%):  profile-do--monotouch_runtime--%:  profile-do--build--%
115 $(_boot_:%=profile-do--mobile--%):            profile-do--mobile--%:         profile-do--build--%
116 $(_boot_:%=profile-do--moonlight_raw--%):     profile-do--moonlight_raw--%:     profile-do--build--%
117 $(_boot_:%=profile-do--net_2_0--%):           profile-do--net_2_0--%:           profile-do--build--%
118 $(_boot_:%=profile-do--build--%):             profile-do--build--%:             profile-do--basic--%
119
120 testcorlib:
121         @cd class/corlib && $(MAKE) test run-test
122
123 compiler-tests:
124         $(MAKE) TEST_SUBDIRS="tests errors" run-test-profiles
125
126 package := mcs-$(VERSION)
127
128 DISTFILES = \
129         AUTHORS                 \
130         ChangeLog               \
131         COPYING                 \
132         COPYING.LIB             \
133         INSTALL.txt             \
134         LICENSE                 \
135         LICENSE.GPL             \
136         LICENSE.LGPL            \
137         LICENSE.MPL             \
138         Makefile                \
139         mkinstalldirs           \
140         MIT.X11                 \
141         MonoIcon.png            \
142         README                  \
143         ScalableMonoIcon.svg    \
144         winexe.in
145
146 dist-local: dist-default
147
148 csproj-local:
149
150 dist-pre:
151         rm -rf $(package)
152         mkdir $(package)
153
154 dist-tarball: dist-pre
155         $(MAKE) distdir='$(package)' dist-recursive
156         tar cvjf $(package).tar.bz2 $(package)
157
158 dist: dist-tarball
159         rm -rf $(package)
160
161 # the egrep -v is kind of a hack (to get rid of the makefrags)
162 # but otherwise we have to make dist then make clean which
163 # is sort of not kosher. And it breaks with DIST_ONLY_SUBDIRS.
164 #
165 # We need to set prefix on make so class/System/Makefile can find
166 # the installed System.Xml to build properly
167
168 distcheck: dist-tarball
169         rm -rf InstallTest Distcheck-MCS ; \
170         mkdir InstallTest ; \
171         destdir=`cd InstallTest && pwd` ; \
172         mv $(package) Distcheck-MCS ; \
173         (cd Distcheck-MCS && \
174             $(MAKE) prefix=$(prefix) && $(MAKE) test && $(MAKE) install DESTDIR="$$destdir" && \
175             $(MAKE) clean && $(MAKE) dist || exit 1) || exit 1 ; \
176         mv Distcheck-MCS $(package) ; \
177         tar tjf $(package)/$(package).tar.bz2 |sed -e 's,/$$,,' |sort >distdist.list ; \
178         rm $(package)/$(package).tar.bz2 ; \
179         tar tjf $(package).tar.bz2 |sed -e 's,/$$,,' |sort >before.list ; \
180         find $(package) |egrep -v '(makefrag|response)' |sed -e 's,/$$,,' |sort >after.list ; \
181         cmp before.list after.list || exit 1 ; \
182         cmp before.list distdist.list || exit 1 ; \
183         rm -f before.list after.list distdist.list ; \
184         rm -rf $(package) InstallTest
185
186 monocharge:
187         chargedir=monocharge-`date -u +%Y%m%d` ; \
188         mkdir "$$chargedir" ; \
189         DESTDIR=`cd "$$chargedir" && pwd` ; \
190         $(MAKE) install DESTDIR="$$DESTDIR" || exit 1 ; \
191         tar cvjf "$$chargedir".tar.bz2 "$$chargedir" ; \
192         rm -rf "$$chargedir"
193
194 # A bare-bones monocharge.
195
196 monocharge-lite:
197         chargedir=monocharge-lite-`date -u +%Y%m%d` ; \
198         mkdir "$$chargedir" ; \
199         DESTDIR=`cd "$$chargedir" && pwd` ; \
200         $(MAKE) -C mcs install DESTDIR="$$DESTDIR" || exit 1; \
201         $(MAKE) -C class/corlib install DESTDIR="$$DESTDIR" || exit 1; \
202         $(MAKE) -C class/System install DESTDIR="$$DESTDIR" || exit 1; \
203         $(MAKE) -C class/System.XML install DESTDIR="$$DESTDIR" || exit 1; \
204         $(MAKE) -C class/Mono.CSharp.Debugger install DESTDIR="$$DESTDIR" || exit 1; \
205         tar cvjf "$$chargedir".tar.bz2 "$$chargedir" ; \
206         rm -rf "$$chargedir"