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

Update documentation #89

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Note that we say "treats as set" because these are considered only when [`BUILD_

## How `BUILD_WRAP_CMD` is expanded

- `{}` is replaced with the path of a copy of the original build script.
- `{}` is replaced with the path of a renamed copy of the original build script.
- `{VAR}` is replaced with the value of environment variable `VAR`.
- `{{` is replaced with `{`.
- `}}` is replaced with `}`.
Expand All @@ -113,14 +113,15 @@ When invoked, `build-wrap` does the following:

1. Link normally using `BUILD_WRAP_LD`.
2. Parse the arguments to determine whether the output file is a build script.
3. If so, replace the build script `B` with its "wrapped" version `B'`, described next.
3. If not, stop; otherwise, proceed.
4. Let `B` be the build script's original name.
5. Rename the build script to a fresh, unused name `B'`.
6. At `B`, create a "wrapped" version of the build script whose behavior is described next.

Given a build script `B`, its "wrapped" version `B'` contains a copy of `B` and does the following when invoked:
The "wrapped" version of the build script does the following when invoked:

1. Create a temporary file with the contents of `B`. (Recall: `B'` contains a copy of `B`).
2. Make the temporary file executable.
3. Expand `BUILD_WRAP_CMD` in the [manner described above].
4. Execute the expanded command.
1. Expand `BUILD_WRAP_CMD` in the [manner described above], with `{}` expanding to `B'`.
2. Execute the expanded command.

## Goals

Expand Down