-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #294 from pret/makefile
Collapse shell scripts into a Makefile; update INSTALL and CONTRIBUTING docs
- Loading branch information
Showing
8 changed files
with
454 additions
and
273 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,74 @@ | ||
# Contributing to pret/pokeplatinum | ||
|
||
<!--toc:start--> | ||
- [My Build is Failing After Merging from Main](#my-build-is-failing-after-merging-from-main) | ||
- [Editor Enhancements](#editor-enhancements) | ||
- [Code Formatting](#code-formatting) | ||
- [Contributing to pret/pokeplatinum](#contributing-to-pretpokeplatinum) | ||
- [Preliminaries](#preliminaries) | ||
- [Editor Enhancements](#editor-enhancements) | ||
- [Code Formatting](#code-formatting) | ||
<!--toc:end--> | ||
|
||
This document provides a synopsis and loose guidelines for how to contribute to this project. It is a work in progress. Maintainers should expand this document. | ||
This document provides a synopsis and loose guidelines for how to contribute to | ||
this project. It is a work in progress. Maintainers should expand this document. | ||
|
||
## My Build is Failing After Merging from Main | ||
## Preliminaries | ||
|
||
It is likely that your subprojects are out of date; update them with the following command and re-build: | ||
We contribute using a fork-model rather than committing branches directly to the | ||
repository. Please make a fork before starting work on your contribution. | ||
|
||
``` | ||
meson subprojects update | ||
Any and all pull requests to the repository *must* produce a ROM which matches | ||
`sha1: ce81046eda7d232513069519cb2085349896dec7` by default. To verify this | ||
locally, a `check` target is included in the `Makefile`: | ||
|
||
```bash | ||
make check | ||
``` | ||
|
||
## Editor Enhancements | ||
This target is run automatically as part of the default `make` command defined | ||
in the provided `Makefile`. | ||
|
||
> [!IMPORTANT] | ||
> If your pull request does not produce a matching ROM, then it will not be | ||
> considered for merge until it has been updated to do so. | ||
This repository includes a script to generate a `compile_commands.json` that is compatible with C language servers such as `clangd`. | ||
## Editor Enhancements | ||
|
||
### Requirements | ||
This repository includes a script to generate a `compile_commands.json` that is | ||
compatible with C language servers such as `clangd`. | ||
|
||
The following dependencies are required: | ||
|
||
- `python3.8` or newer | ||
- `gcc-arm-none-eabi` | ||
- `clangd` | ||
|
||
### Usage | ||
To run the script: | ||
|
||
```bash | ||
./gen_compile_commands.py | ||
``` | ||
|
||
This will create a file named `compile_commands.json` in the project root, overwriting the previous copy. | ||
This will create a file named `compile_commands.json` in the project root, | ||
overwriting any previous copy. | ||
|
||
## Code Formatting | ||
|
||
This repository includes an opinionated `clang-format` specification to ensure that we maintain a common code style. For convenience, a pre-commit hook is also provided in `.githooks` which will run `clang-format` against any staged changes prior to executing a commit. | ||
|
||
### Requirements | ||
This repository includes an opinionated `clang-format` specification to ensure that | ||
we maintain a common code style. For convenience, a pre-commit hook is also | ||
provided in `.githooks` which will run `clang-format` against any staged changes | ||
prior to executing a commit. | ||
|
||
- `clang-format@17` or newer | ||
The following dependencies are required: | ||
|
||
### Usage | ||
- `clang-format@18` or newer | ||
|
||
To set up the pre-commit hook: | ||
|
||
```sh | ||
```bash | ||
git config --local core.hooksPath .githooks/ | ||
``` | ||
|
||
To run the formatter on the full source tree: | ||
|
||
```bash | ||
./format.sh | ||
make format | ||
``` | ||
|
Oops, something went wrong.