Modify run-jenkins.sh to adapt wasm build for the OSX CI lane (#16785)
[mono-project.git] / Makefile.am
blobaefbc921c897448289f6d60877d6db8c546e8fb8
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 netcore/corerun
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         netcore/Makefile        \
50         mcs/class/referencesource
52 DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_RUNTIME=false
54 # Distribute the 'mcs' tree too
55 GIT_DIR ?= $(srcdir)/.git
56 dist-hook:
57         test -d $(distdir)/mcs || mkdir $(distdir)/mcs
58         d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive
59         rm -rf `find $(top_distdir)/external -path '*\.git'`
60         rm -rf `find $(top_distdir)/external -path '*\.libs'`
61         rm -rf `find $(top_distdir)/external -path '*\.deps'`
62         rm -f `find $(top_distdir)/external -path '*\.o'`
63         rm -f `find $(top_distdir)/external -path '*\.so'`
64         rm -f `find $(top_distdir)/external -path '*\.lo'`
65         rm -f `find $(top_distdir)/external -path '*\.Plo'`
66         rm -f `find $(top_distdir)/external -name '\.dirstamp'`
67         rm -f `find $(top_distdir)/external -path '*\.exe' -not -path '*/roslyn-binaries/*'`
68         rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/*' -not -path '*/roslyn-binaries/*' -not -path '*/helix-binaries/*'`
69         rm -rf "$(top_distdir)/external/linker/test"
71 pkgconfigdir = $(libdir)/pkgconfig
72 noinst_DATA = mono-uninstalled.pc
73 DISTCLEANFILES= mono-uninstalled.pc
75 # building with monolite
76 .PHONY: get-monolite-latest 
77 get-monolite-latest:
78         $(MAKE) -C $(mcs_topdir)/class get-monolite-latest
80 if BITCODE
81 BITCODE_CHECK=yes
82 endif
84 if DEFAULT_TESTS
85 CI_TEST_SCRIPT=$(srcdir)/scripts/ci/run-test-default.sh
86 else
87 CI_TEST_SCRIPT=$(srcdir)/scripts/ci/run-test-$(TEST_PROFILE).sh
88 endif
90 .PHONY: check-ci
91 check-ci:
92         MONO_LLVMONLY=$(BITCODE_CHECK) $(CI_TEST_SCRIPT)
94 .PHONY: validate do-build-mono-mcs mcs-do-clean mcs-do-tests
95 validate: do-build-mono-mcs
96         $(MAKE) mcs-do-tests
97 do-build-mono-mcs: mcs-do-clean
98         $(MAKE) all
99 mcs-do-clean:
100         cd runtime && $(MAKE) clean-local
101         cd mono/tests && $(MAKE) clean
102 mcs-do-tests:
103         cd runtime && $(MAKE) check-local
104         cd mono/tests && $(MAKE) check
106 .PHONY: compiler-tests mcs-do-compiler-tests
107 compiler-tests:
108         $(MAKE) test_select='TEST_SUBDIRS="tests errors"' validate
109 mcs-do-compiler-tests:
110         $(MAKE) test_select='TEST_SUBDIRS="tests errors"' mcs-do-tests
112 .PHONY: bootstrap-world
113 bootstrap-world: compiler-tests
114         $(MAKE) install
116 if INSTALL_MONOTOUCH
117 monotouch-do-build: config.h
118         @list='$(MONOTOUCH_SUBDIRS)'; for subdir in $$list; do \
119           case "x$$subdir" in \
120                 xmono ) target="monotouch-do-build";; \
121                 * ) target="all";; \
122           esac; \
123           echo "Making $$target in $$subdir"; \
124           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
125         done;
126         (cd runtime && $(MAKE) $(AM_MAKEFLAGS) monotouch-do-build)
128 monotouch-do-clean:
129         @list='$(MONOTOUCH_SUBDIRS)'; for subdir in $$list; do \
130           case "x$$subdir" in \
131                 xmono ) target="monotouch-do-clean";; \
132                 * ) target="clean";; \
133           esac; \
134           echo "Making $$target in $$subdir"; \
135           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
136         done;
137         (cd runtime && $(MAKE) $(AM_MAKEFLAGS) monotouch-do-clean)
139 endif
141 update-csproj:
142         -rm msvc/scripts/order 
143         -rm msvc/scripts/order.xml
144         -rm -rf msvc/scripts/inputs
145         -mkdir msvc/scripts/inputs
146         (cd runtime; $(MAKE) V=1 extra_targets=csproj-local)
148 package-inputs:
149         echo '<?xml version="1.0" encoding="utf-8"?>' > msvc/scripts/order.xml
150         echo '<root>' >> msvc/scripts/order.xml
151         for i in `cat msvc/scripts/order`; do \
152                 set `echo $$i | sed -e 's/:/ /' -e 's/.input//'`; \
153                 cat msvc/scripts/inputs/$$2.input | sed -e 's/\\\\/\\/g' -e 's/\\/\\\\/g' | \
154                 (echo "    <project dir=\"$$1\" library=\"$$2\">"; \
155                  read boot;   echo "      <boot>$$boot</boot>"; \
156                  read flags;  echo "      <flags>$$flags</flags>"; \
157                  read sources;echo "      <sources>$$sources</sources>"; \
158                  read output; echo "      <output>$$output</output>"; \
159                  read built;  echo "      <built_sources>`echo $$built | sed 's/\\\/\\\\/g'`</built_sources>"; \
160                  read libou;  echo "      <library_output>$$libou</library_output>"; \
161                  read fx_ver; echo "      <fx_version>$$fx_ver</fx_version>"; \
162                  read profile; echo "      <profile>$$profile</profile>"; \
163                  read resxt;  echo "      <resources>$$resxt</resources>"; \
164                  read resp;   echo "      <response>$$resp</response>"; \
165                  echo "    </project>") >> msvc/scripts/order.xml; \
166         done
167         echo "</root>" >> msvc/scripts/order.xml
169 # Update llvm version in configure.ac to the output of $LLVM_DIR/bin/llvm-config --version
170 update-llvm-version:
171         if test "x$$LLVM_DIR" = "x"; then echo "Set the make variable LLVM_DIR to the directory containing the LLVM installation."; exit 1; fi
172         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."
175 update-solution-files:
176         cd msvc/scripts && $(MAKE) genproj.exe || exit $$?;
177         $(MAKE) update-csproj
178         $(MAKE) package-inputs
179         (cd msvc/scripts; mono --debug genproj.exe $(GENPROJ_ARGS))
181 update-solution-files-with-tests:
182         $(MAKE) "GENPROJ_ARGS=2012 true true" update-solution-files