In .:
[mono.git] / mcs / Makefile
1 thisdir := .
2
3 SUBDIRS := build jay mcs class mbas 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
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         Makefile                \
100         mkinstalldirs           \
101         MIT.X11                 \
102         MonoIcon.png            \
103         README                  \
104         ScalableMonoIcon.svg    \
105         winexe.in               \
106         nunit.key
107
108 dist-local: dist-default
109
110 dist-pre:
111         rm -rf $(package)
112         mkdir $(package)
113
114 dist-tarball: dist-pre
115         $(MAKE) distdir='$(package)' dist-recursive
116         tar cvzf $(package).tar.gz $(package)
117
118 dist: dist-tarball
119         rm -rf $(package)
120
121 # the egrep -v is kind of a hack (to get rid of the makefrags)
122 # but otherwise we have to make dist then make clean which
123 # is sort of not kosher. And it breaks with DIST_ONLY_SUBDIRS.
124 #
125 # We need to set prefix on make so class/System/Makefile can find
126 # the installed System.Xml to build properly
127
128 distcheck: dist-tarball
129         rm -rf InstallTest Distcheck-MCS ; \
130         mkdir InstallTest ; \
131         destdir=`cd InstallTest && pwd` ; \
132         mv $(package) Distcheck-MCS ; \
133         (cd Distcheck-MCS && \
134             $(MAKE) prefix=$(prefix) && $(MAKE) test && $(MAKE) install DESTDIR="$$destdir" && \
135             $(MAKE) clean && $(MAKE) dist || exit 1) || exit 1 ; \
136         mv Distcheck-MCS $(package) ; \
137         tar tzf $(package)/$(package).tar.gz |sed -e 's,/$$,,' |sort >distdist.list ; \
138         rm $(package)/$(package).tar.gz ; \
139         tar tzf $(package).tar.gz |sed -e 's,/$$,,' |sort >before.list ; \
140         find $(package) |egrep -v '(makefrag|response)' |sed -e 's,/$$,,' |sort >after.list ; \
141         cmp before.list after.list || exit 1 ; \
142         cmp before.list distdist.list || exit 1 ; \
143         rm -f before.list after.list distdist.list ; \
144         rm -rf $(package) InstallTest
145
146 monocharge:
147         chargedir=monocharge-`date -u +%Y%m%d` ; \
148         mkdir "$$chargedir" ; \
149         DESTDIR=`cd "$$chargedir" && pwd` ; \
150         $(MAKE) install DESTDIR="$$DESTDIR" || exit 1 ; \
151         tar cvzf "$$chargedir".tgz "$$chargedir" ; \
152         rm -rf "$$chargedir"
153
154 # A bare-bones monocharge.
155
156 monocharge-lite:
157         chargedir=monocharge-lite-`date -u +%Y%m%d` ; \
158         mkdir "$$chargedir" ; \
159         DESTDIR=`cd "$$chargedir" && pwd` ; \
160         $(MAKE) -C mcs install DESTDIR="$$DESTDIR" || exit 1; \
161         $(MAKE) -C class/corlib install DESTDIR="$$DESTDIR" || exit 1; \
162         $(MAKE) -C class/System install DESTDIR="$$DESTDIR" || exit 1; \
163         $(MAKE) -C class/System.XML install DESTDIR="$$DESTDIR" || exit 1; \
164         $(MAKE) -C class/Mono.CSharp.Debugger install DESTDIR="$$DESTDIR" || exit 1; \
165         tar cvzf "$$chargedir".tgz "$$chargedir" ; \
166         rm -rf "$$chargedir"