* Mono.Posix.dll.sources: Rename Mono.Posix to Mono.Unix.
[mono.git] / mcs / Makefile
1 thisdir := .
2
3 SUBDIRS := build jay mcs monoresgen 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
8 net_2_0_bootstrap_SUBDIRS := class
9 net_2_0_SUBDIRS := jay gmcs class tests errors tools
10
11 ifdef TEST_SUBDIRS
12 $(PROFILE)_SUBDIRS := $(TEST_SUBDIRS)
13 endif
14
15 OVERRIDE_TARGET_ALL = yes
16
17 include build/rules.make
18
19 all-recursive $(STD_TARGETS:=-recursive): platform-check profile-check
20
21 # Used when OVERRIDE_TARGET_ALL is defined
22 all.override:
23 ifndef NO_SIGN_ASSEMBLY
24         $(MAKE) NO_SIGN_ASSEMBLY=yes all.real
25 endif
26         $(MAKE) all.real
27
28 .PHONY: all-local $(STD_TARGETS:=-local)
29 all-local $(STD_TARGETS:=-local):
30         @:
31
32 # fun specialty targets
33
34 PROFILES = default net_2_0
35
36 .PHONY: all-profiles $(STD_TARGETS:=-profiles)
37 all-profiles $(STD_TARGETS:=-profiles):
38         $(MAKE) $(PROFILES:%=profile-do--%--$(@:-profiles=))
39
40 # The % below looks like profile-name--target-name
41 profile-do--%:
42         $(MAKE) PROFILE=$(subst --, ,$*)
43
44 # Ensure these don't run in parallel, for now.
45 profile-do--net_2_0--run-test: profile-do--default--run-test
46
47 profile-do--net_2_0--all: profile-do--net_2_0_bootstrap--all
48 profile-do--net_2_0_bootstrap--all: profile-do--default--all
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
79 dist-local: dist-default
80
81 dist-pre:
82         rm -rf $(package)
83         mkdir $(package)
84
85 dist-tarball: dist-pre
86         $(MAKE) distdir='$(package)' dist-recursive
87         tar cvzf $(package).tar.gz $(package)
88
89 dist: dist-tarball
90         rm -rf $(package)
91
92 # the egrep -v is kind of a hack (to get rid of the makefrags)
93 # but otherwise we have to make dist then make clean which
94 # is sort of not kosher. And it breaks with DIST_ONLY_SUBDIRS.
95 #
96 # We need to set prefix on make so class/System/Makefile can find
97 # the installed System.Xml to build properly
98
99 distcheck: dist-tarball
100         rm -rf InstallTest Distcheck-MCS ; \
101         mkdir InstallTest ; \
102         destdir=`cd InstallTest && pwd` ; \
103         mv $(package) Distcheck-MCS ; \
104         (cd Distcheck-MCS && \
105             $(MAKE) prefix=$(prefix) && $(MAKE) test && $(MAKE) install DESTDIR="$$destdir" && \
106             $(MAKE) clean && $(MAKE) dist || exit 1) || exit 1 ; \
107         mv Distcheck-MCS $(package) ; \
108         tar tzf $(package)/$(package).tar.gz |sed -e 's,/$$,,' |sort >distdist.list ; \
109         rm $(package)/$(package).tar.gz ; \
110         tar tzf $(package).tar.gz |sed -e 's,/$$,,' |sort >before.list ; \
111         find $(package) |egrep -v '(makefrag|response)' |sed -e 's,/$$,,' |sort >after.list ; \
112         cmp before.list after.list || exit 1 ; \
113         cmp before.list distdist.list || exit 1 ; \
114         rm -f before.list after.list distdist.list ; \
115         rm -rf $(package) InstallTest
116
117 monocharge:
118         chargedir=monocharge-`date -u +%Y%m%d` ; \
119         mkdir "$$chargedir" ; \
120         DESTDIR=`cd "$$chargedir" && pwd` ; \
121         $(MAKE) install DESTDIR="$$DESTDIR" || exit 1 ; \
122         tar cvzf "$$chargedir".tgz "$$chargedir" ; \
123         rm -rf "$$chargedir"
124
125 # A bare-bones monocharge.
126
127 monocharge-lite:
128         chargedir=monocharge-lite-`date -u +%Y%m%d` ; \
129         mkdir "$$chargedir" ; \
130         DESTDIR=`cd "$$chargedir" && pwd` ; \
131         $(MAKE) -C mcs install DESTDIR="$$DESTDIR" || exit 1; \
132         $(MAKE) -C class/corlib install DESTDIR="$$DESTDIR" || exit 1; \
133         $(MAKE) -C class/System install DESTDIR="$$DESTDIR" || exit 1; \
134         $(MAKE) -C class/System.XML install DESTDIR="$$DESTDIR" || exit 1; \
135         $(MAKE) -C class/Mono.CSharp.Debugger install DESTDIR="$$DESTDIR" || exit 1; \
136         tar cvzf "$$chargedir".tgz "$$chargedir" ; \
137         rm -rf "$$chargedir"