Fixed compile errors when DEBUG is defined (#21656)
[mono-project.git] / Makefile.am
blob448a5415e09555614f74e71b10f6de7538ead3d3
1 ACLOCAL_AMFLAGS = -I m4
3 SUBDIRS = @MONO_SUBDIRS@
4 noinst_SUBDIRS = @MONO_NOINST_SUBDIRS@
5 DIST_SUBDIRS = $(SUBDIRS) m4
7 all: $(update_submodules)
9 update_submodules:
10         @cd $(srcdir) && scripts/update_submodules.sh
12 .PHONY: update_submodules
14 EXTRA_DIST= \
15         README.md               \
16         LICENSE                 \
17         autogen.sh              \
18         mkinstalldirs           \
19         mono-uninstalled.pc.in  \
20         winconfig.h             \
21         code_of_conduct.md      \
22         external                \
23         mcs/class/referencesource
25 DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_RUNTIME=false
27 # Distribute the 'mcs' tree too
28 GIT_DIR ?= $(srcdir)/.git
29 dist-hook:
30         test -d $(distdir)/mcs || mkdir $(distdir)/mcs
31         d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive
32         rm -rf `find $(top_distdir)/external -path '*\.git'`
33         rm -rf `find $(top_distdir)/external -path '*\.libs'`
34         rm -rf `find $(top_distdir)/external -path '*\.deps'`
35         rm -f `find $(top_distdir)/external -path '*\.o'`
36         rm -f `find $(top_distdir)/external -path '*\.so'`
37         rm -f `find $(top_distdir)/external -path '*\.lo'`
38         rm -f `find $(top_distdir)/external -path '*\.Plo'`
39         rm -f `find $(top_distdir)/external -name '\.dirstamp'`
40         rm -f `find $(top_distdir)/external -path '*\.exe' -not -path '*/roslyn-binaries/*'`
41         rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/*' -not -path '*/roslyn-binaries/*'`
42         rm -rf "$(top_distdir)/external/linker/test"
43         rm -rf "$(top_distdir)/external/llvm-project/lldb/test"
44         rm -rf "$(top_distdir)/external/llvm-project/libcxx/test"
45         rm -rf "$(top_distdir)/external/llvm-project/clang/test"
47 pkgconfigdir = $(libdir)/pkgconfig
48 noinst_DATA = mono-uninstalled.pc
49 DISTCLEANFILES= mono-uninstalled.pc
51 # building with monolite
52 .PHONY: get-monolite-latest 
53 get-monolite-latest:
54         $(MAKE) -C $(mcs_topdir)/class get-monolite-latest
56 if BITCODE
57 BITCODE_CHECK=yes
58 endif
60 if DEFAULT_TESTS
61 CI_TEST_SCRIPT=$(srcdir)/scripts/ci/run-test-default.sh
62 else
63 CI_TEST_SCRIPT=$(srcdir)/scripts/ci/run-test-$(TEST_PROFILE).sh
64 endif
66 .PHONY: check-ci
67 check-ci:
68         MONO_LLVMONLY=$(BITCODE_CHECK) $(CI_TEST_SCRIPT)
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
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
88 .PHONY: bootstrap-world
89 bootstrap-world: compiler-tests
90         $(MAKE) install
92 install:
93         for mydir in $(filter-out $(noinst_SUBDIRS),$(SUBDIRS)); do \
94           (cd $${mydir} && ${MAKE} install) \
95         done
97 # Update llvm version in configure.ac to the output of $LLVM_DIR/bin/llvm-config --version
98 update-llvm-version:
99         if test "x$$LLVM_DIR" = "x"; then echo "Set the make variable LLVM_DIR to the directory containing the LLVM installation."; exit 1; fi
100         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."