Skip to content

Commit 21cdf26

Browse files
committed
Update README.md
1 parent 3970bc8 commit 21cdf26

File tree

1 file changed

+24
-18
lines changed

1 file changed

+24
-18
lines changed

README.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ See [Usage](#usage) for more information.
1616

1717
## Usage
1818

19-
objdiff works by comparing two relocatable object files (`.o`). The objects are expected to have the same relative path from the "target" and "base" directories.
19+
objdiff works by comparing two relocatable object files (`.o`). The objects are expected to have the same relative path
20+
from the "target" and "base" directories.
2021

21-
For example, if the target ("expected") object is located at `build/asm/MetroTRK/mslsupp.o` and the base ("actual") object
22-
is located at `build/src/MetroTRK/mslsupp.o`, the following configuration would be used:
22+
For example, if the target ("expected") object is located at `build/asm/MetroTRK/mslsupp.o` and the base ("actual")
23+
object is located at `build/src/MetroTRK/mslsupp.o`, the following configuration would be used:
2324

2425
- Target build directory: `build/asm`
2526
- Base build directory: `build/src`
@@ -38,14 +39,19 @@ See [Configuration](#configuration) for more information.
3839

3940
## Configuration
4041

41-
While **not required** (most settings can be specified in the UI), projects can add an `objdiff.json` (or `objdiff.yaml`, `objdiff.yml`) file to configure the tool automatically. The configuration file must be located in the root project directory.
42+
While **not required** (most settings can be specified in the UI), projects can add an `objdiff.json` (or
43+
`objdiff.yaml`, `objdiff.yml`) file to configure the tool automatically. The configuration file must be located in
44+
the root project directory.
45+
46+
If your project has a generator script (e.g. `configure.py`), it's recommended to generate the objdiff configuration
47+
file as well. You can then add `objdiff.json` to your `.gitignore` to prevent it from being committed.
4248

4349
```json5
4450
// objdiff.json
4551
{
4652
"custom_make": "ninja",
47-
"target_dir": "build/mp1.0/asm",
48-
"base_dir": "build/mp1.0/src",
53+
"target_dir": "build/asm",
54+
"base_dir": "build/src",
4955
"build_target": true,
5056
"watch_patterns": [
5157
"*.c",
@@ -72,18 +78,19 @@ While **not required** (most settings can be specified in the UI), projects can
7278
These are the **intended result** of the match.
7379
- `base_dir`: Relative from the root of the project, this is where the "base" or "actual" objects are located.
7480
These are objects built from the **current source code**.
75-
- `build_target`: If true, objdiff will tell the build system to build the target objects before diffing (e.g. `make path/to/target.o`).
76-
This is useful if the target objects are not built by default or can change based on project configuration or edits to assembly files.
81+
- `build_target`: If true, objdiff will tell the build system to build the target objects before diffing (e.g.
82+
`make path/to/target.o`).
83+
This is useful if the target objects are not built by default or can change based on project configuration or edits
84+
to assembly files.
7785
Requires the build system to be configured properly.
78-
- `watch_patterns` _(optional)_: A list of glob patterns to watch for changes. ([Supported syntax](https://docs.rs/globset/latest/globset/#syntax))
86+
- `watch_patterns` _(optional)_: A list of glob patterns to watch for changes.
87+
([Supported syntax](https://docs.rs/globset/latest/globset/#syntax))
7988
If any of these files change, objdiff will automatically rebuild the objects and re-compare them.
8089
- `objects` _(optional)_: If specified, objdiff will display a list of objects in the sidebar for easy navigation.
81-
- `path`: Relative path to the object from the `target_dir` and `base_dir`.
82-
- `name` _(optional)_: The name of the object in the UI. If not specified, the object's `path` will be used.
83-
- `reverse_fn_order` _(optional)_: Displays function symbols in reversed order.
84-
Used to support MWCC's `-inline deferred` option, which reverses the order of functions in the object file.
85-
86-
90+
- `path`: Relative path to the object from the `target_dir` and `base_dir`.
91+
- `name` _(optional)_: The name of the object in the UI. If not specified, the object's `path` will be used.
92+
- `reverse_fn_order` _(optional)_: Displays function symbols in reversed order.
93+
Used to support MWCC's `-inline deferred` option, which reverses the order of functions in the object file.
8794

8895
## License
8996

@@ -96,6 +103,5 @@ at your option.
96103

97104
### Contribution
98105

99-
Unless you explicitly state otherwise, any contribution intentionally submitted
100-
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any
101-
additional terms or conditions.
106+
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as
107+
defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

0 commit comments

Comments
 (0)