2010-01-12 Zoltan Varga <vargaz@gmail.com>
[mcs.git] / Makefile
blobbfb13c303cf1c1205e3ec46992fb911ca3455446
1 thisdir := .
3 SUBDIRS := build jay mcs class nunit24 ilasm tools tests errors docs
5 basic_SUBDIRS := build jay mcs class
6 net_1_1_bootstrap_SUBDIRS := build jay mcs class ilasm tools
7 net_2_0_bootstrap_SUBDIRS := build jay mcs class ilasm tools
8 net_2_0_SUBDIRS := build jay mcs class nunit24 ilasm tools tests errors docs
9 net_2_1_bootstrap_SUBDIRS := build mcs class
10 net_2_1_raw_SUBDIRS := build mcs class tools
11 net_2_1_SUBDIRS := tools tests errors
12 monotouch_SUBDIRS := build mcs class
13 monotouch_bootstrap_SUBDIRS := build mcs class
14 net_3_5_SUBDIRS := build class
15 net_4_0_bootstrap_SUBDIRS := build mcs class tools
16 net_4_0_SUBDIRS := build mcs class nunit24 ilasm tools tests errors
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
40 default_centum_tests := \
41 $(centum_tests) \
42 class/System.Data
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.Web \
57 class/Mono.C5
59 # class/System.Web.Extensions
60 # class/Microsoft.Build.Tasks
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
66 ifdef ONLY_CENTUM_TESTS
67 TEST_SUBDIRS := $($(PROFILE)_centum_tests)
68 endif
70 ifdef TEST_SUBDIRS
71 $(PROFILE)_SUBDIRS := $(TEST_SUBDIRS)
72 endif
74 include build/rules.make
76 all-recursive $(STD_TARGETS:=-recursive): dir-check platform-check profile-check
78 .PHONY: all-local $(STD_TARGETS:=-local)
79 all-local $(STD_TARGETS:=-local):
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 (if using a tarball), or from the directory where the runtime is checked out (if using an SVN checkout)."; exit 1; fi
85 # fun specialty targets
87 PROFILES = net_1_1 net_2_0 net_3_5 net_4_0
89 .PHONY: all-profiles $(STD_TARGETS:=-profiles)
90 all-profiles $(STD_TARGETS:=-profiles): %-profiles: profiles-do--%
93 profiles-do--%:
94 $(MAKE) $(PROFILES:%=profile-do--%--$*)
96 # The % below looks like profile-name--target-name
97 profile-do--%:
98 $(MAKE) PROFILE=$(subst --, ,$*)
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
104 # Orchestrate the bootstrap here.
105 _boot_ = all clean install
106 $(_boot_:%=profile-do--net_4_0--%): profile-do--net_4_0--%: profile-do--net_4_0_bootstrap--%
107 $(_boot_:%=profile-do--net_4_0_bootstrap--%): profile-do--net_4_0_bootstrap--%: profile-do--net_2_0--%
108 $(_boot_:%=profile-do--net_3_5--%): profile-do--net_3_5--%: profile-do--net_2_0--%
109 $(_boot_:%=profile-do--net_2_1--%): profile-do--net_2_1--%: profile-do--net_2_1_raw--%
110 $(_boot_:%=profile-do--monotouch--%): profile-do--monotouch--%: profile-do--monotouch_bootstrap--%
111 $(_boot_:%=profile-do--monotouch_bootstrap--%): profile-do--monotouch_bootstrap--%: profile-do--net_2_0--%
112 $(_boot_:%=profile-do--net_2_1_raw--%): profile-do--net_2_1_raw--%: profile-do--net_2_1_bootstrap--%
113 $(_boot_:%=profile-do--net_2_1_bootstrap--%): profile-do--net_2_1_bootstrap--%: profile-do--net_2_0--%
114 $(_boot_:%=profile-do--net_2_0--%): profile-do--net_2_0--%: profile-do--net_2_0_bootstrap--%
115 $(_boot_:%=profile-do--net_2_0_bootstrap--%): profile-do--net_2_0_bootstrap--%: profile-do--net_1_1_bootstrap--%
116 $(_boot_:%=profile-do--net_1_1--%): profile-do--net_1_1--%: profile-do--net_1_1_bootstrap--%
117 $(_boot_:%=profile-do--net_1_1_bootstrap--%): profile-do--net_1_1_bootstrap--%: profile-do--basic--%
119 testcorlib:
120 @cd class/corlib && $(MAKE) test run-test
122 compiler-tests:
123 $(MAKE) TEST_SUBDIRS="tests errors" run-test-profiles
125 test-installed-compiler:
126 $(MAKE) TEST_SUBDIRS="tests errors" PROFILE=net_1_1 TEST_RUNTIME=mono MCS=mcs run-test
127 $(MAKE) TEST_SUBDIRS="tests errors" PROFILE=net_2_0 TEST_RUNTIME=mono MCS=gmcs run-test
129 package := mcs-$(VERSION)
131 DISTFILES = \
132 AUTHORS \
133 ChangeLog \
134 COPYING \
135 COPYING.LIB \
136 INSTALL.txt \
137 LICENSE \
138 LICENSE.GPL \
139 LICENSE.LGPL \
140 LICENSE.MPL \
141 Makefile \
142 mkinstalldirs \
143 MIT.X11 \
144 MonoIcon.png \
145 README \
146 ScalableMonoIcon.svg \
147 winexe.in \
148 nunit.key
150 dist-local: dist-default
152 dist-pre:
153 rm -rf $(package)
154 mkdir $(package)
156 dist-tarball: dist-pre
157 $(MAKE) distdir='$(package)' dist-recursive
158 tar cvjf $(package).tar.bz2 $(package)
160 dist: dist-tarball
161 rm -rf $(package)
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.
167 # We need to set prefix on make so class/System/Makefile can find
168 # the installed System.Xml to build properly
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
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"
196 # A bare-bones monocharge.
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"