forked from rodrigoperdona/desafio-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
executable file
·27 lines (23 loc) · 1012 Bytes
/
build
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
#!/bin/bash
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd "${parent_path}"
function configure
{
[ ! -d ".build" ] && command mkdir $1 && cd $1 && cmake ..
[ -d ".build" ] && cd $1 && cmake ..
}
if [ "$1" == "--docker-build" ]; then
docker build -t focalle-environment:build .
elif [ "$1" == "--docker-run" ]; then
docker run -itd --rm -v ${PWD}:/focalle --name=focalle-build focalle-environment:build
elif [ "$1" == "--docker-stop" ]; then
docker rm -f focalle-build
elif [ "$1" == "--build" ]; then
configure .build
make && make install
cd ..
strip -S --strip-unneeded --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag output/client/Client
strip -S --strip-unneeded --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag output/server/Server
elif [ "$1" == "" ]; then
docker exec -it focalle-build /bin/bash -c "/focalle/build --build"
fi