Files
CSE4303H1/compile.sh
Zheyuan Wu 6cc8ce61b3 add? update
2026-02-11 17:31:34 -06:00

29 lines
626 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
mkdir -p bin
# add libssl-dev if needed
# apt-get update && apt-get install -y --no-install-recommends libssl-dev
# Adjust flags as you like
CXXFLAGS="-std=c++17 -O2 -Wall -Wextra -pedantic"
OPENSSL_LIBS="-lssl -lcrypto"
g++ ${CXXFLAGS} server.cpp -o bin/server ${OPENSSL_LIBS}
g++ ${CXXFLAGS} client.cpp -o bin/client ${OPENSSL_LIBS}
echo "Built:"
file bin/server bin/client || true
chmod a+x bin/server bin/client
# clean up existing containers and networks
docker compose down
# start the containers
docker compose up -d server
docker compose run --rm -it client
echo "Done."