added laba 5
This commit is contained in:
34
lab-5/build.sh
Executable file
34
lab-5/build.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/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}"
|
||||
Reference in New Issue
Block a user