[linker-analyzer] Fix error reporting
[mono-project.git] / Makefile.am
blobf9dd1784c836bf7846c2a2a05a6429f344a77f32
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 BUILD_SUPPORT
15 support_dir = support
16 else
17 support_dir =
18 endif
20 SUBDIRS = po $(libgc_dir) mono $(ikvm_native_dir) $(support_dir) data runtime scripts man samples $(tools_dir) msvc $(docs_dir) acceptance-tests llvm
21 # Keep in sync with SUBDIRS
22 DIST_SUBDIRS = m4 po $(libgc_dir) mono ikvm-native $(support_dir) data runtime scripts man samples tools msvc docs acceptance-tests llvm
24 all: update_submodules
26 SUBMODULE_ERROR='Could not recursively update all git submodules. You may experience compilation problems if some submodules are out of date'
27 update_submodules:
28         @$(srcdir)/scripts/update_submodules.sh
30 .PHONY: update_submodules
32 EXTRA_DIST= \
33         README.md               \
34         LICENSE                 \
35         autogen.sh              \
36         mkinstalldirs           \
37         mono-uninstalled.pc.in  \
38         winconfig.h             \
39         code_of_conduct.md      \
40         external                \
41         mcs/class/referencesource
43 DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false
45 # Distribute the 'mcs' tree too
46 GIT_DIR ?= $(srcdir)/.git
47 dist-hook:
48         test -d $(distdir)/mcs || mkdir $(distdir)/mcs
49         d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive
50         rm -rf `find $(top_distdir)/external -path '*\.git'`
51         rm -f `find $(top_distdir)/external -path '*\.exe' -not -path '*/roslyn-binaries/*'`
52         rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/*' -not -path '*/roslyn-binaries/*'`
54 pkgconfigdir = $(libdir)/pkgconfig
55 noinst_DATA = mono-uninstalled.pc
56 DISTCLEANFILES= mono-uninstalled.pc
58 # building with monolite
59 .PHONY: get-monolite-latest 
60 get-monolite-latest:
61         $(MAKE) -C $(mcs_topdir)/class get-monolite-latest
63 if BITCODE
64 BITCODE_CHECK=yes
65 endif
67 .PHONY: check-ci
68 check-ci:
69         MONO_LLVMONLY=$(BITCODE_CHECK) $(srcdir)/scripts/ci/run-test-$(TEST_PROFILE).sh
71 .PHONY: validate do-build-mono-mcs mcs-do-clean mcs-do-tests
72 validate: do-build-mono-mcs
73         $(MAKE) mcs-do-tests
74 do-build-mono-mcs: mcs-do-clean
75         $(MAKE) all
76 mcs-do-clean:
77         cd runtime && $(MAKE) clean-local
78         cd mono/tests && $(MAKE) clean
79 mcs-do-tests:
80         cd runtime && $(MAKE) check-local
81         cd mono/tests && $(MAKE) check
83 .PHONY: compiler-tests mcs-do-compiler-tests
84 compiler-tests:
85         $(MAKE) test_select='TEST_SUBDIRS="tests errors"' validate
86 mcs-do-compiler-tests:
87         $(MAKE) test_select='TEST_SUBDIRS="tests errors"' mcs-do-tests
89 .PHONY: bootstrap-world
90 bootstrap-world: compiler-tests
91         $(MAKE) install
93 if INSTALL_MONOTOUCH
94 monotouch-do-build: config.h
95         @list='$(MONOTOUCH_SUBDIRS)'; for subdir in $$list; do \
96           case "x$$subdir" in \
97                 xmono ) target="monotouch-do-build";; \
98                 * ) target="all";; \
99           esac; \
100           echo "Making $$target in $$subdir"; \
101           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
102         done;
103         (cd runtime && $(MAKE) $(AM_MAKEFLAGS) monotouch-do-build)
105 monotouch-do-clean:
106         @list='$(MONOTOUCH_SUBDIRS)'; for subdir in $$list; do \
107           case "x$$subdir" in \
108                 xmono ) target="monotouch-do-clean";; \
109                 * ) target="clean";; \
110           esac; \
111           echo "Making $$target in $$subdir"; \
112           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
113         done;
114         (cd runtime && $(MAKE) $(AM_MAKEFLAGS) monotouch-do-clean)
116 endif
118 update-csproj:
119         -rm msvc/scripts/order 
120         -rm msvc/scripts/order.xml
121         -rm -rf msvc/scripts/inputs
122         -mkdir msvc/scripts/inputs
123         (cd runtime; make V=1 extra_targets=csproj-local)
125 package-inputs:
126         echo '<?xml version="1.0" encoding="utf-8"?>' > msvc/scripts/order.xml
127         echo '<root>' >> msvc/scripts/order.xml
128         for i in `cat msvc/scripts/order`; do \
129                 set `echo $$i | sed -e 's/:/ /' -e 's/.input//'`; \
130                 cat msvc/scripts/inputs/$$2.input | sed -e 's/\\\\/\\/g' -e 's/\\/\\\\/g' | \
131                 (echo "    <project dir=\"$$1\" library=\"$$2\">"; \
132                  read boot;   echo "      <boot>$$boot</boot>"; \
133                  read flags;  echo "      <flags>$$flags</flags>"; \
134                  read output; echo "      <output>$$output</output>"; \
135                  read built;  echo "      <built_sources>`echo $$built | sed 's/\\\/\\\\/g'`</built_sources>"; \
136                  read libou;  echo "      <library_output>$$libou</library_output>"; \
137                  read fx_ver; echo "      <fx_version>$$fx_ver</fx_version>"; \
138                  read profile; echo "      <profile>$$profile</profile>"; \
139                  read resxt;  echo "      <resources>$$resxt</resources>"; \
140                  read resp;   echo "      <response>$$resp</response>"; \
141                  echo "    </project>") >> msvc/scripts/order.xml; \
142         done
143         echo "</root>" >> msvc/scripts/order.xml
145 # Update llvm version in configure.ac to the output of $LLVM_DIR/bin/llvm-config --version
146 update-llvm-version:
147         if test "x$$LLVM_DIR" = "x"; then echo "Set the make variable LLVM_DIR to the directory containing the LLVM installation."; exit 1; fi
148         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."
151 update-solution-files:
152         make update-csproj
153         make package-inputs
154         (cd msvc/scripts; make genproj.exe; mono genproj.exe $(GENPROJ_ARGS))
156 update-solution-files-with-tests:
157         make "GENPROJ_ARGS=2012 true true" update-solution-files