Files
labs/lab-5/build.sh
2026-10-20 09:14:16 +03:00

35 lines
623 B
Bash
Executable File

#!/bin/bash
# Build script for my_project
set -e
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Default build type
BUILD_TYPE="${1:-Debug}"
echo -e "${YELLOW}Building my_project (${BUILD_TYPE})...${NC}"
# Create build directory if it doesn't exist
if [ ! -d "build" ]; then
echo -e "${YELLOW}Creating build directory...${NC}"
mkdir -p build
fi
cd build
# Configure
echo -e "${YELLOW}Configuring CMake...${NC}"
cmake -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" ..
# Build
echo -e "${YELLOW}Compiling...${NC}"
make
echo -e "${GREEN}✓ Build completed successfully!${NC}"