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