Files
zigbee_weather_station/.gitea/workflows/sdcc.yml
Jose 5c43e31a24 chore 📦: Optimize SCCD build process for microcontrollers
- The changes made to the SCCD workflow configuration focus on optimizing the build process for microcontrollers by disabling unnecessary ports and setting the prefix path.
2025-02-23 12:29:58 +01:00

83 lines
3.1 KiB
YAML

name: SDCC Build for CC2530
on:
workflow_dispatch:
# push:
# branches:
# - main
# pull_request:
# branches:
# - main
jobs:
build:
runs-on: ubuntu-latest # Runs on the latest Ubuntu version available
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
github-server-url: ${{ vars.GIT_SERVER_URL }}
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libgmp-dev libmpfr-dev libncurses-dev git subversion bison flex libboost-graph-dev gcc python3
# - name: Clone SDCC repository
# run: |
# git clone https://github.com/sdcc-team/sdcc.git
# cd sdcc
- name: Checkout SDCC using SVN
run: |
# Use SVN to checkout SDCC at a specific revision
# svn co -r [rev] svn://svn.code.sf.net/p/sdcc/code/trunk/sdcc
svn co -r 9092 svn://svn.code.sf.net/p/sdcc/code/trunk/sdcc
- name: Modify incl.mk and Makefile.in
run: |
# Modify sdcc/device/lib/incl.mk to add the "huge" model
sed -i 's/MODELS = small medium large/MODELS = small large huge/' sdcc/device/lib/incl.mk
# Modify sdcc/device/lib/Makefile.in to add the "model-mcs51-stack-auto" target
sed -i 's/TARGETS += models small-mcs51-stack-auto/TARGETS += models model-mcs51-stack-auto/' sdcc/device/lib/Makefile.in
- name: Fix config.sub and config.guess for 8051
run: |
# Download config.sub and config.guess from a working version of the tools
wget https://git.savannah.gnu.org/cgit/config.git/plain/config.sub -O sdcc/config.sub
wget https://git.savannah.gnu.org/cgit/config.git/plain/config.guess -O sdcc/config.guess
- name: Build SDCC
run: |
cd sdcc
# Set CFLAGS to disable treating warnings as errors
export CFLAGS="$CFLAGS -Wno-error"
# ./configure --target=8051 --with-arch=8051 --prefix=/usr/local
./configure --disable-gbz80-port --disable-z80-port --disable-ds390-port --disable-ds400-port --disable-pic14-port --disable-pic16-port --disable-hc08-port --disable-r2k-port --disable-z180-port --disable-sdcdb --disable-ucsim --prefix=/usr/local
make
sudo make install
- name: Verify SDCC installation
run: |
sdcc --version # Verifies if SDCC was installed successfully
- name: Compile using Makefile
run: |
cd $GITHUB_WORKSPACE # Navigate to the root of your repo (where the Makefile is located)
make # Run the make command to build the project using the Makefile
# - name: Upload compiled hex file
# uses: actions/upload-artifact@v2
# with:
# name: cc2530-firmware
# path: output.ihx # Replace with the actual output file name if different (e.g., .ihx)
- name: Clean up compiled files
run: |
cd $GITHUB_WORKSPACE # Navigate back to the project directory
make clean # Run the 'make clean' command to delete the compiled files