-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
25 lines (19 loc) · 731 Bytes
/
build.sh
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
#!/bin/bash
# Arguments passed to the script
PROJECT=${1:-firmware.X}
CONFIGURATION=${2:-default}
echo "Building project $PROJECT with configuration $CONFIGURATION"
set -xe
# Generate project makefiles
echo "Generating makefiles for project $PROJECT with configuration $CONFIGURATION"
if ! /opt/mplabx/mplab_platform/bin/prjMakefilesGenerator.sh "$PROJECT@$CONFIGURATION"; then
echo "Error: Failed to generate makefiles for $PROJECT@$CONFIGURATION"
exit 1
fi
# Build the project using make
echo "Building project $PROJECT"
if ! make -C "$PROJECT" CONF="$CONFIGURATION" build; then
echo "Error: Build failed for project $PROJECT with configuration $CONFIGURATION"
exit 2
fi
echo "Build completed successfully"