init
This commit is contained in:
30
compile.sh
Executable file
30
compile.sh
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/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 helper.cpp -o bin/server ${OPENSSL_LIBS}
|
||||
g++ ${CXXFLAGS} client.cpp helper.cpp -o bin/client ${OPENSSL_LIBS}
|
||||
|
||||
echo "Built:"
|
||||
file bin/server bin/client || true
|
||||
|
||||
chmod a+x bin/server bin/client
|
||||
|
||||
# stop the containers and free up network resources
|
||||
docker compose down --remove-orphans || true
|
||||
docker network rm net-hw4 >/dev/null 2>&1 || true
|
||||
|
||||
# start the containers
|
||||
docker compose up -d server
|
||||
docker compose run --rm -it client
|
||||
|
||||
echo "Done."
|
||||
Reference in New Issue
Block a user