[bcl] Update BCL Linked Size
[mono-project.git] / Makefile.am
blob0c69b39b4ae0621d1152a57f82b844b127adbb9d
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 if ENABLE_NETCORE
23 update_submodules = 
24 else
25 update_submodules = update_submodules
26 endif
28 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
29 # Keep in sync with SUBDIRS
30 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 netcore
32 all: $(update_submodules)
34 update_submodules:
35         @cd $(srcdir) && scripts/update_submodules.sh
37 .PHONY: update_submodules
39 EXTRA_DIST= \
40         README.md               \
41         LICENSE                 \
42         autogen.sh              \
43         mkinstalldirs           \
44         mono-uninstalled.pc.in  \
45         winconfig.h             \
46         code_of_conduct.md      \
47         external                \
48         mcs/class/referencesource
50 DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false
52 # Distribute the 'mcs' tree too
53 GIT_DIR ?= $(srcdir)/.git
54 dist-hook:
55         test -d $(distdir)/mcs || mkdir $(distdir)/mcs
56         d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive
57         rm -rf `find $(top_distdir)/external -path '*\.git'`
58         rm -rf `find $(top_distdir)/external -path '*\.libs'`
59         rm -rf `find $(top_distdir)/external -path '*\.deps'`
60         rm -f `find $(top_distdir)/external -path '*\.o'`
61         rm -f `find $(top_distdir)/external -path '*\.so'`
62         rm -f `find $(top_distdir)/external -path '*\.lo'`
63         rm -f `find $(top_distdir)/external -path '*\.Plo'`
64         rm -f `find $(top_distdir)/external -name '\.dirstamp'`
65         rm -f `find $(top_distdir)/external -path '*\.exe' -not -path '*/roslyn-binaries/*'`
66         rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/*' -not -path '*/roslyn-binaries/*' -not -path '*/helix-binaries/*'`
67         rm -rf "$(top_distdir)/external/linker/test"
69 pkgconfigdir = $(libdir)/pkgconfig
70 noinst_DATA = mono-uninstalled.pc
71 DISTCLEANFILES= mono-uninstalled.pc
73 # building with monolite
74 .PHONY: get-monolite-latest 
75 get-monolite-latest:
76         $(MAKE) -C $(mcs_topdir)/class get-monolite-latest
78 if BITCODE
79 BITCODE_CHECK=yes
80 endif
82 if DEFAULT_TESTS
83 CI_TEST_SCRIPT=$(srcdir)/scripts/ci/run-test-default.sh
84 else
85 CI_TEST_SCRIPT=$(srcdir)/scripts/ci/run-test-$(TEST_PROFILE).sh
86 endif
88 .PHONY: check-ci
89 check-ci:
90         MONO_LLVMONLY=$(BITCODE_CHECK) $(CI_TEST_SCRIPT)
92 .PHONY: validate do-build-mono-mcs mcs-do-clean mcs-do-tests
93 validate: do-build-mono-mcs
94         $(MAKE) mcs-do-tests
95 do-build-mono-mcs: mcs-do-clean
96         $(MAKE) all
97 mcs-do-clean:
98         cd runtime && $(MAKE) clean-local
99         cd mono/tests && $(MAKE) clean
100 mcs-do-tests:
101         cd runtime && $(MAKE) check-local
102         cd mono/tests && $(MAKE) check
104 .PHONY: compiler-tests mcs-do-compiler-tests
105 compiler-tests:
106         $(MAKE) test_select='TEST_SUBDIRS="tests errors"' validate
107 mcs-do-compiler-tests:
108         $(MAKE) test_select='TEST_SUBDIRS="tests errors"' mcs-do-tests
110 .PHONY: bootstrap-world
111 bootstrap-world: compiler-tests
112         $(MAKE) install
114 if INSTALL_MONOTOUCH
115 monotouch-do-build: config.h
116         @list='$(MONOTOUCH_SUBDIRS)'; for subdir in $$list; do \
117           case "x$$subdir" in \
118                 xmono ) target="monotouch-do-build";; \
119                 * ) target="all";; \
120           esac; \
121           echo "Making $$target in $$subdir"; \
122           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
123         done;
124         (cd runtime && $(MAKE) $(AM_MAKEFLAGS) monotouch-do-build)
126 monotouch-do-clean:
127         @list='$(MONOTOUCH_SUBDIRS)'; for subdir in $$list; do \
128           case "x$$subdir" in \
129                 xmono ) target="monotouch-do-clean";; \
130                 * ) target="clean";; \
131           esac; \
132           echo "Making $$target in $$subdir"; \
133           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
134         done;
135         (cd runtime && $(MAKE) $(AM_MAKEFLAGS) monotouch-do-clean)
137 endif
139 update-csproj:
140         -rm msvc/scripts/order 
141         -rm msvc/scripts/order.xml
142         -rm -rf msvc/scripts/inputs
143         -mkdir msvc/scripts/inputs
144         (cd runtime; $(MAKE) V=1 extra_targets=csproj-local)
146 package-inputs:
147         echo '<?xml version="1.0" encoding="utf-8"?>' > msvc/scripts/order.xml
148         echo '<root>' >> msvc/scripts/order.xml
149         for i in `cat msvc/scripts/order`; do \
150                 set `echo $$i | sed -e 's/:/ /' -e 's/.input//'`; \
151                 cat msvc/scripts/inputs/$$2.input | sed -e 's/\\\\/\\/g' -e 's/\\/\\\\/g' | \
152                 (echo "    <project dir=\"$$1\" library=\"$$2\">"; \
153                  read boot;   echo "      <boot>$$boot</boot>"; \
154                  read flags;  echo "      <flags>$$flags</flags>"; \
155                  read sources;echo "      <sources>$$sources</sources>"; \
156                  read output; echo "      <output>$$output</output>"; \
157                  read built;  echo "      <built_sources>`echo $$built | sed 's/\\\/\\\\/g'`</built_sources>"; \
158                  read libou;  echo "      <library_output>$$libou</library_output>"; \
159                  read fx_ver; echo "      <fx_version>$$fx_ver</fx_version>"; \
160                  read profile; echo "      <profile>$$profile</profile>"; \
161                  read resxt;  echo "      <resources>$$resxt</resources>"; \
162                  read resp;   echo "      <response>$$resp</response>"; \
163                  echo "    </project>") >> msvc/scripts/order.xml; \
164         done
165         echo "</root>" >> msvc/scripts/order.xml
167 # Update llvm version in configure.ac to the output of $LLVM_DIR/bin/llvm-config --version
168 update-llvm-version:
169         if test "x$$LLVM_DIR" = "x"; then echo "Set the make variable LLVM_DIR to the directory containing the LLVM installation."; exit 1; fi
170         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."
173 update-solution-files:
174         cd msvc/scripts && $(MAKE) genproj.exe || exit $$?;
175         $(MAKE) update-csproj
176         $(MAKE) package-inputs
177         (cd msvc/scripts; mono --debug genproj.exe $(GENPROJ_ARGS))
179 update-solution-files-with-tests:
180         $(MAKE) "GENPROJ_ARGS=2012 true true" update-solution-files