Skip to content

Commit

Permalink
Makefile: do not hardcode the install program path
Browse files Browse the repository at this point in the history
On systems that do not use the FHS, such as NixOS, the `install` program is not
located in `/usr/bin/` as its location is dynamic.

`dtc` can be easily installed on such systems by using the `install` program
available in the `$PATH` with:

    make PREFIX=… INSTALL=install

However, this becomes more difficult when `dtc` is being compiled as part of a
larger toolchain, as the toolchain build scripts will not spontaneously pass
such an argument on the command line. This happens for example when `dtc` is
build as a part of the RTEMS build system.

By not hardcoding a predefined path for `install`, as is done for other
executables, `dtc` will allow the one in the `$PATH` to be used.

Signed-off-by: Samuel Tardieu <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: David Gibson <[email protected]>
  • Loading branch information
samueltardieu authored and dgibson committed Feb 14, 2024
1 parent 3fbfdd0 commit a669223
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ SWIG = swig
PKG_CONFIG ?= pkg-config
PYTHON ?= python3

INSTALL = /usr/bin/install
INSTALL = install
INSTALL_PROGRAM = $(INSTALL)
INSTALL_LIB = $(INSTALL)
INSTALL_DATA = $(INSTALL) -m 644
Expand Down

0 comments on commit a669223

Please sign in to comment.