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