-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.mk
137 lines (113 loc) · 3.28 KB
/
config.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# Directory to build in
BUILD_DIR := build/
# Binaries
EXECS := a b
# Available modules (subdirs in the root dir)
MODULES := mod1 mod2 debug cxx_mod
# Targets
# Warning: reserved phony targets:
# all showconf print clean purge cleanobj cleanmod cleandep cleanbin tidy
# format style
TARGETS := tdebug release
# Additional include dirs
INCLUDE_DIRS := -I./
# see next section
TARGET_EXECS := a b
TARGET_EXECS/tdebug := a
EXEC_MODULES//a := mod1
EXEC_MODULES//b := mod2 cxx_mod
EXEC_MODULES/release/a := mod1 debug
# Per target/exec/module configuration vars
#
# VAR/TARGET/EXEC/MODULE
# Note: VAR/, VAR/target/, VAR//exec/ etc. (trailing slash) are invalid.
# The trailing slash is used in all internal vars and functions.
#
# Note: Any variable already user-set (from the command line,
# included makefiles...) will overwrite the default.
#
# Example:
# CFLAGS/debug := -g
# CFLAGS///math := -O3
# CFLAGS/debug//math :=
# CFLAGS/testing//math := -O2
# More specific versions take precedence
# Using the above CFLAGS definitions:
# The 'debug' target will be compiled with $(CC) -g, except for
# the math module, which will compiled with $(CC)
# The math module will be compiled with $(CC) -O2 for the testing target
# The math module will be compiled with $(CC) -O3 in the rest of cases
#
# Note: to override an implicitly 'inherited' variable, just write an empty
# declaration. To explicitly 'inherit' a variable in a more specific version,
# just include it in the declaration:
# VAR/target//module := $(VAR/target) other_value
#
# The precedence rules are:
# First: VAR/TARGET/EXEC/MODULE
# VAR//EXEC/MODULE
# VAR/TARGET//MODULE
# VAR///MODULE
# (rules for Second)
# Second: VAR/TARGET/EXEC
# VAR//EXEC (rules for Third)
# Third: VAR/TARGET
# (rules for Fourth)
# Fourth: VAR
# TARGET_EXECS/t
# Execs to build for target t
# Default: $(EXECS)
# EXEC_MODULES/t/e
# Modules m needed to build exec e for target t
# Default: $(MODULES)
# INCLUDE_DIRS/t/e/m
# Additional include directories. Passed literally to the compiler
# Default: -I./
# CC/t/e/m
# What program to use to generate c objects
# Default: gcc
# CXX/t/e/m
# What program to use to generate cxx objects
# Default: g++
# CPP/t/e/m
# What program to use to preprocess c/cxx files
# Default: $(CC) -E
# CFLAGS/t/e/m CXXFLAGS/t/e/m CPPFLAGS/t/e/m
# flags for $(CC), $(CXX), $(CPP) respectively
# Defaults: none
# LINK/t/e
# What program to use to generate executable
# Default: $(CXX)
# called as $(LINK) $(LINKFLAGS_PRE) $^ $(LINKFLAGS_POST) -o $@
# LINKFLAGS_PRE/t/e
# LINKFLAGS_POST/t/e
# flags for $(LINK)
# Default: none
# AR/t/e/m
# What program to use to generate .a static libs
# Default: Make default
# ARFLAGS/t/e/m
# flags for $(AR)
# Default: rcs
# Additional
# C_EXTENSIONS
# Default: c
# C_INC_EXTENSIONS
# Default: h
# CXX_EXTENSIONS
# Default: cpp
# CXX_INC_EXTENSIONS
# Default: h hpp
# CLANG-TIDYFLAGS
# Default: -quiet
# Check for trailing slashes in TARGETS, MODULES and EXECS?
# (no checks could cause unknown behaviour)
# Set to any value to disable checks
# OM_NOCHECK := true
# Should we (not) echo commands
OM_NOECHO := true
# Should we use colors?
# requires `echo -e`, uses ANSI escape codes
OM_COLORS := true
# Should we show what a file depends on?
# OM_DETAILED_PRINT := true