-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlauncher.sh
More file actions
executable file
·41 lines (32 loc) · 876 Bytes
/
Copy pathlauncher.sh
File metadata and controls
executable file
·41 lines (32 loc) · 876 Bytes
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
#!/bin/sh
echo "Starting the build process for Game of Life..."
if ! command -v cmake > /dev/null 2>&1; then
echo "Error: cmake is not installed. Please install cmake and try again."
exit 1
fi
if ! command -v make > /dev/null 2>&1; then
echo "Error: make is not installed. Please install make and try again."
exit 1
fi
if [ -d "build" ]; then
echo "Cleaning up existing build directory..."
rm -rf build
fi
echo "Creating build directory..."
mkdir -p build && cd build
echo "Running cmake..."
if ! cmake ..; then
echo "Error: cmake configuration failed."
exit 1
fi
echo "Running make..."
if ! make; then
echo "Error: build failed."
exit 1
fi
echo "Running Game of Life with arguments: $@"
if ! ./GameOfLife "$@"; then
echo "Error: failed to run Game of Life."
exit 1
fi
echo "Build and execution completed successfully."