Fix instruction length and correct register setting
[mono.git] / Makefile.am
blob4a0d5a4c42eccbdb4d608c3d864870b2a95e594b
1 AUTOMAKE_OPTIONS = foreign
2 ACLOCAL_AMFLAGS = -I .
4 SUBDIRS = $(libgc_dir) mono $(ikvm_jni_dir) docs data runtime scripts man samples support web 
6 # Keep in sync with SUBDIRS
7 ## 'tools' is not normally built
8 DIST_SUBDIRS = libgc mono ikvm-jni docs data runtime scripts man samples support web tools
10 EXTRA_DIST= mono.pc.in mono.spec.in mint.pc.in
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
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.
26 mcs_topdir=$(top_srcdir)/../mcs
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 .PHONY: populate-runtime-subdir
33 if USE_JIT
34 mono_runtime = mono/mini/mono
35 else
36 mono_runtime = mono/interpreter/mint
37 endif
39 # Minimal set of directories to build, and files used to run the 'mcs' compiler
40 MCS_BASIC_DIRS = jay mcs class/corlib class/System
41 MCS_BASIC_FILES = \
42         $(mcs_topdir)/mcs/mcs.exe \
43         $(mcs_topdir)/class/lib/default/mscorlib.dll \
44         $(mcs_topdir)/class/lib/default/System.dll
46 # Set of directories and files the 'mcs' compiler can use
47 ## We build class/System twice to resolve the cyclic dependency of class/System.XML
48 MCS_DIRS = $(MCS_BASIC_DIRS) class/System.XML class/System class/Mono.CSharp.Debugger
49 MCS_FILES = $(MCS_BASIC_FILES) \
50         $(mcs_topdir)/class/lib/default/System.Xml.dll \
51         $(mcs_topdir)/class/lib/default/Mono.CSharp.Debugger.dll
53 tmpinst = _tmpinst
55 if PLATFORM_WIN32
57 populate_profiles = default:net_1_1
59 # bootstraps using the .NET C# compiler
60 bootstrap: tmpinst-dir mono-do-runtime-only
61         $(MAKE) fasterstrap
63 else
65 populate_profiles = default:net_1_1 net_2_0:net_2_0
67 bootstrap: tmpinst-mcs-basic-build mono-do-runtime-only
68         $(MAKE) tmpinst-mcs-short-build
69         $(MAKE) fasterstrap
71 endif
73 faststrap: tmpinst-mcs-short-build
74         $(MAKE) mono-do-runtime-only
75         $(MAKE) fasterstrap
77 fasterstrap: tmpinst-mcs-full-build
78         $(MAKE) populate-runtime-subdir
79         $(MAKE)
81 bootstrap-clean: clean mcs-do-clean-profiles
82 bootstrap-check: check mcs-do-run-test
84 # building with monolite
86 get-monolite-latest:
87         wget -O $(srcdir)/../monolite-latest.tar.gz http://www.go-mono.com/daily/monolite-latest.tar.gz
89 monolite-bootstrap: tmpinst-monolite mono-do-runtime-only
90         rm -f $(MCS_FILES)
91         $(MAKE) tmpinst-mcs-short-build
92         $(MAKE) fasterstrap
94 # internal targets
96 tmpinst-mcs-basic-build: mcs-do-basic-build tmpinst-dir
97         mv -f $(MCS_BASIC_FILES) $(tmpinst)/lib
99 tmpinst-mcs-short-build: mcs-do-short-build tmpinst-dir
100         mv -f $(MCS_FILES) $(tmpinst)/lib
102 tmpinst-mcs-full-build: mcs-do-full-build tmpinst-dir
103         cp -f $(MCS_FILES) $(tmpinst)/lib
105 tmpinst-monolite: tmpinst-dir
106         -rm -f $(tmpinst)/lib/mcs.exe $(tmpinst)/lib/*.dll
107         -rm -fr $(tmpinst)/monolite-*
108         srcdir=`cd $(srcdir) && pwd` && cd $(tmpinst) && ( gzip -d -c $$srcdir/../monolite-latest.tar.gz | tar xf - )
109         mv -f $(tmpinst)/monolite-*/mcs.exe $(tmpinst)/monolite-*/*.dll $(tmpinst)/lib
110         rm -fr $(tmpinst)/monolite-*
112 # Build enough of 'mono' to run the stage1 mcs.exe
113 mono-do-runtime-only: $(CONFIG_HEADER)
114         for dir in $(libgc_dir) mono data; do \
115           (cd $$dir && $(MAKE)) || exit 1 ; \
116         done
118 mcs-do-basic-build:
119         rm -f $(MCS_FILES)
120         for dir in $(MCS_BASIC_DIRS); do \
121           (cd $(mcs_topdir)/$$dir && $(MAKE) PROFILE=default NO_SIGN_ASSEMBLY=yes USE_BOOT_COMPILE=yes BOOTSTRAP_MCS="mcs -d:BOOTSTRAP_WITH_OLDLIB") || exit 1 ; \
122         done
124 mcs-do-short-build:
125         tmpinst=`cd $(tmpinst) && pwd` ; \
126         PATH=$$tmpinst/bin:$$PATH; export PATH ; \
127         for dir in $(MCS_DIRS); do \
128           (cd $(mcs_topdir)/$$dir && $(MAKE) PROFILE=default NO_SIGN_ASSEMBLY=yes) || exit 1 ; \
129         done
131 mcs-do-full-build:
132         tmpinst=`cd $(tmpinst) && pwd` ; \
133         PATH=$$tmpinst/bin:$$PATH ; export PATH ; \
134         cd $(mcs_topdir) && $(MAKE) all-profiles
136 mcs-do-clean-profiles:
137         cd $(mcs_topdir) && $(MAKE) clean-profiles
139 mcs-do-run-test: tmpinst-dir
140         tmpinst=`cd $(tmpinst) && pwd` ; \
141         PATH=$$tmpinst/bin:$$PATH ; export PATH ; \
142         cd $(mcs_topdir) && $(MAKE) PROFILE=default run-test
144 populate-runtime-subdir:
145         test -n '$(populate_profiles)'
146         @srcdir=`cd $(srcdir) && pwd`; tmpinst=`pwd`/$(tmpinst) ; \
147         PATH=$$tmpinst/bin:$$PATH ; export PATH ; \
148         for profile in $(populate_profiles); do \
149           ( set fnord `echo $$profile | sed 's,:, ,g'` && \
150             echo "cd $(mcs_topdir) && $(MAKE) PROGRAM_INSTALL_DIR=$$srcdir/runtime PROFILE=$$2 LIBRARY_INSTALL_DIR=$$srcdir/runtime/$$3 prefix=$$tmpinst/prefix install" && \
151             cd $(mcs_topdir) && \
152             $(MAKE) PROGRAM_INSTALL_DIR=$$srcdir/runtime PROFILE=$$2 LIBRARY_INSTALL_DIR=$$srcdir/runtime/$$3 prefix=$$tmpinst/prefix install ) || exit 1 ; \
153         done
154         find $(tmpinst)/prefix -type f -path '*/jay*' -exec rm -f '{}' ';'
155         test -z "`find $(tmpinst)/prefix -type f -print`"
156         rm -rf $(tmpinst)/prefix
158 tmpinst-dir: 
159         mkdir -p $(tmpinst) $(tmpinst)/bin $(tmpinst)/lib $(tmpinst)/etc/mono
160         $(MAKE) tmpinst-dir-contents
162 tmpinst-dir-contents: $(tmpinst)/bin/mono $(tmpinst)/bin/mcs $(tmpinst)/etc/mono/machine.config
164 if PLATFORM_WIN32
166 $(tmpinst)/bin/mono: $(srcdir)/Makefile.am
167         echo '#! /bin/sh' > $@
168         echo 'builddir="'`pwd`'"; win_builddir="'`cygpath -w -a .`'"' >> $@
169         echo 'tmpinst="$$win_builddir\\$(tmpinst)"' >> $@
170         echo 'if test -z "$$MONO_PATH" ; then MONO_PATH="$$tmpinst\\lib"; else MONO_PATH="$${MONO_PATH};$$tmpinst\\lib" ; fi' >> $@
171         echo 'MONO_CFG_DIR="$$tmpinst\\etc"' >> $@
172         echo 'export MONO_PATH MONO_CFG_DIR' >> $@
173         echo 'exec "$$builddir/libtool" --mode=execute "$$builddir/$(mono_runtime).exe" "$$@"' >> $@
174         chmod +x $@
176 else
178 $(tmpinst)/bin/mono: $(srcdir)/Makefile.am
179         echo '#! /bin/sh' > $@
180         echo 'builddir="'`pwd`'"; tmpinst=$$builddir/$(tmpinst)' >> $@
181         echo 'if test -z "$$MONO_PATH" ; then MONO_PATH=$$tmpinst/lib; else MONO_PATH=$${MONO_PATH}:$$tmpinst/lib ; fi' >> $@
182         echo 'MONO_CFG_DIR=$$tmpinst/etc' >> $@
183         echo 'export MONO_PATH MONO_CFG_DIR' >> $@
184         echo 'exec "$$builddir/libtool" --mode=execute "$$builddir/$(mono_runtime)" --config "$$builddir/data/config" "$$@"' >> $@
185         chmod +x $@
187 endif
189 $(tmpinst)/bin/mcs: $(srcdir)/Makefile.am
190         (t=`cd $(tmpinst) && pwd`; echo '#! /bin/sh'; echo 'exec "'"$$t/bin/mono"'" "'"$$t/lib/mcs.exe"'" "$$@"') > $@
191         chmod +x $@
193 $(tmpinst)/etc/mono/machine.config: $(srcdir)/data/machine.config
194         rm -f $@
195         srcdir=`cd $(srcdir) && pwd`; cd $(tmpinst)/etc/mono && $(LN_S) $$srcdir/data/machine.config machine.config
197 # Obsolete target -- don't use.
198 .PHONY: fullbuild
199 fullbuild: bootstrap
200         $(MAKE) install
201         echo "*** 'fullbuild' is an obsolete target. Use 'make bootstrap && make install'."
202         exit 1
204 win32getdeps:
205         wget http://www.go-mono.com/archive/pkgconfig-0.11-20020310.zip
206         wget http://www.go-mono.com/archive/glib-2.0.4-20020703.zip 
207         wget http://www.go-mono.com/archive/glib-dev-2.0.4-20020703.zip 
208         wget http://www.go-mono.com/archive/libiconv-1.7.zip 
209         wget http://www.go-mono.com/archive/libiconv-dev-1.7.zip 
210         wget http://www.go-mono.com/archive/libintl-0.10.40-20020101.zip
211         wget http://www.jroith.de/nsis4cygwin.zip
212         unzip -n -d / pkgconfig-0.11-20020310.zip
213         unzip -n -d / glib-2.0.4-20020703.zip
214         unzip -n -d / glib-dev-2.0.4-20020703.zip
215         unzip -n -d / libiconv-1.7.zip
216         unzip -n -d / libiconv-dev-1.7.zip
217         unzip -n -d / libintl-0.10.40-20020101.zip
218         unzip -n -d / nsis4cygwin.zip
220 win32setup:
221         makensis /DMILESTONE=$(VERSION) /DSOURCE_INSTALL_DIR=$(SOURCE_INSTALL_DIR) /DBUILDNUM=$(BUILDNUM) monowiz.win32.nsi