Rename master branch to main
[mono-project.git] / Makefile.am
blob5b02028fc3514b7c1af60aaae1381fe2cc9bdd57
1 ACLOCAL_AMFLAGS = -I m4
3 SUBDIRS = @MONO_SUBDIRS@
4 noinst_SUBDIRS = @MONO_NOINST_SUBDIRS@
5 DIST_SUBDIRS = $(SUBDIRS) m4
7 if !ENABLE_NETCORE
9 all: $(update_submodules)
11 update_submodules:
12         @cd $(srcdir) && scripts/update_submodules.sh
14 .PHONY: update_submodules
16 EXTRA_DIST= \
17         README.md               \
18         LICENSE                 \
19         autogen.sh              \
20         mkinstalldirs           \
21         mono-uninstalled.pc.in  \
22         winconfig.h             \
23         code_of_conduct.md      \
24         external                \
25         mcs/class/referencesource
27 DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_RUNTIME=false
29 # Distribute the 'mcs' tree too
30 GIT_DIR ?= $(srcdir)/.git
31 dist-hook:
32         test -d $(distdir)/mcs || mkdir $(distdir)/mcs
33         d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive
34         rm -rf `find $(top_distdir)/external -path '*\.git'`
35         rm -rf `find $(top_distdir)/external -path '*\.libs'`
36         rm -rf `find $(top_distdir)/external -path '*\.deps'`
37         rm -f `find $(top_distdir)/external -path '*\.o'`
38         rm -f `find $(top_distdir)/external -path '*\.so'`
39         rm -f `find $(top_distdir)/external -path '*\.lo'`
40         rm -f `find $(top_distdir)/external -path '*\.Plo'`
41         rm -f `find $(top_distdir)/external -name '\.dirstamp'`
42         rm -f `find $(top_distdir)/external -path '*\.exe' -not -path '*/roslyn-binaries/*'`
43         rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/*' -not -path '*/roslyn-binaries/*' -not -path '*/helix-binaries/*'`
44         rm -rf "$(top_distdir)/external/linker/test"
45         rm -rf "$(top_distdir)/external/llvm-project/lldb/test"
46         rm -rf "$(top_distdir)/external/llvm-project/libcxx/test"
47         rm -rf "$(top_distdir)/external/llvm-project/clang/test"
49 pkgconfigdir = $(libdir)/pkgconfig
50 noinst_DATA = mono-uninstalled.pc
51 DISTCLEANFILES= mono-uninstalled.pc
53 # building with monolite
54 .PHONY: get-monolite-latest 
55 get-monolite-latest:
56         $(MAKE) -C $(mcs_topdir)/class get-monolite-latest
58 if BITCODE
59 BITCODE_CHECK=yes
60 endif
62 if DEFAULT_TESTS
63 CI_TEST_SCRIPT=$(srcdir)/scripts/ci/run-test-default.sh
64 else
65 CI_TEST_SCRIPT=$(srcdir)/scripts/ci/run-test-$(TEST_PROFILE).sh
66 endif
68 .PHONY: check-ci
69 check-ci:
70         MONO_LLVMONLY=$(BITCODE_CHECK) $(CI_TEST_SCRIPT)
72 .PHONY: validate do-build-mono-mcs mcs-do-clean mcs-do-tests
73 validate: do-build-mono-mcs
74         $(MAKE) mcs-do-tests
75 do-build-mono-mcs: mcs-do-clean
76         $(MAKE) all
77 mcs-do-clean:
78         cd runtime && $(MAKE) clean-local
79         cd mono/tests && $(MAKE) clean
80 mcs-do-tests:
81         cd runtime && $(MAKE) check-local
82         cd mono/tests && $(MAKE) check
84 .PHONY: compiler-tests mcs-do-compiler-tests
85 compiler-tests:
86         $(MAKE) test_select='TEST_SUBDIRS="tests errors"' validate
87 mcs-do-compiler-tests:
88         $(MAKE) test_select='TEST_SUBDIRS="tests errors"' mcs-do-tests
90 .PHONY: bootstrap-world
91 bootstrap-world: compiler-tests
92         $(MAKE) install
94 install:
95         for mydir in $(filter-out $(noinst_SUBDIRS),$(SUBDIRS)); do \
96           (cd $${mydir} && ${MAKE} install) \
97         done
99 # Update llvm version in configure.ac to the output of $LLVM_DIR/bin/llvm-config --version
100 update-llvm-version:
101         if test "x$$LLVM_DIR" = "x"; then echo "Set the make variable LLVM_DIR to the directory containing the LLVM installation."; exit 1; fi
102         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."
104 endif