Skip to content

Commit

Permalink
Merge pull request #274 from ckormanyos/gnumake_builds_on_macos
Browse files Browse the repository at this point in the history
Fix #273 via GNUmake builds on macos
  • Loading branch information
ckormanyos authored Jul 30, 2022
2 parents 89c4c3a + 1e9eff6 commit 45e7a6d
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/real-time-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,34 @@ jobs:
make -j ref_app
ls -la ref_app.hex ref_app.s19 ref_app.map
working-directory: ./
target-arm-macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
suite: [ am335x, bcm2835_raspi_b, lpc11c24, stm32f100, stm32f407, stm32f429, stm32f446, stm32l100c, stm32l152 ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- name: clone-armmbed-homebrew-formulae-and-install
run: |
echo Install gcc-arm-none-eabi on MacOS via ArmMbed/homebrew-formulae
git clone -b master --depth 1 https://github.com/ARMmbed/homebrew-formulae.git ../ARMmbed-root
cd ../ARMmbed-root
brew tap ArmMbed/homebrew-formulae
brew install arm-none-eabi-gcc
working-directory: ./
- name: target-arm-macos-${{ matrix.suite }}
run: |
echo Install make via brew
brew install make
echo query the GNUmake version
gmake --version
echo Manually call GNUmake to build the target
gmake -f target/app/make/app_make_linux.gmk rebuild TGT=${{ matrix.suite }} MY_GMAKE=gmake
ls -la ./bin/ref_app.hex ./bin/ref_app.s19 ./bin/ref_app.map
working-directory: ./ref_app/
target-x86_64:
runs-on: ubuntu-20.04
steps:
Expand Down
45 changes: 45 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,51 @@ cd ref_app
./target/build/build.sh stm32f446 rebuild
```

### Example build on MacOS for `target stm32f446`

We will now exemplify how to build the reference application on a command shell
in MacOS for an ARM(R) target. Consider, for example, the build variant
`target stm32f446`. The NUCLEO-F446RE board from STMicroelectronics(R)
can conveniently be used for this.

Install `gcc-arm-none-eabi` if needed. In this case,
I have found it convenient to use
[ArmMbed/homebrew-formulae](https://github.com/ARMmbed/homebrew-formulae).
Follow the instructions there. Alternatively,
a modern `gcc-arm-none-eabi` for MacOS can be found at the
[Arm GNU Toolchain Downloads](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/downloads).

Clone or get the [ckormanyos/real-time-cpp](https://github.com/ckormanyos/real-time-cpp)
repository.

The default version 3.81 of GNUmake on MacOS, has been found
to be slightly incompatible with the make files used in this
repository. This was identified and corrected in
[issue 273](https://github.com/ckormanyos/real-time-cpp/issues/273).

In order to work around this, we need to install (via _brew_)
a newer version of GNUmake.
This installs a version of GNUmake called `gmake` in the path
and we will be using this `gmake` instead of the usual `make`.

```
brew install make
```

Query the `gmake` version with

```
gmake --version
```

Now build the target with a direct call to `gamke`.

```sh
cd real-time-cpp
cd ref_app
gmake -f target/app/make/app_make_linux.gmk rebuild TGT=stm32f446 MY_GMAKE=gmake
```

### Build with VisualStudio(R) Project and CMD Batch

To get started with the reference application on `Win*`
Expand Down
3 changes: 3 additions & 0 deletions ref_app/target/app/make/app_make_linux.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ MKDIR = mkdir
RM = rm
SED = sed

ifneq ($(MY_GMAKE),)
MAKE := $(MY_GMAKE)
endif

# ------------------------------------------------------------------------------
# the application
Expand Down

0 comments on commit 45e7a6d

Please sign in to comment.