forked from userver-framework/userver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.variables
60 lines (54 loc) · 1.78 KB
/
Makefile.variables
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
KERNEL := $(shell uname -s)
ifeq ($(KERNEL),Darwin)
-include Makefile.macos
-include userver/Makefile.macos
endif
# CMAKE_OPTS is publicly available and can be specified on command line.
# In this case it will override all modifications we're trying to apply here.
# Cannot use `override` here as we need to pass values to sub-makes.
# Copy the original value to our own variable and work with it instead.
export CMAKE_OPTS_INTERNAL ?= $(CMAKE_OPTS)
LTO_CACHE_FOLDER ?= $(HOME)/.ltocache
ifneq ($(LTO_CACHE_FOLDER),)
ifeq ($(findstring LTO_CACHE_FOLDER=,$(CMAKE_OPTS_INTERNAL)),)
CMAKE_OPTS_INTERNAL += -DLTO_CACHE_FOLDER=$(LTO_CACHE_FOLDER)
endif
endif
BUILD_TYPE ?= Debug
BUILD_DIR ?= build
DOCS_DIR ?= docs
CMAKE_DIR = $(CURDIR)
ifeq ($(origin CC),default)
CC := clang-9
endif
ifeq ($(origin CXX),default)
CXX := clang++-9
endif
export CC CXX
SCAN_BUILD = scan-build-9
SCAN_BUILD_OPTS = --force-analyze-debug-code --show-description --use-cc $(CC) --use-c++ $(CXX) -stats -o $(PWD)/static-analyzer-report/
BUILD_CHECK_DIR ?= build-check
PYTHON3_BIN_DIR = $(wildcard /usr/lib/yandex/taxi-py3-2/bin/)
CLANG_TIDY_BINARY ?= clang-tidy-9
CHANGED_DIRS ?= $(CMAKE_DIR)
TEAMCITY_LINT_JOBS_COUNT ?= 10
FORMATTERS = black eolfmt jsonfmt yamlfmt
ifeq ($(CXX),clang++-9)
ifeq ($(shell which llvm-symbolizer),)
export ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-9/bin/llvm-symbolizer
export UBSAN_SYMBOLIZER_PATH=/usr/lib/llvm-9/bin/llvm-symbolizer
endif
endif
export UBSAN_OPTIONS=print_stacktrace=1
ASAN_OPTIONS=detect_odr_violation=2
ifndef NPROCS
ifeq ($(KERNEL),Linux)
NPROCS := $(shell nproc --all)
else ifeq ($(KERNEL),Darwin)
NPROCS := $(shell sysctl -n hw.ncpu)
else
$(warning Cannot determine CPU count for $(KERNEL), falling back to 1)
NPROCS := 1
endif
endif # NPROCS
export NPROCS