Fix potential crash for Encoder.Convert (#20522)
[mono-project.git] / Makefile.am
blob229db0b15bb3b1cc8cfe20f3f5f13e13e2c1e4b7
1 ACLOCAL_AMFLAGS = -I m4
3 AM_CFLAGS = $(WERROR_CFLAGS)
5 SUBDIRS = @MONO_SUBDIRS@
6 noinst_SUBDIRS = @MONO_NOINST_SUBDIRS@
7 DIST_SUBDIRS = $(SUBDIRS) m4 netcore netcore/corerun
9 if !ENABLE_NETCORE
11 all: $(update_submodules)
13 update_submodules:
14         @cd $(srcdir) && scripts/update_submodules.sh
16 .PHONY: update_submodules
18 EXTRA_DIST= \
19         README.md               \
20         LICENSE                 \
21         autogen.sh              \
22         mkinstalldirs           \
23         mono-uninstalled.pc.in  \
24         winconfig.h             \
25         code_of_conduct.md      \
26         external                \
27         netcore/Makefile        \
28         mcs/class/referencesource
30 DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_RUNTIME=false
32 # Distribute the 'mcs' tree too
33 GIT_DIR ?= $(srcdir)/.git
34 dist-hook:
35         test -d $(distdir)/mcs || mkdir $(distdir)/mcs
36         d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive
37         rm -rf `find $(top_distdir)/external -path '*\.git'`
38         rm -rf `find $(top_distdir)/external -path '*\.libs'`
39         rm -rf `find $(top_distdir)/external -path '*\.deps'`
40         rm -f `find $(top_distdir)/external -path '*\.o'`
41         rm -f `find $(top_distdir)/external -path '*\.so'`
42         rm -f `find $(top_distdir)/external -path '*\.lo'`
43         rm -f `find $(top_distdir)/external -path '*\.Plo'`
44         rm -f `find $(top_distdir)/external -name '\.dirstamp'`
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/*' -not -path '*/helix-binaries/*'`
47         rm -rf "$(top_distdir)/external/linker/test"
48         rm -rf "$(top_distdir)/external/llvm-project/lldb/test"
49         rm -rf "$(top_distdir)/external/llvm-project/libcxx/test"
50         rm -rf "$(top_distdir)/external/llvm-project/clang/test"
52 pkgconfigdir = $(libdir)/pkgconfig
53 noinst_DATA = mono-uninstalled.pc
54 DISTCLEANFILES= mono-uninstalled.pc
56 # building with monolite
57 .PHONY: get-monolite-latest 
58 get-monolite-latest:
59         $(MAKE) -C $(mcs_topdir)/class get-monolite-latest
61 if BITCODE
62 BITCODE_CHECK=yes
63 endif
65 if DEFAULT_TESTS
66 CI_TEST_SCRIPT=$(srcdir)/scripts/ci/run-test-default.sh
67 else
68 CI_TEST_SCRIPT=$(srcdir)/scripts/ci/run-test-$(TEST_PROFILE).sh
69 endif
71 .PHONY: check-ci
72 check-ci:
73         MONO_LLVMONLY=$(BITCODE_CHECK) $(CI_TEST_SCRIPT)
75 .PHONY: validate do-build-mono-mcs mcs-do-clean mcs-do-tests
76 validate: do-build-mono-mcs
77         $(MAKE) mcs-do-tests
78 do-build-mono-mcs: mcs-do-clean
79         $(MAKE) all
80 mcs-do-clean:
81         cd runtime && $(MAKE) clean-local
82         cd mono/tests && $(MAKE) clean
83 mcs-do-tests:
84         cd runtime && $(MAKE) check-local
85         cd mono/tests && $(MAKE) check
87 .PHONY: compiler-tests mcs-do-compiler-tests
88 compiler-tests:
89         $(MAKE) test_select='TEST_SUBDIRS="tests errors"' validate
90 mcs-do-compiler-tests:
91         $(MAKE) test_select='TEST_SUBDIRS="tests errors"' mcs-do-tests
93 .PHONY: bootstrap-world
94 bootstrap-world: compiler-tests
95         $(MAKE) install
97 install:
98         for mydir in $(filter-out $(noinst_SUBDIRS),$(SUBDIRS)); do \
99           (cd $${mydir} && ${MAKE} install) \
100         done
102 update-csproj:
103         -rm msvc/scripts/order 
104         -rm msvc/scripts/order.xml
105         -rm -rf msvc/scripts/inputs
106         -mkdir msvc/scripts/inputs
107         (cd runtime; $(MAKE) V=1 extra_targets=csproj-local)
109 package-inputs:
110         echo '<?xml version="1.0" encoding="utf-8"?>' > msvc/scripts/order.xml
111         echo '<root>' >> msvc/scripts/order.xml
112         for i in `cat msvc/scripts/order`; do \
113                 set `echo $$i | sed -e 's/:/ /' -e 's/.input//'`; \
114                 cat msvc/scripts/inputs/$$2.input | sed -e 's/\\\\/\\/g' -e 's/\\/\\\\/g' | \
115                 (echo "    <project dir=\"$$1\" library=\"$$2\">"; \
116                  read boot;   echo "      <boot>$$boot</boot>"; \
117                  read flags;  echo "      <flags>$$flags</flags>"; \
118                  read sources;echo "      <sources>$$sources</sources>"; \
119                  read output; echo "      <output>$$output</output>"; \
120                  read built;  echo "      <built_sources>`echo $$built | sed 's/\\\/\\\\/g'`</built_sources>"; \
121                  read libou;  echo "      <library_output>$$libou</library_output>"; \
122                  read fx_ver; echo "      <fx_version>$$fx_ver</fx_version>"; \
123                  read profile; echo "      <profile>$$profile</profile>"; \
124                  read resxt;  echo "      <resources>$$resxt</resources>"; \
125                  read resp;   echo "      <response>$$resp</response>"; \
126                  echo "    </project>") >> msvc/scripts/order.xml; \
127         done
128         echo "</root>" >> msvc/scripts/order.xml
130 # Update llvm version in configure.ac to the output of $LLVM_DIR/bin/llvm-config --version
131 update-llvm-version:
132         if test "x$$LLVM_DIR" = "x"; then echo "Set the make variable LLVM_DIR to the directory containing the LLVM installation."; exit 1; fi
133         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."
136 update-solution-files:
137         cd msvc/scripts && $(MAKE) genproj.exe || exit $$?;
138         $(MAKE) update-csproj
139         $(MAKE) package-inputs
140         (cd msvc/scripts; mono --debug genproj.exe $(GENPROJ_ARGS))
142 update-solution-files-with-tests:
143         $(MAKE) "GENPROJ_ARGS=2012 true true" update-solution-files
145 endif