1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 include $(ADK_TOPDIR
)/rules.mk
8 include ${ADK_TOPDIR}/mk
/buildhlp.mk
10 BUILD_DIR_INITIAL
:= $(WRKBUILD
)-initial
11 BUILD_DIR_FINAL
:= $(WRKBUILD
)-final
15 ifeq ($(ADK_TARGET_ARCH_ARM
),y
)
17 ifeq ($(ADK_TARGET_SOFT_FLOAT
),y
)
18 LLVM_TRIPLE
:=arm-linux-eabi
20 ifeq ($(ADK_TARGET_HARD_FLOAT
),y
)
21 LLVM_TRIPLE
:=arm-linux-eabihf
25 $(BUILD_DIR_INITIAL
)/.configured
:
27 for file in cfe lld compiler-rt libcxx libcxxabi
; do \
28 if
[ ! -f
$${file}-$(LLVM_VERSION
).src.
tar.xz
]; then \
29 wget http
://llvm.org
/releases
/$(LLVM_VERSION
)/$${file}-$(LLVM_VERSION
).src.
tar.xz
; \
33 (cd
$(WRKBUILD
)/tools
&& tar xvf
$(DL_DIR
)/cfe-
$(LLVM_VERSION
).src.
tar.xz
&& mv cfe-
$(LLVM_VERSION
).src clang
)
34 (cd
$(WRKBUILD
)/tools
&& tar xvf
$(DL_DIR
)/lld-
$(LLVM_VERSION
).src.
tar.xz
&& mv lld-
$(LLVM_VERSION
).src lld
)
35 (cd
$(WRKBUILD
)/projects
&& tar xvf
$(DL_DIR
)/compiler-rt-
$(LLVM_VERSION
).src.
tar.xz
&& mv compiler-rt-
$(LLVM_VERSION
).src compiler-rt
)
36 (cd
$(WRKBUILD
)/projects
&& tar xvf
$(DL_DIR
)/libcxx-
$(LLVM_VERSION
).src.
tar.xz
&& mv libcxx-
$(LLVM_VERSION
).src libcxx
)
37 (cd
$(WRKBUILD
)/projects
&& tar xvf
$(DL_DIR
)/libcxxabi-
$(LLVM_VERSION
).src.
tar.xz
&& mv libcxxabi-
$(LLVM_VERSION
).src libcxxabi
)
38 mkdir
-p
$(BUILD_DIR_INITIAL
)
39 cd
$(BUILD_DIR_INITIAL
); \
41 cmake
-DCMAKE_BUILD_TYPE
=Release \
42 -DCMAKE_INSTALL_PREFIX
=$(TOOLCHAIN_DIR
)/usr \
43 -DCMAKE_CXX_FLAGS
="-std=c++11" \
45 -DLLVM_ENABLE_RTTI
=ON \
46 -DLLVM_DEFAULT_TARGET_TRIPLE
=$(LLVM_TRIPLE
) \
47 -DLLVM_TARGETS_TO_BUILD
=$(LLVM_TARGETS
) \
51 $(BUILD_DIR_INITIAL
)/.compiled
: $(BUILD_DIR_INITIAL
)/.configured
52 PATH
='$(TARGET_PATH)' \
53 $(MAKE
) -j
$(ADK_MAKE_JOBS
) -C
$(BUILD_DIR_INITIAL
) all
56 $(WRKBUILD
)/.configured
: $(BUILD_DIR_INITIAL
)/.compiled
57 PATH
='$(TARGET_PATH)' \
58 $(MAKE
) -j
$(ADK_MAKE_JOBS
) -C
$(BUILD_DIR_INITIAL
) install
61 $(WRKBUILD
)/.compiled
:
64 $(WRKBUILD
)/.installed
: $(WRKBUILD
)/.compiled
70 include ${ADK_TOPDIR}/mk
/toolchain.mk