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