2 # Conditional submodule for llvm
4 # make reset-llvm will checkout a version of llvm which is suitable for this version of mono
5 # into $top_srcdir/llvm/llvm.
8 top_srcdir ?
= $(abspath
$(CURDIR
)/..
)
10 LLVM_PATH ?
= $(abspath
$(top_srcdir
)/external
/llvm
)
11 LLVM_BUILD ?
= $(abspath
$(top_srcdir
)/llvm
/build
)
12 LLVM_PREFIX ?
= $(abspath
$(top_srcdir
)/llvm
/usr
)
14 CMAKE
:= $(or
$(CMAKE
),$(shell which cmake
))
15 NINJA
:= $(shell which ninja
)
17 SUBMODULES_CONFIG_FILE
= $(top_srcdir
)/llvm
/SUBMODULES.json
18 include $(top_srcdir
)/scripts
/submodules
/versions.mk
20 $(eval
$(call ValidateVersionTemplate
,llvm
,LLVM
))
22 # Bump the given submodule to the revision given by the REV make variable
23 # If COMMIT is 1, commit the change
24 bump-llvm
: __bump-version-llvm
26 # Bump the given submodule to the branch given by the BRANCH/REMOTE_BRANCH make variables
27 # If COMMIT is 1, commit the change
28 bump-branch-llvm
: __bump-branch-llvm
30 # Bump the given submodule to its current GIT version
31 # If COMMIT is 1, commit the change
32 bump-current-llvm
: __bump-current-version-llvm
34 $(LLVM_BUILD
) $(LLVM_PREFIX
):
37 $(LLVM_PATH
)/CMakeLists.txt
: | reset-llvm
39 $(LLVM_BUILD
)/$(if
$(NINJA
),build.ninja
,Makefile
): $(LLVM_PATH
)/CMakeLists.txt |
$(LLVM_BUILD
)
40 cd
$(LLVM_BUILD
) && $(CMAKE
) \
41 $(if
$(NINJA
),-G Ninja
) \
42 -DCMAKE_INSTALL_PREFIX
="$(LLVM_PREFIX)" \
43 -DCMAKE_BUILD_TYPE
=Release \
44 -DLLVM_BUILD_TESTS
=Off \
45 -DLLVM_INCLUDE_TESTS
=Off \
46 -DLLVM_BUILD_EXAMPLES
=Off \
47 -DLLVM_INCLUDE_EXAMPLES
=Off \
48 -DLLVM_TOOLS_TO_BUILD
="opt;llc;llvm-config;llvm-dis" \
49 -DLLVM_TARGETS_TO_BUILD
="X86;ARM;AArch64" \
50 -DLLVM_ENABLE_ASSERTIONS
=$(if
$(INTERNAL_LLVM_ASSERTS
),On
,Off
) \
54 .PHONY
: configure-llvm
55 configure-llvm
: $(LLVM_BUILD
)/$(if
$(NINJA
),build.ninja
,Makefile
)
57 # The DESTDIR fix is to prevent the build from trying to install this out-of-build-tree
58 # as the DESTDIR hasn't been created when we're building mono
61 build-llvm
: configure-llvm
62 DESTDIR
="" $(if
$(NINJA
),$(NINJA
),$(MAKE
)) -C
$(LLVM_BUILD
)
65 install-llvm
: build-llvm |
$(LLVM_PREFIX
)
66 DESTDIR
="" $(if
$(NINJA
),$(NINJA
),$(MAKE
)) -C
$(LLVM_BUILD
) install
68 # FIXME: URL should be http://xamjenkinsartifact.blob.core.windows.net/build-package-osx-llvm-$(NEEDED_LLVM_BRANCH)/llvm-osx64-$(NEEDED_LLVM_VERSION).tar.gz
71 wget
--no-verbose
-O
- http
://xamjenkinsartifact.blob.core.windows.net
/build-package-osx-llvm-release60
/llvm-osx64-
$(NEEDED_LLVM_VERSION
).
tar.gz |
tar xzf
-
75 $(RM
) -r
$(LLVM_BUILD
) $(LLVM_PREFIX
)