-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·129 lines (89 loc) · 2.19 KB
/
Makefile
File metadata and controls
executable file
·129 lines (89 loc) · 2.19 KB
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
##
# Makefile - general project commands
# Author: Michal Ľaš
# date: 16.01.2024
#
# DOXYGEN PATH
DOXYGEN=doc/doxygen
# AUTHOR NAME
LOGIN=xlasmi00
# PROJECT NAME
PROJECT=PQBlockchain
# EXECUTABLES NAMES
EX=./build/src/App/pqb
# REMOVE
RM=$(DOXYGEN)/html *.zip
# Temporary configuration folder
TMP=tmp
.PHONY: clean pack doc opendoc configure configureg compile run
all:
make configure
make compile
##################################################################
##
# SET UP
setup:
mkdir $(TMP)
mkdir build
##################################################################
##
# MAKE & RUN
configure:
cmake -DENABLE_DEBUG=OFF -S . -B build/
configureg:
cmake -DENABLE_DEBUG=ON -S . -B build/
compile:
make -C build/ -j12
run:
$(EX) $(ARGS)
##################################################################
##
# RUN TEST/ALLTESTS (has to ne -j1 because of Storage and Wallet tests)
test:
GTEST_COLOR=1 ctest -R $(ARGS) --test-dir build --output-on-failure -j1
testall:
GTEST_COLOR=1 ctest --test-dir build/tests --output-on-failure -j1
##################################################################
##
# Docker
# Create the docker image
dimagec:
docker build -t pqb_image .
# Delete the docker image
dimager:
docker rmi pqb_image
# Compose docker containers. Requires one argument and it is the .yaml file which docker-compose should use to compose containers
dcomposeup:
docker-compose -f $(ARGS) up --rm
# Delete created containers
drm:
docker rm -f $$(sudo docker ps -aq)
# Attach to docker image
datt:
docker attach node$(ARGS)
# Copy log file from container
dlog:
docker cp node$(ARGS):/PQB/tmp/log.txt .
##################################################################
##
# CLEAN
# Clean just temorary file creted by application
clean:
rm -rf $(TMP)/*
rm -rf $(RM)
# Clean whole build and all generated files
cleanall:
make clean
rm -rf build/*
##################################################################
##
# PACK
pack: clean
git archive --format=zip HEAD -o $(LOGIN)_$(PROJECT).zip
##################################################################
##
# MAKE DOCUMENTATION
doc:
doxygen $(DOXYGEN)/Doxyfile
opendoc: doc
firefox $(DOXYGEN)/html/index.html