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