-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.llvm
63 lines (49 loc) · 1.82 KB
/
Makefile.llvm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
include config/base.config
#### llvm
LLVMVER = 18.1.8
LLVMSRC = llvm-project-${LLVMVER}.src
LLVMDIR = ${LLVMSRC}
LLVMTAR = ${LLVMDIR}.tar.xz
LLVM_INST_PATH = ${NLYTIQ_INST_PATH}
ifeq (${OS},Darwin)
CMAKE_BIN = ${NLYTIQ_INST_PATH}/bin/cmake
else
CMAKE_BIN = $(shell which cmake)
endif
# gcc-9 and later currently fail on build (in Ubuntu 20.04), so use gcc-8 for the moment
GCC = gcc
GXX = g++
CMAKE_CMD = CC=${GCC} CXX=${GXX} ${CMAKE_BIN} -G "Unix Makefiles" \
-DCMAKE_INSTALL_PREFIX:STRING=${NLYTIQ_INST_PATH} \
-DLLVM_PARALLEL_COMPILE_JOBS:STRING=${NCPU} \
-DLLVM_PARALLEL_LINK_JOBS:STRING=${NCPU} \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lldb;compiler-rt;polly;openmp;libcxx;libcxxabi;libunwind;flang;libclc;libcxxabi;lld"
# -DLLVM_ENABLE_CXX1Y:BOOL=On -DLLVM_ENABLE_LTO:BOOL=Off \
# -DLLVM_PARALLEL_COMPILE_JOBS:STRING=${NCPU} \
# -DLLVM_PARALLEL_LINK_JOBS:STRING=${NCPU} \
# -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \
# -DLLVM_TARGETS_TO_BUILD:STRING="host" \
# -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
# -DLLVM_ENABLE_PROJECTS='clang,clang-tools-extra,lldb,compiler-rt,polly'
BUILDDIR = ${LLVMDIR}/build
#--------------------------------------------------------------------------#
all: install-llvm
clean: clean-llvm
configure-llvm:
tar -Jxf sources/${LLVMTAR}
mkdir -p ${BUILDDIR}
touch configure-llvm
make-llvm: configure-llvm
cd ${BUILDDIR} ; ${CMAKE_CMD} ../llvm
cd ${BUILDDIR} ; make -j${NCPU}
touch make-llvm
install-llvm: make-llvm
cd ${BUILDDIR} ; make -j${NCPU} install
ifeq ($(OS),Linux)
#echo "${NLYTIQ_INST_PATH}/lib" > /etc/ld.so.conf.d/nlytiq.conf
#ldconfig
endif
touch install-llvm
clean-llvm:
rm -rf ${LLVMDIR} make-llvm install-llvm configure-llvm ${BUILDDIR}