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