Skip to content

Commit e297419

Browse files
committed
docs: clarify install path variables
1 parent 885c79b commit e297419

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,13 @@ Other standard targets include:
138138
The `Makefile` follows the [GNU Standard Makefile conventions](https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html),
139139
allowing staged install, standard compilation flags, directory variables and command variables.
140140

141+
Common install variables include:
142+
- `PREFIX` : sets the final installation prefix recorded in installed metadata, such as `libzstd.pc`.
143+
For example, `make install PREFIX=/usr` installs under `/usr` instead of `/usr/local`.
144+
- `DESTDIR` : prepends a staging directory to the install path without changing installed metadata.
145+
For example, `make install PREFIX=/usr DESTDIR="$PWD/staging"` installs files under
146+
`staging/usr`, while `libzstd.pc` still records `prefix=/usr`.
147+
141148
For advanced use cases, specialized flags which control binary generation and installation paths are documented
142149
in [`lib/README.md`](lib/README.md#modular-build) for the `libzstd` library
143150
and in [`programs/README.md`](programs/README.md#compilation-variables) for the `zstd` CLI.

0 commit comments

Comments
 (0)