Default to release + check; add GDB setup to INSTALL.md

This commit is contained in:
Rachel 2024-11-01 20:46:35 -07:00 committed by mid-kid
parent 7387d13b35
commit d8040bf93d
2 changed files with 29 additions and 8 deletions

View File

@ -17,6 +17,7 @@
- [Windows (including WSL 1)](#windows-including-wsl-1)
- [Unix Systems](#unix-systems)
- [4. Building the Repository](#4-building-the-repository)
- [5. Debugger Support](#5-debugger-support)
<!--toc:end-->
This document details the steps necessary to build a copy of Pokémon Platinum
@ -347,3 +348,21 @@ If everything works, then the following ROM should be built:
If you need further assistance, feel free to ask a question in the `#pokeplatinum`
channel of the `pret` Discord (see `README.md` for contact information) or [open
an issue](https://github.com/pret/pokeplatinum/issues/new).
## 5. Debugger Support
This step is optional, but useful. `pokeplatinum` ships with support for GDB
debugging and a target to build a debug-enabled ROM:
```bash
make debug
```
For convenience, a template `launch.json` configuration for VS Code is provided
in the `.vscode` folder of the repository.
Due to the nature of the Nintendo DS, use of standard builds of GDB for debugging
is insufficient. A fork of `binutils-gdb` which supports the overlay system
employed by the console is available [here](https://github.com/joshua-smith-12/binutils-gdb-nds).
For installation instructions, refer to [the `README.md`](https://github.com/joshua-smith-12/binutils-gdb-nds/blob/master/README.md).

View File

@ -69,25 +69,27 @@ ROOT := $(CWD)
NINJA_STATUS := "[%p %f/%t] "
all: release check
release: setup_release rom
debug: setup_debug rom
NINJA_STATUS=$(NINJA_STATUS) $(MESON) compile -C $(POKEPLATINUM_BUILD) "debug.nef" "overlay.map"
@NINJA_STATUS=$(NINJA_STATUS) $(MESON) compile -C $(POKEPLATINUM_BUILD) "debug.nef" "overlay.map"
setup_release:
$(MESON) configure build "-Dgdb_debugging=false"
@$(MESON) configure build "-Dgdb_debugging=false"
setup_debug:
$(MESON) configure build "-Dgdb_debugging=true"
@$(MESON) configure build "-Dgdb_debugging=true"
rom:
NINJA_STATUS=$(NINJA_STATUS) $(MESON) compile -C $(POKEPLATINUM_BUILD) "pokeplatinum.us.nds"
@NINJA_STATUS=$(NINJA_STATUS) $(MESON) compile -C $(POKEPLATINUM_BUILD) "pokeplatinum.us.nds"
check:
NINJA_STATUS=$(NINJA_STATUS) $(MESON) test -C $(POKEPLATINUM_BUILD)
@NINJA_STATUS=$(NINJA_STATUS) $(MESON) test -C $(POKEPLATINUM_BUILD)
target:
NINJA_STATUS=$(NINJA_STATUS) $(MESON) compile -C $(POKEPLATINUM_BUILD) $(MESON_TARGET)
@NINJA_STATUS=$(NINJA_STATUS) $(MESON) compile -C $(POKEPLATINUM_BUILD) $(MESON_TARGET)
$(MWRAP):
rm -rf $(MWRAP) $(WRAP_BUILD)
@ -124,7 +126,7 @@ endif
-- $(POKEPLATINUM_BUILD)
format:
$(NINJA) -C $(POKEPLATINUM_BUILD) clang-format
@$(NINJA) -C $(POKEPLATINUM_BUILD) clang-format
clean:
$(MESON) compile -C $(POKEPLATINUM_BUILD) --clean
@$(MESON) compile -C $(POKEPLATINUM_BUILD) --clean