-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompile.sh
More file actions
executable file
·47 lines (36 loc) · 1.22 KB
/
compile.sh
File metadata and controls
executable file
·47 lines (36 loc) · 1.22 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
#
# Copyright (C) 2021 Ilya Entin
#
SCRIPT_DIR=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)
echo "SCRIPT_DIR:" $SCRIPT_DIR
UP_DIR=$(dirname $SCRIPT_DIR)
echo "UP_DIR:" $UP_DIR
if [[ ( $@ == "--help") || $@ == "-h" ]]
then
echo "This script calls make with different parameters."
#echo "If build succeeds the clientX binary is copied to"
#echo "first 6 client directories."
echo "Usage: cd to the project root and run this script"
echo "with any combination of arguments or without arguments"
echo "compile.sh"
echo "CMPLR<g++ | clang++>"
echo "SANITIZE=<aul | thread>"
echo "OPTIMIZE=<-O0 | -O1 | -O2 | -O3>"
echo "GDWARF=<gdwarf-5 | gdwarf-4>"
echo "ENABLEPCH<1 | 0>"
echo "examples:"
echo "'./compile.sh GDWARF=-gdwarf-4 OPTIMIZE=-O0 SANITIZE=aul CMPLR=g++'"
echo "'./compile.sh'"
echo "Run 'make cleanall' if arguments changed since the last build."
echo "Start the server in the project root terminal: './server'"
echo "and each client in its terminal: './clientX' or './clientX > /dev/null'"
exit 0
fi
set -e
trap EXIT SIGHUP SIGINT SIGTERM
mkdir -p $UP_DIR/Fifos
NUMBER_CORES=$(nproc)
make -j$NUMBER_CORES $1 $2 $3 $4
date
wait