forked from ArqTras/arqma-storage-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (56 loc) · 1.37 KB
/
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
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
SUB_DIR:=$(shell echo `uname | sed -e 's|[:/\\ \(\)]|_|g'`/`git branch | grep '\* ' | cut -f2- -d' '| sed -e 's|[:/\\ \(\)]|_|g'`)
ifeq ($(DEBUG),)
BUILD_TYPE := Release
else
BUILD_TYPE := Debug
endif
ifeq ($(USE_SINGLE_BUILD_DIR),)
BUILD_DIR := build/$(SUB_DIR)/$(BUILD_TYPE)
TOP_DIR := ../../../..
else
BUILD_DIR := build
TOP_DIR := ..
endif
ifeq ($(GEN),)
CMAKE := cmake
else
CMAKE := cmake -G$(GEN)
endif
BUILD_TESTS ?= ON
BUILD_STATIC ?= ON
MKDIR := mkdir -p $(BUILD_DIR) && cd $(BUILD_DIR)
all:
$(MKDIR) && \
$(CMAKE) \
-DBoost_USE_STATIC_LIBS=$(BUILD_STATIC) \
-DOPENSSL_USE_STATIC_LIBS=$(BUILD_STATIC) \
-DCMAKE_BUILD_TYPE=$(BUILD_TYPE) \
-DBUILD_TESTS=$(BUILD_TESTS) \
-DDISABLE_SNODE_SIGNATURE=OFF \
$(TOP_DIR) \
&& cmake --build .
integration-test:
$(MKDIR) && \
$(CMAKE) $(TOP_DIR) \
-DBoost_USE_STATIC_LIBS=$(BUILD_STATIC) \
-DOPENSSL_USE_STATIC_LIBS=$(BUILD_STATIC) \
-DCMAKE_BUILD_TYPE=$(BUILD_TYPE) \
-DBUILD_TESTS=$(BUILD_TESTS) \
-DINTEGRATION_TEST=ON \
&& cmake --build .
tests: all
./$(BUILD_DIR)/unit_test/Test --log_level=all
clean:
rm -rf build/$(SUB_DIR)
clean-all:
rm -rf build
format:
clang-format -style=file -i \
pow/**/*.{cpp,hpp} \
crypto/**/*.{cpp,hpp} \
storage/**/*.{cpp,hpp} \
utils/**/*.{cpp,hpp} \
httpserver/*.{cpp,h} \
unit_test/*.cpp \
common/**/*.{cpp,h}
.PHONY: all clean format rebuild