-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmk
More file actions
executable file
·133 lines (106 loc) · 2.83 KB
/
mk
File metadata and controls
executable file
·133 lines (106 loc) · 2.83 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
130
131
#!/usr/bin/env bash
#
# dpw@plaza.localdomain | 2024-12-13 03:28:43
#
#
set -eu
export root=`pwd`
export project=domainkeys
export port=9696
export verbose=''
export os="$(uname -s)"
export arch="$(uname -m)"
[ $os == "Linux" ] && {
# export CC=/usr/local/bin/gcc
# export CXX=/usr/local/bin/g++
export FLAGS="-j8"
} || {
export FLAGS="-j20"
}
# parse the cli
while [[ $# -gt 0 ]]
do
case $1 in
init)
[ -d build/_deps/ ] && {
mv build/_deps/ . && /bin/rm -fr build && mkdir build && mv _deps/ build/
} || {
mkdir build
}
(cd build && cmake ..)
shift
;;
build)
clear
(cd build && time make ${verbose} $FLAGS || exit 1)
shift
;;
unit|test)
# (cd build && time make $FLAGS)
$root/build/unit_tests
shift
;;
run)
(cd build && make $FLAGS)
$root/build/$project
shift
;;
run-data)
(cd build && make $FLAGS)
export TESTING=true
$root/build/data-tasks
shift
;;
format)
clang-format -i include/domainkeys/*.hpp src/*.cpp
git status -s
shift
;;
clean)
(cd build && make clean && /bin/rm -f datalogger-unit)
shift
;;
clo*)
/bin/rm -fr build/
shift
;;
watch)
watchexec -c -w src/ -w include/ -w tests/ -e h,hpp,cpp ./mk build unit
exit 0
;;
demo|exam*)
./build/examples/txkey -v
./build/examples/rtkey
./build/examples/rand-base62-key
./build/examples/decode_txkey 816xemoY3B8L
shift
;;
pull)
git pull
shift
;;
help)
echo "Targets:"
echo ""
echo " init : run the cmake command to create the build folder"
echo " build : compile cryptor to the build folder"
echo " unit : run the unit tests"
echo " format : runs clang-format over includes and src"
echo " watch : run watcher over source and include"
echo " pull : pull the latest repo changes"
echo " clean : remove binary builds but leave the build folder"
echo " clobber : remove the entire build folder"
echo " examples : run the exampes"
echo " help : show this help"
exit 0
;;
build)
cd src && pwd && make && make unit
shift
;;
*)
./mk help
exit 0
;;
esac
done