add build run scripts

This commit is contained in:
awe
2026-04-10 14:10:28 +03:00
parent 6ea2653275
commit 120ffaa6f1
2 changed files with 63 additions and 0 deletions

32
build_main.sh Executable file
View 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"