-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.mk
82 lines (63 loc) · 2.33 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
# ===========================================================================
# Generic configuration options for building the RedisX library (both static
# and shared).
#
# You can include this snipplet in your Makefile also.
# ============================================================================
# Location under which the Smithsonian/xchange library is installed.
# (I.e., the root directory under which there is an include/ directory
# that contains xchange.h, and a lib/ or lib64/ directory that contains
# libxchange.so
XCHANGE ?= /usr
# Folders in which sources and header files are located, respectively
SRC ?= src
INC ?= include
# Folders for compiled objects, libraries, and binaries, respectively
OBJ ?= obj
LIB ?= lib
BIN ?= bin
# Compiler: use gcc by default
CC ?= gcc
# Add include/ directory
CPPFLAGS += -I$(INC)
# Base compiler options (if not defined externally...)
CFLAGS ?= -Os -Wall -std=c99
# Extra warnings (not supported on all compilers)
#CFLAGS += -Wextra
# Extra linker flags (if any)
#LDFLAGS=
# cppcheck options for 'check' target
CHECKOPTS ?= --enable=performance,warning,portability,style --language=c \
--error-exitcode=1 --std=c99 $(CHECKEXTRA)
CHECKOPTS += --template='{file}({line}): {severity} ({id}): {message}' --inline-suppr
# Exhaustive checking for newer cppcheck
#CHECKOPTS += --check-level=exhaustive
# Specific Doxygen to use if not the default one
#DOXYGEN ?= /opt/bin/doxygen
# ============================================================================
# END of user config section.
#
# Below are some generated constants based on the one that were set above
# ============================================================================
# Compiler and linker options etc.
ifeq ($(BUILD_MODE),debug)
CFLAGS += -g -DDEBUG
endif
# Link against math libs (for e.g. isnan()), and xchange dependency
LDFLAGS += -lm -lxchange
# Search for libraries under LIB
ifneq ($(findstring $(LIB),$(LD_LIBRARY_PATH)),$LIB)
LDFLAGS += -L$(LIB)
LD_LIBRARY_PATH := $(LIB):$(LD_LIBRARY_PATH)
endif
# Compile and link against a specific xchange library (if defined)
ifdef XCHANGE
CPPFLAGS += -I$(XCHANGE)/include
LDFLAGS += -L$(XCHANGE)/lib
LD_LIBRARY_PATH := $(XCHANGE)/lib:$(LD_LIBRARY_PATH)
endif
# Search for files in the designated locations
vpath %.h $(INC)
vpath %.c $(SRC)
vpath %.o $(OBJ)
vpath %.d dep