-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
31 lines (26 loc) · 854 Bytes
/
Makefile
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
MAKEFLAGS += --no-print-directory
LLVM_BIN_DIR = $(shell llvm-config --bindir)
LLVM_LIB_DIR = $(shell llvm-config --libdir)
LLVM_INCLUDE_DIR = $(shell llvm-config --includedir)
CUR_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
BUILD_DIR := ${CUR_DIR}/build
NPROC := 4
all: ${BUILD_DIR}
ifeq (,$(shell which llvm-config))
$(error No llvm-config found. Install llvm or set LLVM_ROOT.)
endif
@echo "info: building..";
@make -C${BUILD_DIR} -j${NPROC}
${BUILD_DIR}:
@echo "info: launching cmake.."
@mkdir -p ${BUILD_DIR}
@PATH=${LLVM_BIN_DIR}:${PATH} \
LLVM_ROOT_DIR=${LLVM_BIN_DIR} \
LLVM_LIBRARY_DIRS=${LLVM_LIB_DIR} \
LLVM_INCLUDE_DIRS=${LLVM_INCLUDE_DIR} \
CC=clang CXX=clang++ \
cmake -S. -B${BUILD_DIR} \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_FLAGS_DEBUG="-fno-rtti -fpic"
clean:
rm -rf ${BUILD_DIR}