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