Fix bug #358496.
[mcs.git] / Makefile
blob3b10a778a9b2cf7a4554f8f31bb4042f45678daa
1 thisdir := .
3 SUBDIRS := build jay mcs class nunit20 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 nunit20 ilasm tools tests errors
9 net_2_1_SUBDIRS := build mcs class tools
10 net_3_5_SUBDIRS := build class
12 # List of test subdirs that should pass 100%
13 centum_tests := \
14 class/corlib \
15 class/System \
16 class/System.XML \
17 class/Commons.Xml.Relaxng \
18 class/Cscompmgd \
19 class/Microsoft.JScript \
20 class/Mono.Posix \
21 class/Mono.Security \
22 class/System.Messaging \
23 class/System.Runtime.Remoting \
24 class/System.Runtime.Serialization.Formatters.Soap \
25 class/System.Security \
26 class/System.ServiceProcess \
27 class/System.Web.Services \
28 tests \
29 errors
31 default_centum_tests := \
32 $(centum_tests) \
33 class/System.Data
35 net_2_0_centum_tests := \
36 $(centum_tests) \
37 class/System.Core \
38 class/System.Configuration \
39 class/Microsoft.Build.Framework \
40 class/Microsoft.Build.Utilities \
41 class/Microsoft.Build.Engine
42 #class/Microsoft.Build.Tasks
43 #class/Mono.C5
45 net_3_5_centum_tests := \
46 class/System.Xml.Linq
47 #class/System.Web.Extensions
49 ifdef ONLY_CENTUM_TESTS
50 TEST_SUBDIRS := $($(PROFILE)_centum_tests)
51 endif
53 ifdef TEST_SUBDIRS
54 $(PROFILE)_SUBDIRS := $(TEST_SUBDIRS)
55 endif
57 include build/rules.make
59 all-recursive $(STD_TARGETS:=-recursive): dir-check platform-check profile-check
61 .PHONY: all-local $(STD_TARGETS:=-local)
62 all-local $(STD_TARGETS:=-local):
65 dir-check:
66 @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
68 # fun specialty targets
70 PROFILES = default net_2_0 net_3_5
72 .PHONY: all-profiles $(STD_TARGETS:=-profiles)
73 all-profiles $(STD_TARGETS:=-profiles): %-profiles: profiles-do--%
76 profiles-do--%:
77 $(MAKE) $(PROFILES:%=profile-do--%--$*)
79 # The % below looks like profile-name--target-name
80 profile-do--%:
81 $(MAKE) PROFILE=$(subst --, ,$*)
83 # We don't want to run the tests in parallel. We want behaviour like -k.
84 profiles-do--run-test:
85 ret=:; $(foreach p,$(PROFILES), { $(MAKE) PROFILE=$(p) run-test || ret=false; }; ) $$ret
87 # Orchestrate the bootstrap here.
88 _boot_ = all clean install
89 $(_boot_:%=profile-do--net_3_5--%): profile-do--net_3_5--%: profile-do--net_2_0--%
90 $(_boot_:%=profile-do--net_2_1--%): profile-do--net_2_1--%: profile-do--net_2_0--%
91 $(_boot_:%=profile-do--net_2_0--%): profile-do--net_2_0--%: profile-do--net_2_0_bootstrap--%
92 $(_boot_:%=profile-do--net_2_0_bootstrap--%): profile-do--net_2_0_bootstrap--%: profile-do--default--%
93 $(_boot_:%=profile-do--default--%): profile-do--default--%: profile-do--net_1_1_bootstrap--%
94 $(_boot_:%=profile-do--net_1_1_bootstrap--%): profile-do--net_1_1_bootstrap--%: profile-do--basic--%
96 testcorlib:
97 @cd class/corlib && $(MAKE) test run-test
99 compiler-tests:
100 $(MAKE) TEST_SUBDIRS="tests errors" run-test-profiles
102 test-installed-compiler:
103 $(MAKE) TEST_SUBDIRS="tests errors" PROFILE=default TEST_RUNTIME=mono MCS=mcs run-test
104 $(MAKE) TEST_SUBDIRS="tests errors" PROFILE=net_2_0 TEST_RUNTIME=mono MCS=gmcs run-test
106 package := mcs-$(VERSION)
108 DISTFILES = \
109 AUTHORS \
110 ChangeLog \
111 COPYING \
112 COPYING.LIB \
113 INSTALL.txt \
114 LICENSE \
115 LICENSE.GPL \
116 LICENSE.LGPL \
117 LICENSE.MPL \
118 Makefile \
119 mkinstalldirs \
120 MIT.X11 \
121 MonoIcon.png \
122 README \
123 ScalableMonoIcon.svg \
124 winexe.in \
125 nunit.key
127 dist-local: dist-default
129 dist-pre:
130 rm -rf $(package)
131 mkdir $(package)
133 dist-tarball: dist-pre
134 $(MAKE) distdir='$(package)' dist-recursive
135 tar cvjf $(package).tar.bz2 $(package)
137 dist: dist-tarball
138 rm -rf $(package)
140 # the egrep -v is kind of a hack (to get rid of the makefrags)
141 # but otherwise we have to make dist then make clean which
142 # is sort of not kosher. And it breaks with DIST_ONLY_SUBDIRS.
144 # We need to set prefix on make so class/System/Makefile can find
145 # the installed System.Xml to build properly
147 distcheck: dist-tarball
148 rm -rf InstallTest Distcheck-MCS ; \
149 mkdir InstallTest ; \
150 destdir=`cd InstallTest && pwd` ; \
151 mv $(package) Distcheck-MCS ; \
152 (cd Distcheck-MCS && \
153 $(MAKE) prefix=$(prefix) && $(MAKE) test && $(MAKE) install DESTDIR="$$destdir" && \
154 $(MAKE) clean && $(MAKE) dist || exit 1) || exit 1 ; \
155 mv Distcheck-MCS $(package) ; \
156 tar tjf $(package)/$(package).tar.bz2 |sed -e 's,/$$,,' |sort >distdist.list ; \
157 rm $(package)/$(package).tar.bz2 ; \
158 tar tjf $(package).tar.bz2 |sed -e 's,/$$,,' |sort >before.list ; \
159 find $(package) |egrep -v '(makefrag|response)' |sed -e 's,/$$,,' |sort >after.list ; \
160 cmp before.list after.list || exit 1 ; \
161 cmp before.list distdist.list || exit 1 ; \
162 rm -f before.list after.list distdist.list ; \
163 rm -rf $(package) InstallTest
165 monocharge:
166 chargedir=monocharge-`date -u +%Y%m%d` ; \
167 mkdir "$$chargedir" ; \
168 DESTDIR=`cd "$$chargedir" && pwd` ; \
169 $(MAKE) install DESTDIR="$$DESTDIR" || exit 1 ; \
170 tar cvjf "$$chargedir".tar.bz2 "$$chargedir" ; \
171 rm -rf "$$chargedir"
173 # A bare-bones monocharge.
175 monocharge-lite:
176 chargedir=monocharge-lite-`date -u +%Y%m%d` ; \
177 mkdir "$$chargedir" ; \
178 DESTDIR=`cd "$$chargedir" && pwd` ; \
179 $(MAKE) -C mcs install DESTDIR="$$DESTDIR" || exit 1; \
180 $(MAKE) -C class/corlib install DESTDIR="$$DESTDIR" || exit 1; \
181 $(MAKE) -C class/System install DESTDIR="$$DESTDIR" || exit 1; \
182 $(MAKE) -C class/System.XML install DESTDIR="$$DESTDIR" || exit 1; \
183 $(MAKE) -C class/Mono.CSharp.Debugger install DESTDIR="$$DESTDIR" || exit 1; \
184 tar cvjf "$$chargedir".tar.bz2 "$$chargedir" ; \
185 rm -rf "$$chargedir"