28 lines
550 B
Bash
Executable File
28 lines
550 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Exit immediately if a command exits with a non-zero status
|
|
set -e
|
|
|
|
# Configurations
|
|
BUILD_DIR="build"
|
|
echo "=== Starting Build Process ==="
|
|
|
|
# Clean existing build
|
|
if [ -d "$BUILD_DIR" ]; then
|
|
echo "Removing existing build directory..."
|
|
rm -rf "$BUILD_DIR"
|
|
fi
|
|
|
|
# Create build directory
|
|
echo "Creating build directory..."
|
|
mkdir -p "$BUILD_DIR"
|
|
cd "$BUILD_DIR"
|
|
|
|
# Build the project
|
|
echo "Building project..."
|
|
cmake ..
|
|
make -j$(nproc)
|
|
|
|
echo ""
|
|
echo "✓ Build Successful"
|
|
echo "Run the code with: ./build/<api_name>/<api_name>_c" |