2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[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 tools
8 net_2_0_bootstrap_SUBDIRS := class
9 net_2_0_SUBDIRS := jay gmcs class nunit20 tests errors tools
10
11 ifdef TEST_SUBDIRS
12 $(PROFILE)_SUBDIRS := $(TEST_SUBDIRS)
13 endif
14
15 include build/rules.make
16
17 all-recursive $(STD_TARGETS:=-recursive): platform-check profile-check
18
19 .PHONY: all-local $(STD_TARGETS:=-local)
20 all-local $(STD_TARGETS:=-local):
21         @:
22
23 # fun specialty targets
24
25 PROFILES = default net_2_0
26
27 .PHONY: all-profiles $(STD_TARGETS:=-profiles)
28 all-profiles $(STD_TARGETS:=-profiles): %-profiles: profiles-do--%
29         @:
30
31 profiles-do--%:
32         $(MAKE) $(PROFILES:%=profile-do--%--$*)
33
34 # The % below looks like profile-name--target-name
35 profile-do--%:
36         $(MAKE) PROFILE=$(subst --, ,$*)
37
38 # We don't want to run the tests in parallel.  We want behaviour like -k.
39 profiles-do--run-test:
40         ret=:; $(foreach p,$(PROFILES), { $(MAKE) PROFILE=$(p) run-test || ret=false; }; ) $$ret
41
42 # Orchestrate the bootstrap here.
43 profile-do--net_2_0--all: profile-do--net_2_0_bootstrap--all
44 profile-do--net_2_0_bootstrap--all: profile-do--default--all
45 profile-do--default--all: profile-do--net_1_1_bootstrap--all
46 ifeq (linux, $(PLATFORM))
47 profile-do--net_1_1_bootstrap--all: profile-do--basic--all
48 endif
49
50 testcorlib:
51         @cd class/corlib && $(MAKE) test run-test
52
53 compiler-tests:
54         $(MAKE) TEST_SUBDIRS="tests errors" run-test-profiles
55
56 test-installed-compiler:
57         $(MAKE) TEST_SUBDIRS="tests errors" PROFILE=default TEST_RUNTIME=mono MCS=mcs run-test
58         $(MAKE) TEST_SUBDIRS="tests errors" PROFILE=net_2_0 TEST_RUNTIME=mono MCS=gmcs run-test
59
60 package := mcs-$(VERSION)
61
62 DISTFILES = \
63         AUTHORS                 \
64         ChangeLog               \
65         COPYING                 \
66         COPYING.LIB             \
67         INSTALL.txt             \
68         LICENSE                 \
69         LICENSE.GPL             \
70         LICENSE.LGPL            \
71         Makefile                \
72         mkinstalldirs           \
73         MIT.X11                 \
74         MonoIcon.png            \
75         README                  \
76         ScalableMonoIcon.svg    \
77         winexe.in               \
78         nunit.key
79
80 dist-local: dist-default
81
82 dist-pre:
83         rm -rf $(package)
84         mkdir $(package)
85
86 dist-tarball: dist-pre
87         $(MAKE) distdir='$(package)' dist-recursive
88         tar cvzf $(package).tar.gz $(package)
89
90 dist: dist-tarball
91         rm -rf $(package)
92
93 # the egrep -v is kind of a hack (to get rid of the makefrags)
94 # but otherwise we have to make dist then make clean which
95 # is sort of not kosher. And it breaks with DIST_ONLY_SUBDIRS.
96 #
97 # We need to set prefix on make so class/System/Makefile can find
98 # the installed System.Xml to build properly
99
100 distcheck: dist-tarball
101         rm -rf InstallTest Distcheck-MCS ; \
102         mkdir InstallTest ; \
103         destdir=`cd InstallTest && pwd` ; \
104         mv $(package) Distcheck-MCS ; \
105         (cd Distcheck-MCS && \
106             $(MAKE) prefix=$(prefix) && $(MAKE) test && $(MAKE) install DESTDIR="$$destdir" && \
107             $(MAKE) clean && $(MAKE) dist || exit 1) || exit 1 ; \
108         mv Distcheck-MCS $(package) ; \
109         tar tzf $(package)/$(package).tar.gz |sed -e 's,/$$,,' |sort >distdist.list ; \
110         rm $(package)/$(package).tar.gz ; \
111         tar tzf $(package).tar.gz |sed -e 's,/$$,,' |sort >before.list ; \
112         find $(package) |egrep -v '(makefrag|response)' |sed -e 's,/$$,,' |sort >after.list ; \
113         cmp before.list after.list || exit 1 ; \
114         cmp before.list distdist.list || exit 1 ; \
115         rm -f before.list after.list distdist.list ; \
116         rm -rf $(package) InstallTest
117
118 monocharge:
119         chargedir=monocharge-`date -u +%Y%m%d` ; \
120         mkdir "$$chargedir" ; \
121         DESTDIR=`cd "$$chargedir" && pwd` ; \
122         $(MAKE) install DESTDIR="$$DESTDIR" || exit 1 ; \
123         tar cvzf "$$chargedir".tgz "$$chargedir" ; \
124         rm -rf "$$chargedir"
125
126 # A bare-bones monocharge.
127
128 monocharge-lite:
129         chargedir=monocharge-lite-`date -u +%Y%m%d` ; \
130         mkdir "$$chargedir" ; \
131         DESTDIR=`cd "$$chargedir" && pwd` ; \
132         $(MAKE) -C mcs install DESTDIR="$$DESTDIR" || exit 1; \
133         $(MAKE) -C class/corlib install DESTDIR="$$DESTDIR" || exit 1; \
134         $(MAKE) -C class/System install DESTDIR="$$DESTDIR" || exit 1; \
135         $(MAKE) -C class/System.XML install DESTDIR="$$DESTDIR" || exit 1; \
136         $(MAKE) -C class/Mono.CSharp.Debugger install DESTDIR="$$DESTDIR" || exit 1; \
137         tar cvzf "$$chargedir".tgz "$$chargedir" ; \
138         rm -rf "$$chargedir"