Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor MPS Makefile to support separate build directories #62

Merged
merged 18 commits into from
Jun 11, 2024

Conversation

spernsteiner
Copy link
Contributor

@spernsteiner spernsteiner commented Jun 10, 2024

This branch refactors the MPS src/Makefile to put all generated files (except the final binary) in a build directory and to use separate build directories for separate configurations. For example, this allows for the following:

make CONFIG=self_test
make CONFIG=no_self_test TARGET=aarch64

This produces separate rts.self_test and rts.no_self_test.aarch64 binaries. Object files and other intermediate files are placed in separate build.self_test/ and build.self_test.aarch64/ directories, so they don't conflict and there's no need to make clean between the two builds.

If CONFIG and TARGET aren't specified, it's still possible to configure the build by specifying options directly:

make SENSORS=NotSimulated SELF_TEST=Enabled \
  CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++

This produces an unsuffixed rts binary and uses build/ for intermediate files.

Fixes #49

Checklist before requesting a review

  • I have performed a self-review of my code
  • My code matches the coding standards and I have ran the appropriate linters
  • I included documentation updates for my code
  • I extended the test suite and the tests run by the CI to cover my code
  • I assigned a Milestone to this PR
  • I assigned this PR to a Project
  • I assigned this PR appropriate Labels

@spernsteiner spernsteiner added infrastructure Build infrastructure and CI/CD application software application software components SoW TA2.1.1.A Develop the Open SUT primarily using existing components and specifications. labels Jun 10, 2024
@spernsteiner spernsteiner added this to the MVP 2 milestone Jun 10, 2024
@spernsteiner spernsteiner requested a review from podhrmic June 10, 2024 21:13
@spernsteiner
Copy link
Contributor Author

Turns out Ubuntu 22.04, which we use for CI, packages the correct verilator version for building MPS. This means we can install all the necessary dependencies via apt instead of using the HARDENS docker image, so we can get both the correct verilator and the aarch64 toolchain installed at the same time. I've updated the CI to build aarch64 binaries, which fixes #49.

@spernsteiner spernsteiner force-pushed the 49-mps-makefile-improvements branch from 97b6e12 to b2066fd Compare June 10, 2024 22:02
Copy link
Collaborator

@podhrmic podhrmic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@spernsteiner spernsteiner merged commit 6c05ebf into main Jun 11, 2024
5 checks passed
@spernsteiner spernsteiner deleted the 49-mps-makefile-improvements branch June 11, 2024 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
application software application software components infrastructure Build infrastructure and CI/CD SoW TA2.1.1.A Develop the Open SUT primarily using existing components and specifications.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compile MPS for arm64 in the CI
2 participants