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