-
Notifications
You must be signed in to change notification settings - Fork 23
/
buildconfig.mk
87 lines (72 loc) · 2.1 KB
/
buildconfig.mk
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Default configuration for project Makefile.
#
# If you wish to modify configuration in this file just for your local builds,
# it is recommended to create `buildconfig.user.mk` file and put your overrides
# there.
#
# You can also set configuration variable through make command line arguments.
#--------------------------------------------------------------------------------
# Base directory for all build outputs.
CFG_BUILD_DIR = build/${CFG_BUILD_TYPE}/
PREFIX ?= /usr/local
DESTDIR ?=
CFG_OUT_DIR := $(DESTDIR)$(PREFIX)/
# Install directory for python
PYTHON_PREFIX := $(shell /usr/bin/env python3 -c "import site; print(site.getsitepackages()[-1]);")
ifneq ($(PREFIX),/usr/local)
PYTHON_PREFIX := $(PREFIX)
endif
# Basic build tools
CC ?= cc
CXX ?= c++
LD ?=
CFLAGS ?=
CXXFLAGS ?=
LDFLAGS ?=
LDLIBS ?=
#--------------------------------------------------------------------------------
-include ${TOP_DIR}buildconfig.user.mk
#--------------------------------------------------------------------------------
# Define constants with special characters.
# Variable name conventions:
# C.* : raw character string
# New line
override define C.NL :=
endef
override C.EMPTY :=
# Space
override C.SP := ${C.EMPTY} ${C.EMPTY}
# Colon
override C.DC := ${C.EMPTY}:${C.EMPTY}
# Single quote
override C.QUOT := '
# ' # THIS whole line is a comment fixing syntax highlighting in some editors.
#--------------------------------------------------------------------------------
# Define constants for output formatting. Empty when not outputting to a TTY.
# Variable name conventions:
# F.* : raw control sequence string
# F.x : enable x
# F.!x : disable x
ifdef MAKE_TERMOUT
override csi := $(shell printf '\x1b[')
# Resets all formatting options
override F.RST := ${csi}0m
# Bold
override F.B := ${csi}22;1m
override F.!B := ${csi}22m
# Italic
override F.I := ${csi}3m
override F.!I := ${csi}23m
# Dim
override F.D := ${csi}2m
override F.!D := ${csi}22m
override undefine csi
else
override F.RST :=
override F.B :=
override F.!B :=
override F.I :=
override F.!I :=
override F.D :=
override F.!D :=
endif