2004-09-23 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / Makefile
1 thisdir := .
2
3 SUBDIRS := build jay mcs monoresgen class mbas nunit20 ilasm tools tests errors docs
4
5 # 'gmcs' is specially built by rules inside class/corlib.
6 DIST_ONLY_SUBDIRS := gmcs
7
8 ifdef TEST_SUBDIRS
9 SUBDIRS := $(TEST_SUBDIRS)
10 endif
11
12 ifndef NO_SIGN_ASSEMBLIES
13 OVERRIDE_TARGET_ALL = yes
14 endif
15
16 include build/rules.make
17
18 all-recursive $(STD_TARGETS:=-recursive): platform-check profile-check
19
20 # Used only if OVERRIDE_TARGET_ALL is defined
21 all.override:
22         $(MAKE) NO_SIGN_ASSEMBLY=yes all.real
23         $(MAKE) all.real
24
25 .PHONY: all-local $(STD_TARGETS:=-local)
26 all-local $(STD_TARGETS:=-local):
27         @:
28
29 # fun specialty targets
30
31 .PHONY: all-profiles $(STD_TARGETS:=-profiles)
32 all-profiles $(STD_TARGETS:=-profiles):
33         $(MAKE) PROFILE=default $(@:-profiles=)
34         $(MAKE) PROFILE=net_2_0 $(@:-profiles=)
35
36 testcorlib:
37         @cd class/corlib && $(MAKE) test run-test
38
39 compiler-tests:
40         $(MAKE) TEST_SUBDIRS="tests errors" run-test-profiles
41
42 test-installed-compiler:
43         $(MAKE) TEST_SUBDIRS="tests errors" PROFILE=default TEST_RUNTIME=mono MCS=mcs run-test
44         $(MAKE) TEST_SUBDIRS="tests errors" PROFILE=net_2_0 TEST_RUNTIME=mono MCS=gmcs run-test
45
46 # Disting. We need to override $(distdir) here.
47
48 package := mcs-$(VERSION)
49 top_distdir = $(dots)/$(package)
50 distdir = $(top_distdir)
51 export package
52
53 DISTFILES = \
54         AUTHORS                 \
55         ChangeLog               \
56         COPYING                 \
57         COPYING.LIB             \
58         INSTALL.txt             \
59         LICENSE                 \
60         LICENSE.GPL             \
61         LICENSE.LGPL            \
62         Makefile                \
63         mkinstalldirs           \
64         MIT.X11                 \
65         MonoIcon.png            \
66         README                  \
67         ScalableMonoIcon.svg    \
68         winexe.in
69
70
71 dist-local: dist-default
72 dist-recursive: dist-pre
73
74 dist-pre:
75         rm -rf $(package)
76         mkdir $(package)
77
78 dist-tarball: dist-recursive
79         tar cvzf $(package).tar.gz $(package)
80
81 dist: dist-tarball
82         rm -rf $(package)
83
84 # the egrep -v is kind of a hack (to get rid of the makefrags)
85 # but otherwise we have to make dist then make clean which
86 # is sort of not kosher. And it breaks with DIST_ONLY_SUBDIRS.
87 #
88 # We need to set prefix on make so class/System/Makefile can find
89 # the installed System.Xml to build properly
90
91 distcheck: dist-tarball
92         rm -rf InstallTest Distcheck-MCS ; \
93         mkdir InstallTest ; \
94         destdir=`cd InstallTest && pwd` ; \
95         mv $(package) Distcheck-MCS ; \
96         (cd Distcheck-MCS && \
97             $(MAKE) prefix=$(prefix) && $(MAKE) test && $(MAKE) install DESTDIR="$$destdir" && \
98             $(MAKE) clean && $(MAKE) dist || exit 1) || exit 1 ; \
99         mv Distcheck-MCS $(package) ; \
100         tar tzf $(package)/$(package).tar.gz |sed -e 's,/$$,,' |sort >distdist.list ; \
101         rm $(package)/$(package).tar.gz ; \
102         tar tzf $(package).tar.gz |sed -e 's,/$$,,' |sort >before.list ; \
103         find $(package) |egrep -v '(makefrag|response)' |sed -e 's,/$$,,' |sort >after.list ; \
104         cmp before.list after.list || exit 1 ; \
105         cmp before.list distdist.list || exit 1 ; \
106         rm -f before.list after.list distdist.list ; \
107         rm -rf $(package) InstallTest
108
109 monocharge:
110         chargedir=monocharge-`date -u +%Y%m%d` ; \
111         mkdir "$$chargedir" ; \
112         DESTDIR=`cd "$$chargedir" && pwd` ; \
113         $(MAKE) install DESTDIR="$$DESTDIR" || exit 1 ; \
114         tar cvzf "$$chargedir".tgz "$$chargedir" ; \
115         rm -rf "$$chargedir"
116
117 # A bare-bones monocharge.
118
119 monocharge-lite:
120         chargedir=monocharge-lite-`date -u +%Y%m%d` ; \
121         mkdir "$$chargedir" ; \
122         DESTDIR=`cd "$$chargedir" && pwd` ; \
123         $(MAKE) -C mcs install DESTDIR="$$DESTDIR" || exit 1; \
124         $(MAKE) -C class/corlib install DESTDIR="$$DESTDIR" || exit 1; \
125         $(MAKE) -C class/System install DESTDIR="$$DESTDIR" || exit 1; \
126         $(MAKE) -C class/System.XML install DESTDIR="$$DESTDIR" || exit 1; \
127         $(MAKE) -C class/Mono.CSharp.Debugger install DESTDIR="$$DESTDIR" || exit 1; \
128         tar cvzf "$$chargedir".tgz "$$chargedir" ; \
129         rm -rf "$$chargedir"