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