add build run scripts
This commit is contained in:
32
build_main.sh
Executable file
32
build_main.sh
Executable file
@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
cd "$SCRIPT_DIR"
|
||||
|
||||
CXX="${CXX:-g++}"
|
||||
OUT="${OUT:-main.exe}"
|
||||
|
||||
CXXFLAGS=(
|
||||
-std=c++17
|
||||
-O2
|
||||
-Wall
|
||||
-Wextra
|
||||
-pedantic
|
||||
)
|
||||
|
||||
SOURCES=(
|
||||
main.cpp
|
||||
capture_file_writer.cpp
|
||||
tty_protocol_writer.cpp
|
||||
)
|
||||
|
||||
LDFLAGS=(
|
||||
-ldl
|
||||
-lutil
|
||||
-lpthread
|
||||
)
|
||||
|
||||
"$CXX" "${CXXFLAGS[@]}" "${SOURCES[@]}" "${LDFLAGS[@]}" -o "$OUT"
|
||||
|
||||
echo "Built $OUT"
|
||||
Reference in New Issue
Block a user