

The variables in the Makefile will follow the same. Those directories may be stored in the compiled binaries, so we have to compile the package and install it with the same configuration. $ make prefix=/usr libdir=/usr/lib64 install Let’s change the prefix to /usr and libdir to /usr/lib64: $ make clean If we want to set a variable with make, we’ll use the parameter variable=value. If the Makefile follows GNU conventions, we can use the same parameters used with. configure script, but they provide a Makefile file. Let’s remove our previous installation and re-install diffutils using DESTDIR instead: This path will be prepended to all installation directories. To do that properly, we’ll set the DESTDIR= variable when running make install. So, the package shouldn’t have any reference to this temporary location. In that case, we usually install the package in an empty and temporary directory. One example is when we want to make a tarball of the installed package and copy it to another PC. Sometimes, we just want to install the package in another place without changing its internal directory structure. This is OK as long as we don’t move the installed package to another location. We can notice that strings found the path /home/baeldung/diffutils/usr/share/locale inside the installed binary. home/baeldung/diffutils/usr/share/locale Let’s search for the prefix inside the binary installed with –prefix=/home/baeldung/diffutils/usr: $ strings /home/baeldung/diffutils/usr/bin/diff | grep /home/baeldung/diffutils/usr For instance, the package may install resources such as icons and sounds, and it needs to know their location. configure, we’re changing the building and installation process, so the installed files will use those directories.
