* IndentedTextWriter.cs: have DefaultTabString correspond with
[mono.git] / Makefile.am
1 AUTOMAKE_OPTIONS = foreign
2 ACLOCAL_AMFLAGS = -I .
3
4 SUBDIRS = @libgc_dir@ mono @ikvm_jni_dir@ docs runtime scripts man data samples support web 
5
6 # Keep in sync with SUBDIRS
7 ## 'tools' is not normally built
8 DIST_SUBDIRS = libgc mono ikvm-jni docs runtime scripts man data samples support web tools
9
10 EXTRA_DIST= mono.pc.in mono.spec.in mint.pc.in
11
12 pkgconfigdir = $(libdir)/pkgconfig
13 if JIT_SUPPORTED
14 pkgconfig_DATA= mono.pc mint.pc
15 else
16 pkgconfig_DATA= mint.pc
17 endif
18 DISTCLEANFILES= mono.pc mint.pc
19
20 #
21 # The following targets are used to compile and install
22 # mono and mcs without running into the out-of-sync
23 # problems by doing the compilation in the right order.
24 #
25
26 mcs_topdir=$(top_srcdir)/../mcs
27
28 .PHONY: bootstrap faststrap fasterstrap bootstrap-clean bootstrap-check get-monolite-latest monolite-bootstrap
29 .PHONY: tmpinst-dir tmpinst-mcs-basic-build tmpinst-mcs-short-build tmpinst-mcs-full-build tmpinst-monolite
30 .PHONY: mono-do-runtime-only mcs-do-basic-build mcs-do-short-build mcs-do-full-build mcs-do-clean-profiles mcs-do-run-test
31
32 if USE_JIT
33 mono_runtime = mono/mini/mono
34 else
35 mono_runtime = mono/interpreter/mint
36 endif
37
38 # Minimal set of directories to build, and files used to run the 'mcs' compiler
39 MCS_BASIC_DIRS = jay mcs class/corlib class/System
40 MCS_BASIC_FILES = \
41         $(mcs_topdir)/mcs/mcs.exe \
42         $(mcs_topdir)/class/lib/default/mscorlib.dll \
43         $(mcs_topdir)/class/lib/default/System.dll
44
45 # Set of directories and files the 'mcs' compiler can use
46 ## We build class/System twice to resolve the cyclic dependency of class/System.XML
47 MCS_DIRS = $(MCS_BASIC_DIRS) class/System.XML class/System class/Mono.CSharp.Debugger
48 MCS_FILES = $(MCS_BASIC_FILES) \
49         $(mcs_topdir)/class/lib/default/System.Xml.dll \
50         $(mcs_topdir)/class/lib/default/Mono.CSharp.Debugger.dll
51
52 tmpinst = _tmpinst
53
54 bootstrap: tmpinst-mcs-basic-build mono-do-runtime-only
55         $(MAKE) tmpinst-mcs-short-build
56         $(MAKE) fasterstrap
57
58 faststrap: tmpinst-mcs-short-build
59         $(MAKE) mono-do-runtime-only
60         $(MAKE) fasterstrap
61
62 .PHONY: populate-runtime-subdir
63 ## *** warning ***: tested only with GNU make
64 populate-runtime-subdir:
65         srcdir=`cd $(srcdir) && pwd`; tmpinst=`pwd`/$(tmpinst) ; \
66         PATH=$$tmpinst/bin:$$PATH ; export PATH ; \
67         cd $(mcs_topdir) \
68         && $(MAKE) PROGRAM_INSTALL_DIR=$$srcdir/runtime LIBRARY_INSTALL_DIR=$$srcdir/runtime/net_1_1 prefix=$$tmpinst/prefix PROFILE=default install \
69         && $(MAKE) PROGRAM_INSTALL_DIR=$$srcdir/runtime LIBRARY_INSTALL_DIR=$$srcdir/runtime/net_2_0 prefix=$$tmpinst/prefix PROFILE=net_2_0 install
70         test -z "`find $(tmpinst)/prefix -name '*.dll'`"
71         test -z "`find $(tmpinst)/prefix -name '*.exe'`"
72         set fnord `find $(tmpinst)/prefix -type f | wc -l` ; test "$$2" = 9
73         rm -rf $(tmpinst)/prefix
74
75 fasterstrap: tmpinst-mcs-full-build
76         $(MAKE) populate-runtime-subdir
77         $(MAKE)
78
79 bootstrap-clean: clean mcs-do-clean-profiles
80 bootstrap-check: check mcs-do-run-test
81
82 # building with monolite
83
84 get-monolite-latest:
85         wget -O $(srcdir)/../monolite-latest.tar.gz http://www.go-mono.com/daily/monolite-latest.tar.gz
86
87 monolite-bootstrap: tmpinst-monolite mono-do-runtime-only
88         rm -f $(MCS_FILES)
89         $(MAKE) tmpinst-mcs-short-build
90         $(MAKE) fasterstrap
91
92 # internal targets
93
94 tmpinst-mcs-basic-build: mcs-do-basic-build tmpinst-dir
95         mv -f $(MCS_BASIC_FILES) $(tmpinst)/lib
96
97 tmpinst-mcs-short-build: mcs-do-short-build tmpinst-dir
98         mv -f $(MCS_FILES) $(tmpinst)/lib
99
100 tmpinst-mcs-full-build: mcs-do-full-build tmpinst-dir
101         cp -f $(MCS_FILES) $(tmpinst)/lib
102
103 tmpinst-monolite: tmpinst-dir
104         -rm -f $(tmpinst)/lib/mcs.exe $(tmpinst)/lib/*.dll
105         -rm -fr $(tmpinst)/monolite-*
106         srcdir=`cd $(srcdir) && pwd` && cd $(tmpinst) && ( gzip -d -c $$srcdir/../monolite-latest.tar.gz | tar xf - )
107         mv -f $(tmpinst)/monolite-*/mcs.exe $(tmpinst)/monolite-*/*.dll $(tmpinst)/lib
108         rm -fr $(tmpinst)/monolite-*
109
110 # Build enough of 'mono' to run the stage1 mcs.exe
111 mono-do-runtime-only: $(CONFIG_HEADER)
112         for dir in $(libgc_dir) mono data; do \
113           (cd $$dir && $(MAKE)) || exit 1 ; \
114         done
115
116 mcs-do-basic-build:
117         rm -f $(MCS_FILES)
118         for dir in $(MCS_BASIC_DIRS); do \
119           (cd $(mcs_topdir)/$$dir && $(MAKE) PROFILE=default USE_BOOT_COMPILE=yes BOOTSTRAP_MCS="mcs -d:BOOTSTRAP_WITH_OLDLIB") || exit 1 ; \
120         done
121
122 mcs-do-short-build:
123         tmpinst=`cd $(tmpinst) && pwd` ; \
124         PATH=$$tmpinst/bin:$$PATH; export PATH ; \
125         for dir in $(MCS_DIRS); do \
126           (cd $(mcs_topdir)/$$dir && $(MAKE) PROFILE=default) || exit 1 ; \
127         done
128
129 mcs-do-full-build:
130         tmpinst=`cd $(tmpinst) && pwd` ; \
131         PATH=$$tmpinst/bin:$$PATH ; export PATH ; \
132         cd $(mcs_topdir) && $(MAKE) all-profiles
133
134 mcs-do-clean-profiles:
135         cd $(mcs_topdir) && $(MAKE) clean-profiles
136
137 mcs-do-run-test: tmpinst-dir
138         tmpinst=`cd $(tmpinst) && pwd` ; \
139         PATH=$$tmpinst/bin:$$PATH ; export PATH ; \
140         cd $(mcs_topdir) && $(MAKE) PROFILE=default run-test
141
142 tmpinst-dir: 
143         mkdir -p $(tmpinst) $(tmpinst)/bin $(tmpinst)/lib $(tmpinst)/etc/mono
144         $(MAKE) $(tmpinst)/bin/mono $(tmpinst)/bin/mcs $(tmpinst)/etc/mono/machine.config
145
146 $(tmpinst)/bin/mono: $(srcdir)/Makefile.am
147         echo '#! /bin/sh' > $@
148         echo 'builddir="'`pwd`'"; tmpinst=$$builddir/$(tmpinst)' >> $@
149         echo 'if test -z "$$MONO_PATH" ; then MONO_PATH=$$tmpinst/lib; else MONO_PATH=$${MONO_PATH}:$$tmpinst/lib ; fi' >> $@
150         echo 'MONO_CFG_DIR=$$tmpinst/etc' >> $@
151         echo 'export MONO_PATH MONO_CFG_DIR' >> $@
152         echo 'exec "$$builddir/libtool" --mode=execute "$$builddir/$(mono_runtime)" --config "$$builddir/data/config" "$$@"' >> $@
153         chmod +x $@
154
155 $(tmpinst)/bin/mcs: $(srcdir)/Makefile.am
156         (t=`cd $(tmpinst) && pwd`; echo '#! /bin/sh'; echo 'exec "'"$$t/bin/mono"'" "'"$$t/lib/mcs.exe"'" "$$@"') > $@
157         chmod +x $@
158
159 $(tmpinst)/etc/mono/machine.config: $(srcdir)/data/machine.config
160         rm -f $@
161         srcdir=`cd $(srcdir) && pwd`; cd $(tmpinst)/etc/mono && $(LN_S) $$srcdir/data/machine.config machine.config
162
163 # Obsolete target -- don't use.
164 .PHONY: fullbuild
165 fullbuild: bootstrap
166         $(MAKE) install
167         echo "*** 'fullbuild' is an obsolete target. Use 'make bootstrap && make install'."
168         exit 1
169
170 win32getdeps:
171         wget http://www.go-mono.com/archive/pkgconfig-0.11-20020310.zip
172         wget http://www.go-mono.com/archive/glib-2.0.4-20020703.zip 
173         wget http://www.go-mono.com/archive/glib-dev-2.0.4-20020703.zip 
174         wget http://www.go-mono.com/archive/libiconv-1.7.zip 
175         wget http://www.go-mono.com/archive/libiconv-dev-1.7.zip 
176         wget http://www.go-mono.com/archive/libintl-0.10.40-20020101.zip
177         wget http://www.jroith.de/nsis4cygwin.zip
178         unzip -n -d / pkgconfig-0.11-20020310.zip
179         unzip -n -d / glib-2.0.4-20020703.zip
180         unzip -n -d / glib-dev-2.0.4-20020703.zip
181         unzip -n -d / libiconv-1.7.zip
182         unzip -n -d / libiconv-dev-1.7.zip
183         unzip -n -d / libintl-0.10.40-20020101.zip
184         unzip -n -d / nsis4cygwin.zip
185
186 win32setup:
187         makensis /DMILESTONE=$(VERSION) /DSOURCE_INSTALL_DIR=$(SOURCE_INSTALL_DIR) /DBUILDNUM=$(BUILDNUM) monowiz.win32.nsi