[runtime] Add a --enable-minimal=assert_messages option to remove assertion messages...
[mono-project.git] / Makefile.am
blob9d101fa1c65e8a40c8819a2b93e2c58e4ed0922f
1 ACLOCAL_AMFLAGS = -I m4
3 AM_CFLAGS = $(WERROR_CFLAGS)
5 MONOTOUCH_SUBDIRS = $(libgc_dir) mono
7 # Some tools might not build when cross-compiling
8 if CROSS_COMPILING
9 tools_dir =
10 else
11 tools_dir = tools
12 endif
14 if ENABLE_MSVC
15 build_with_msvc = msvc
16 build_without_msvc =
17 else
18 build_with_msvc =
19 build_without_msvc = msvc
20 endif
22 SUBDIRS = $(build_with_msvc) mk po $(libgc_dir) llvm mono $(ikvm_native_dir) support data runtime scripts man samples $(tools_dir) $(build_without_msvc) $(docs_dir) acceptance-tests
23 # Keep in sync with SUBDIRS
24 DIST_SUBDIRS = $(build_with_msvc) m4 mk po $(libgc_dir) llvm mono ikvm-native support data runtime scripts man samples tools $(build_without_msvc) docs acceptance-tests
26 all: update_submodules
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.sh
32 .PHONY: update_submodules
34 EXTRA_DIST= \
35         README.md               \
36         LICENSE                 \
37         autogen.sh              \
38         mkinstalldirs           \
39         mono-uninstalled.pc.in  \
40         winconfig.h             \
41         code_of_conduct.md      \
42         external                \
43         mcs/class/referencesource
45 DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false
47 # Distribute the 'mcs' tree too
48 GIT_DIR ?= $(srcdir)/.git
49 dist-hook:
50         test -d $(distdir)/mcs || mkdir $(distdir)/mcs
51         d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive
52         rm -rf `find $(top_distdir)/external -path '*\.git'`
53         rm -f `find $(top_distdir)/external -path '*\.exe' -not -path '*/roslyn-binaries/*'`
54         rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/*' -not -path '*/roslyn-binaries/*'`
55         rm -rf "$(top_distdir)/external/linker/linker/Tests"
57 pkgconfigdir = $(libdir)/pkgconfig
58 noinst_DATA = mono-uninstalled.pc
59 DISTCLEANFILES= mono-uninstalled.pc
61 # building with monolite
62 .PHONY: get-monolite-latest 
63 get-monolite-latest:
64         $(MAKE) -C $(mcs_topdir)/class get-monolite-latest
66 if BITCODE
67 BITCODE_CHECK=yes
68 endif
70 .PHONY: check-ci
71 check-ci:
72         MONO_LLVMONLY=$(BITCODE_CHECK) $(srcdir)/scripts/ci/run-test-$(TEST_PROFILE).sh
74 .PHONY: validate do-build-mono-mcs mcs-do-clean mcs-do-tests
75 validate: do-build-mono-mcs
76         $(MAKE) mcs-do-tests
77 do-build-mono-mcs: mcs-do-clean
78         $(MAKE) all
79 mcs-do-clean:
80         cd runtime && $(MAKE) clean-local
81         cd mono/tests && $(MAKE) clean
82 mcs-do-tests:
83         cd runtime && $(MAKE) check-local
84         cd mono/tests && $(MAKE) check
86 .PHONY: compiler-tests mcs-do-compiler-tests
87 compiler-tests:
88         $(MAKE) test_select='TEST_SUBDIRS="tests errors"' validate
89 mcs-do-compiler-tests:
90         $(MAKE) test_select='TEST_SUBDIRS="tests errors"' mcs-do-tests
92 .PHONY: bootstrap-world
93 bootstrap-world: compiler-tests
94         $(MAKE) install
96 if INSTALL_MONOTOUCH
97 monotouch-do-build: config.h
98         @list='$(MONOTOUCH_SUBDIRS)'; for subdir in $$list; do \
99           case "x$$subdir" in \
100                 xmono ) target="monotouch-do-build";; \
101                 * ) target="all";; \
102           esac; \
103           echo "Making $$target in $$subdir"; \
104           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
105         done;
106         (cd runtime && $(MAKE) $(AM_MAKEFLAGS) monotouch-do-build)
108 monotouch-do-clean:
109         @list='$(MONOTOUCH_SUBDIRS)'; for subdir in $$list; do \
110           case "x$$subdir" in \
111                 xmono ) target="monotouch-do-clean";; \
112                 * ) target="clean";; \
113           esac; \
114           echo "Making $$target in $$subdir"; \
115           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
116         done;
117         (cd runtime && $(MAKE) $(AM_MAKEFLAGS) monotouch-do-clean)
119 endif
121 update-csproj:
122         -rm msvc/scripts/order 
123         -rm msvc/scripts/order.xml
124         -rm -rf msvc/scripts/inputs
125         -mkdir msvc/scripts/inputs
126         (cd runtime; $(MAKE) V=1 extra_targets=csproj-local)
128 package-inputs:
129         echo '<?xml version="1.0" encoding="utf-8"?>' > msvc/scripts/order.xml
130         echo '<root>' >> msvc/scripts/order.xml
131         for i in `cat msvc/scripts/order`; do \
132                 set `echo $$i | sed -e 's/:/ /' -e 's/.input//'`; \
133                 cat msvc/scripts/inputs/$$2.input | sed -e 's/\\\\/\\/g' -e 's/\\/\\\\/g' | \
134                 (echo "    <project dir=\"$$1\" library=\"$$2\">"; \
135                  read boot;   echo "      <boot>$$boot</boot>"; \
136                  read flags;  echo "      <flags>$$flags</flags>"; \
137                  read sources;echo "      <sources>$$sources</sources>"; \
138                  read output; echo "      <output>$$output</output>"; \
139                  read built;  echo "      <built_sources>`echo $$built | sed 's/\\\/\\\\/g'`</built_sources>"; \
140                  read libou;  echo "      <library_output>$$libou</library_output>"; \
141                  read fx_ver; echo "      <fx_version>$$fx_ver</fx_version>"; \
142                  read profile; echo "      <profile>$$profile</profile>"; \
143                  read resxt;  echo "      <resources>$$resxt</resources>"; \
144                  read resp;   echo "      <response>$$resp</response>"; \
145                  echo "    </project>") >> msvc/scripts/order.xml; \
146         done
147         echo "</root>" >> msvc/scripts/order.xml
149 # Update llvm version in configure.ac to the output of $LLVM_DIR/bin/llvm-config --version
150 update-llvm-version:
151         if test "x$$LLVM_DIR" = "x"; then echo "Set the make variable LLVM_DIR to the directory containing the LLVM installation."; exit 1; fi
152         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."
155 update-solution-files:
156         cd msvc/scripts && $(MAKE) genproj.exe || exit $$?;
157         $(MAKE) update-csproj
158         $(MAKE) package-inputs
159         (cd msvc/scripts; mono --debug genproj.exe $(GENPROJ_ARGS))
161 update-solution-files-with-tests:
162         $(MAKE) "GENPROJ_ARGS=2012 true true" update-solution-files