-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_cmake.sh
More file actions
executable file
·39 lines (29 loc) · 849 Bytes
/
Copy pathbuild_cmake.sh
File metadata and controls
executable file
·39 lines (29 loc) · 849 Bytes
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
#!/bin/bash
. bash/shared/default.sh # source bash colors / defaults.
BUILD_DIR='build'
BIN_DIR='bin'
BIN_NAME='datanamesorcery'
INPUT_DIR='input_sample'
HOSTS_FILE='host' # Hosts to scan (Scan targets)
DNS_FILE='target' # DNS servers for testing (Not the scan targets)
configure() {
print_status "Create build directories and config cmake"
mkdir -p ${BUILD_DIR}
cmake -S . -B ${BUILD_DIR} --fresh -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
}
build() {
print_status "Building project..."
cmake --build ${BUILD_DIR} --clean-first --target all -- -j$(nproc) --debug
}
print_info() {
print_status "INFO:"
print_status "$BIN_DIR/$BIN_NAME --man"
printf '\n'
}
main() {
check_workdir # verify the workdir by bash/shared/default.sh check_workdir as defined by WORKDIR_NAME=
./clean_cmake.sh
configure
build
}
main