Merge pull request #4630 from BrzVlad/feature-valloc-limit
[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.sh
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' -not -path '*/roslyn-binaries/*'`
46         rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/*' -not -path '*/roslyn-binaries/*'`
47
48 pkgconfigdir = $(libdir)/pkgconfig
49 noinst_DATA = mono-uninstalled.pc
50 DISTCLEANFILES= mono-uninstalled.pc
51
52 # building with monolite
53 mcslib = $(mcs_topdir)/class/lib
54 monolite_url = https://download.mono-project.com/monolite/monolite-$(MONO_CORLIB_VERSION)-latest.tar.gz
55 .PHONY: get-monolite-latest 
56 get-monolite-latest:
57         -rm -fr $(mcslib)/monolite/$(MONO_CORLIB_VERSION)
58         -mkdir -p $(mcslib)/monolite
59         cd $(mcslib) && { (wget -O- $(monolite_url) || curl -L $(monolite_url)) | gzip -d | tar xf - ; }
60         cd $(mcslib) && mv -f monolite-* monolite/$(MONO_CORLIB_VERSION)
61
62 if BITCODE
63 BITCODE_CHECK=yes
64 endif
65
66 .PHONY: check-ci
67 check-ci:
68         MONO_LLVMONLY=$(BITCODE_CHECK) $(srcdir)/scripts/ci/run-test-$(TEST_PROFILE).sh
69
70 .PHONY: validate do-build-mono-mcs mcs-do-clean mcs-do-tests
71 validate: do-build-mono-mcs
72         $(MAKE) mcs-do-tests
73 do-build-mono-mcs: mcs-do-clean
74         $(MAKE) all
75 mcs-do-clean:
76         cd runtime && $(MAKE) clean-local
77         cd mono/tests && $(MAKE) clean
78 mcs-do-tests:
79         cd runtime && $(MAKE) check-local
80         cd mono/tests && $(MAKE) check
81
82 .PHONY: compiler-tests mcs-do-compiler-tests
83 compiler-tests:
84         $(MAKE) test_select='TEST_SUBDIRS="tests errors"' validate
85 mcs-do-compiler-tests:
86         $(MAKE) test_select='TEST_SUBDIRS="tests errors"' mcs-do-tests
87
88 .PHONY: bootstrap-world
89 bootstrap-world: compiler-tests
90         $(MAKE) install
91
92 if INSTALL_MONOTOUCH
93 monotouch-do-build: config.h
94         @list='$(MONOTOUCH_SUBDIRS)'; for subdir in $$list; do \
95           case "x$$subdir" in \
96                 xmono ) target="monotouch-do-build";; \
97                 * ) target="all";; \
98           esac; \
99           echo "Making $$target in $$subdir"; \
100           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
101         done;
102         (cd runtime && $(MAKE) $(AM_MAKEFLAGS) monotouch-do-build)
103
104 monotouch-do-clean:
105         @list='$(MONOTOUCH_SUBDIRS)'; for subdir in $$list; do \
106           case "x$$subdir" in \
107                 xmono ) target="monotouch-do-clean";; \
108                 * ) target="clean";; \
109           esac; \
110           echo "Making $$target in $$subdir"; \
111           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
112         done;
113         (cd runtime && $(MAKE) $(AM_MAKEFLAGS) monotouch-do-clean)
114
115 endif
116
117 win32getdeps:
118         wget http://www.go-mono.com/archive/pkgconfig-0.11-20020310.zip
119         wget http://www.go-mono.com/archive/glib-2.0.4-20020703.zip 
120         wget http://www.go-mono.com/archive/glib-dev-2.0.4-20020703.zip 
121         wget http://www.go-mono.com/archive/libiconv-1.7.zip 
122         wget http://www.go-mono.com/archive/libiconv-dev-1.7.zip 
123         wget http://www.go-mono.com/archive/libintl-0.10.40-20020101.zip
124         unzip -n -d / pkgconfig-0.11-20020310.zip
125         unzip -n -d / glib-2.0.4-20020703.zip
126         unzip -n -d / glib-dev-2.0.4-20020703.zip
127         unzip -n -d / libiconv-1.7.zip
128         unzip -n -d / libiconv-dev-1.7.zip
129         unzip -n -d / libintl-0.10.40-20020101.zip
130
131 win32setup:
132         makensis /DMILESTONE=$(VERSION) /DSOURCE_INSTALL_DIR=$(SOURCE_INSTALL_DIR) /DBUILDNUM=$(BUILDNUM) monowiz.win32.nsi
133
134 update-csproj:
135         -rm msvc/scripts/order 
136         -rm msvc/scripts/order.xml
137         -rm -rf msvc/scripts/inputs
138         -mkdir msvc/scripts/inputs
139         (cd runtime; make V=1 extra_targets=csproj-local)
140
141 package-inputs:
142         echo '<?xml version="1.0" encoding="utf-8"?>' > msvc/scripts/order.xml
143         echo '<root>' >> msvc/scripts/order.xml
144         for i in `cat msvc/scripts/order`; do \
145                 set `echo $$i | sed -e 's/:/ /' -e 's/.input//'`; \
146                 cat msvc/scripts/inputs/$$2.input | sed -e 's/\\\\/\\/g' -e 's/\\/\\\\/g' | \
147                 (echo "    <project dir=\"$$1\" library=\"$$2\">"; \
148                  read boot;   echo "      <boot>$$boot</boot>"; \
149                  read flags;  echo "      <flags>$$flags</flags>"; \
150                  read output; echo "      <output>$$output</output>"; \
151                  read built;  echo "      <built_sources>`echo $$built | sed 's/\\\/\\\\/g'`</built_sources>"; \
152                  read libou;  echo "      <library_output>$$libou</library_output>"; \
153                  read fx_ver; echo "      <fx_version>$$fx_ver</fx_version>"; \
154                  read profile; echo "      <profile>$$profile</profile>"; \
155                  read resxt;  echo "      <resources>$$resxt</resources>"; \
156                  read resp;   echo "      <response>$$resp</response>"; \
157                  echo "    </project>") >> msvc/scripts/order.xml; \
158         done
159         echo "</root>" >> msvc/scripts/order.xml
160
161 # Update llvm version in configure.ac to the output of $LLVM_DIR/bin/llvm-config --version
162 update-llvm-version:
163         if test "x$$LLVM_DIR" = "x"; then echo "Set the make variable LLVM_DIR to the directory containing the LLVM installation."; exit 1; fi
164         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."
165
166
167 update-solution-files:
168         make update-csproj
169         make package-inputs
170         (cd msvc/scripts; make genproj.exe; mono genproj.exe)