Merge pull request #487 from mayerwin/patch-1
[mono.git] / Makefile.am
1 ACLOCAL_AMFLAGS = -I m4
2
3 MOONLIGHT_SUBDIRS = $(libgc_dir) eglib/src mono
4 MONOTOUCH_SUBDIRS = $(libgc_dir) eglib/src mono
5
6 if CROSS_COMPILING
7 SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) data runtime scripts man samples msvc $(docs_dir)
8 # Keep in sync with SUBDIRS
9 ## 'tools' is not normally built
10 DIST_SUBDIRS = m4 po libgc eglib mono ikvm-native data runtime scripts man samples tools msvc docs
11 else
12 if ONLY_MONOTOUCH
13 SUBDIRS = $(MONOTOUCH_SUBDIRS) runtime
14 else
15 if ONLY_MOONLIGHT
16 SUBDIRS = $(MOONLIGHT_SUBDIRS) runtime
17 else
18 SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data runtime scripts man samples msvc $(docs_dir)
19 # Keep in sync with SUBDIRS
20 ## 'tools' is not normally built
21 DIST_SUBDIRS = m4 po libgc eglib mono ikvm-native support data runtime scripts man samples tools msvc docs
22 endif
23 endif
24 endif
25
26 all: update_submodules
27
28 SUBMODULE_ERROR='Could not recursively update all git submodules. You may experience compilation problems if some submodules are out of date'
29 update_submodules:
30         @$(srcdir)/scripts/update_submodules
31
32 .PHONY: update_submodules
33
34 EXTRA_DIST= \
35             LICENSE \
36             autogen.sh \
37             build-mingw32.sh \
38             mkinstalldirs \
39             mono-uninstalled.pc.in \
40             winconfig.h \
41             mono-core.spec \
42             external
43
44 DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false
45
46 # Distribute the 'mcs' tree too
47 GIT_DIR ?= $(srcdir)/.git
48 dist-hook:
49         test -d $(distdir)/mcs || mkdir $(distdir)/mcs
50         d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive
51         rm -rf `find $(top_distdir)/external -path '*\.git' -and -type d`
52 # Disable this for now because it is very slow and causes wrench to timeout:
53 #       test ! -d $(GIT_DIR) || ./scripts/commits-to-changelog.py --root=$(distdir) last-commit-with-compulsory-changelog-entry
54
55 pkgconfigdir = $(libdir)/pkgconfig
56 noinst_DATA = mono-uninstalled.pc
57 DISTCLEANFILES= mono-uninstalled.pc
58
59 # building with monolite
60 mcslib = $(mcs_topdir)/class/lib
61 monolite = $(mcslib)/monolite
62 mono_corlib_version = $(shell sed -n "s/\#define MONO_CORLIB_VERSION //p" $(srcdir)/mono/metadata/appdomain.c)
63 monolite_url = http://storage.bos.xamarin.com/mono-dist-master/latest/monolite-$(mono_corlib_version)-latest.tar.gz
64 .PHONY: get-monolite-latest 
65 get-monolite-latest:
66         -rm -fr $(mcslib)/monolite-*
67         -mkdir -p $(mcslib)
68         test ! -d $(monolite) || test ! -d $(monolite).old || rm -fr $(monolite).old
69         test ! -d $(monolite) || mv -f $(monolite) $(monolite).old
70         cd $(mcslib) && { (wget -O- $(monolite_url) || curl $(monolite_url)) | gzip -d | tar xf - ; }
71         cd $(mcslib) && mv -f monolite-* monolite
72
73 .PHONY: validate do-build-mono-mcs mcs-do-clean mcs-do-tests
74 validate: do-build-mono-mcs
75         $(MAKE) mcs-do-tests
76 do-build-mono-mcs: mcs-do-clean
77         $(MAKE) all
78 mcs-do-clean:
79         cd runtime && $(MAKE) clean-local
80         cd mono/tests && $(MAKE) clean
81 mcs-do-tests:
82         cd runtime && $(MAKE) check-local
83         cd mono/tests && $(MAKE) check
84
85 .PHONY: compiler-tests mcs-do-compiler-tests
86 compiler-tests:
87         $(MAKE) test_select='TEST_SUBDIRS="tests errors"' validate
88 mcs-do-compiler-tests:
89         $(MAKE) test_select='TEST_SUBDIRS="tests errors"' mcs-do-tests
90
91 .PHONY: bootstrap-world
92 bootstrap-world: compiler-tests
93         $(MAKE) install
94
95 if MOONLIGHT
96 moon-do-build: config.h
97         @list='$(MOONLIGHT_SUBDIRS)'; for subdir in $$list; do \
98           case "x$$subdir" in \
99                 xmono ) target="moon-do-build";; \
100                 * ) target="all";; \
101           esac; \
102           echo "Making $$target in $$subdir"; \
103           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
104         done;
105         (cd runtime && $(MAKE) $(AM_MAKEFLAGS) moon-do-build)
106
107 moon-do-clean:
108         @list='$(MOONLIGHT_SUBDIRS)'; for subdir in $$list; do \
109           case "x$$subdir" in \
110                 xmono ) target="moon-do-clean";; \
111                 * ) target="clean";; \
112           esac; \
113           echo "Making $$target in $$subdir"; \
114           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
115         done;
116         (cd runtime && $(MAKE) $(AM_MAKEFLAGS) moon-do-clean)
117
118 endif
119
120 if INSTALL_MONOTOUCH
121 monotouch-do-build: config.h
122         @list='$(MONOTOUCH_SUBDIRS)'; for subdir in $$list; do \
123           case "x$$subdir" in \
124                 xmono ) target="monotouch-do-build";; \
125                 * ) target="all";; \
126           esac; \
127           echo "Making $$target in $$subdir"; \
128           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
129         done;
130         (cd runtime && $(MAKE) $(AM_MAKEFLAGS) monotouch-do-build)
131
132 monotouch-do-clean:
133         @list='$(MONOTOUCH_SUBDIRS)'; for subdir in $$list; do \
134           case "x$$subdir" in \
135                 xmono ) target="monotouch-do-clean";; \
136                 * ) target="clean";; \
137           esac; \
138           echo "Making $$target in $$subdir"; \
139           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
140         done;
141         (cd runtime && $(MAKE) $(AM_MAKEFLAGS) monotouch-do-clean)
142
143 endif
144
145 win32getdeps:
146         wget http://www.go-mono.com/archive/pkgconfig-0.11-20020310.zip
147         wget http://www.go-mono.com/archive/glib-2.0.4-20020703.zip 
148         wget http://www.go-mono.com/archive/glib-dev-2.0.4-20020703.zip 
149         wget http://www.go-mono.com/archive/libiconv-1.7.zip 
150         wget http://www.go-mono.com/archive/libiconv-dev-1.7.zip 
151         wget http://www.go-mono.com/archive/libintl-0.10.40-20020101.zip
152         unzip -n -d / pkgconfig-0.11-20020310.zip
153         unzip -n -d / glib-2.0.4-20020703.zip
154         unzip -n -d / glib-dev-2.0.4-20020703.zip
155         unzip -n -d / libiconv-1.7.zip
156         unzip -n -d / libiconv-dev-1.7.zip
157         unzip -n -d / libintl-0.10.40-20020101.zip
158
159 win32setup:
160         makensis /DMILESTONE=$(VERSION) /DSOURCE_INSTALL_DIR=$(SOURCE_INSTALL_DIR) /DBUILDNUM=$(BUILDNUM) monowiz.win32.nsi
161
162 update-csproj:
163         -rm msvc/scripts/order 
164         -mkdir msvc/scripts/inputs
165         (cd runtime; make V=1 extra_targets=csproj-local)
166
167 package-inputs:
168         echo '<?xml version="1.0" encoding="utf-8"?>' > msvc/scripts/order.xml
169         echo '<root>' >> msvc/scripts/order.xml
170         for i in `cat msvc/scripts/order`; do \
171                 set `echo $$i | sed -e 's/:/ /' -e 's/.input//'`; \
172                 cat msvc/scripts/inputs/$$2.input | \
173                 (echo "    <project dir=\"$$1\" library=\"$$2\">"; \
174                  read boot;   echo "      <boot>$$boot</boot>"; \
175                  read mcs;    echo "      <mcs>$$mcs</mcs>"; \
176                  read flags;  echo "      <flags>$$flags</flags>"; \
177                  read output; echo "      <output>$$output</output>"; \
178                  read built;  echo "      <built_sources>$$built</built_sources>"; \
179                  read libou;  echo "      <library_output>$$libou</library_output>"; \
180                  read fx_ver; echo "      <fx_version>$$fx_ver</fx_version>"; \
181                  read resp;   echo "      <response>$$resp</response>"; \
182                 echo "    </project>") >> msvc/scripts/order.xml; \
183         done
184         echo "</root>" >> msvc/scripts/order.xml