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