Skip to content

Commit

Permalink
build: support MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Aug 7, 2024
1 parent ea87f6d commit b474e26
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/CI_build_macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI Build MacOS

on: [push, pull_request]

jobs:
build:
runs-on: macos-latest

steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Build CI
run: |
make arm_sdk_install
make -j8
make bootloaders -j8
- name: Archive build
uses: actions/upload-artifact@v3
with:
name: AM32-binaries
path: |
obj/*.hex
retention-days: 7
15 changes: 15 additions & 0 deletions make/tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,21 @@ MKDIR:=tools\\windows\\make\\bin\\mkdir
RM:=tools\\windows\\make\\bin\\rm
CUT:=tools\\windows\\make\\bin\\cut
FGREP:=tools\\windows\\make\\bin\\fgrep

else
# MacOS and Linux
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
ARM_SDK_PREFIX:=tools/macos/xpack-arm-none-eabi-gcc-10.3.1-2.3/bin/arm-none-eabi-
CP:=cp
DSEP:=/
NUL:=/dev/null
MKDIR:=mkdir
RM:=rm
CUT:=cut
FGREP:=fgrep
else
# assume Linux
ARM_SDK_PREFIX:=tools/linux/xpack-arm-none-eabi-gcc-10.3.1-2.3/bin/arm-none-eabi-
CP:=cp
DSEP:=/
Expand All @@ -25,6 +39,7 @@ RM:=rm
CUT:=cut
FGREP:=fgrep
endif
endif

# workaround for lack of a lowercase function in GNU make
# look away before this sends you blind ....
Expand Down
14 changes: 14 additions & 0 deletions make/tools_install.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# download location for tools
WINDOWS_TOOLS=https://firmware.ardupilot.org/Tools/AM32-tools/windows-tools.zip
LINUX_TOOLS=https://firmware.ardupilot.org/Tools/AM32-tools/linux-tools.tar.gz
MACOS_TOOLS=https://firmware.ardupilot.org/Tools/AM32-tools/macos-tools.tar.gz

ifeq ($(OS),Windows_NT)

Expand All @@ -14,6 +15,18 @@ arm_sdk_install:
@powershell -Command "Expand-Archive -Path windows-tools.zip -Force -DestinationPath ."
@echo windows tools install done

else
# MacOS and Linux
UNAME_S := $(shell uname -s)

ifeq ($(UNAME_S),Darwin)

arm_sdk_install:
@echo Installing macos tools
@wget $(MACOS_TOOLS)
@tar xzf macos-tools.tar.gz
@echo macos tools install done

else

arm_sdk_install:
Expand All @@ -23,3 +36,4 @@ arm_sdk_install:
@echo linux tools install done

endif
endif

0 comments on commit b474e26

Please sign in to comment.