2003-09-01 Ben Maurer <bmaurer@users.sourceforge.net>
[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         ScalableMonoIcon.svg    \
45         winexe.in
46
47 dist-pre:
48         rm -rf $(package)
49
50 dist-post:
51         tar cvzf $(package).tar.gz $(package)
52
53 dist-local: dist-default
54
55 dist-tarball: dist-pre dist-recursive dist-post
56
57 dist: dist-tarball
58         rm -rf $(package)
59
60 # the egrep -v is kind of a hack (to get rid of the makefrags)
61 # but otherwise we have to make dist then make clean which
62 # is sort of not kosher. And it breaks with DIST_ONLY_SUBDIRS.
63 #
64 # We need to set prefix on make so class/System/Makefile can find
65 # the installed System.Xml to build properly
66
67 distcheck:
68         rm -rf InstallTest Distcheck-MCS ; \
69         mkdir InstallTest ; \
70         destdir=`cd InstallTest && pwd` ; \
71         $(MAKE) dist-tarball || exit 1 ; \
72         mv $(package) Distcheck-MCS ; \
73         (cd Distcheck-MCS && \
74             make prefix=$(prefix) && make test && make install DESTDIR="$$destdir" && \
75             make clean && make dist || exit 1) || exit 1 ; \
76         mv Distcheck-MCS $(package) ; \
77         tar tzf $(package)/$(package).tar.gz |sed -e 's,/$$,,' |sort >distdist.list ; \
78         rm $(package)/$(package).tar.gz ; \
79         tar tzf $(package).tar.gz |sed -e 's,/$$,,' |sort >before.list ; \
80         find $(package) |egrep -v '(makefrag|response)' |sed -e 's,/$$,,' |sort >after.list ; \
81         cmp before.list after.list || exit 1 ; \
82         cmp before.list distdist.list || exit 1 ; \
83         rm -f before.list after.list distdist.list ; \
84         rm -rf $(package) InstallTest
85
86 monocharge:
87         chargedir=monocharge-`date -u +%Y%m%d` ; \
88         mkdir "$$chargedir" ; \
89         DESTDIR=`cd "$$chargedir" && pwd` ; \
90         $(MAKE) install DESTDIR="$$DESTDIR" || exit 1 ; \
91         tar cvzf "$$chargedir".tgz "$$chargedir" ; \
92         rm -rf "$$chargedir"
93
94 # A bare-bones monocharge.
95
96 monocharge-lite:
97         chargedir=monocharge-lite-`date -u +%Y%m%d` ; \
98         mkdir "$$chargedir" ; \
99         DESTDIR=`cd "$$chargedir" && pwd` ; \
100         $(MAKE) -C mcs install DESTDIR="$$DESTDIR" || exit 1; \
101         $(MAKE) -C class/corlib install DESTDIR="$$DESTDIR" || exit 1; \
102         $(MAKE) -C class/System install DESTDIR="$$DESTDIR" || exit 1; \
103         $(MAKE) -C class/System.XML install DESTDIR="$$DESTDIR" || exit 1; \
104         $(MAKE) -C class/Mono.CSharp.Debugger install DESTDIR="$$DESTDIR" || exit 1; \
105         tar cvzf "$$chargedir".tgz "$$chargedir" ; \
106         rm -rf "$$chargedir"