Specify PREFIX location when running make

compilingrpmsoftware installation

I need to install redis 2.8.x into a specific directory so I can later use fpm to create an rpm.

From my research, it seems that this should be possible by using make PREFIX=

mkdir /tmp/installdir
cd /tmp
wget http://download.redis.io/releases/redis-2.8.6.tar.gz
tar -xvf redis-*.tar.gz
cd redis-2.8.6
make PREFIX=/tmp/installdir
make install

I expect the binaries to be placed in /tmp/installdir, unfortunately that directory remains empty. It seems PREFIX=/tmp/installdir is being ignored.

Normally I would run ./configure --prefix=/tmp/installdir however because the download does not contain source code, there is no configure file.

How can I install software to a non standard directory?

Best Answer

I was successful by prefixing

PREFIX=/tmp/installdir make

and

PREFIX=/tmp/installdir make install

to check what happens, use -n

root@wizzard:/tmp/redis-2.8.6# PREFIX=/tmp/installdir make install -n
cd src && make install
make[1]: Entering directory `/tmp/redis-2.8.6/src'
echo ""
echo "Hint: To run 'make test' is a good idea ;)"
echo ""
mkdir -p /tmp/installdir/bin
printf '    %b %b\n' "\033[34;1m"INSTALL"\033[0m" "\033[37;1m"install"\033[0m" 1>&2;install redis-server /tmp/installdir/bin
printf '    %b %b\n' "\033[34;1m"INSTALL"\033[0m" "\033[37;1m"install"\033[0m" 1>&2;install redis-benchmark /tmp/installdir/bin
printf '    %b %b\n' "\033[34;1m"INSTALL"\033[0m" "\033[37;1m"install"\033[0m" 1>&2;install redis-cli /tmp/installdir/bin
printf '    %b %b\n' "\033[34;1m"INSTALL"\033[0m" "\033[37;1m"install"\033[0m" 1>&2;install redis-check-dump /tmp/installdir/bin
printf '    %b %b\n' "\033[34;1m"INSTALL"\033[0m" "\033[37;1m"install"\033[0m" 1>&2;install redis-check-aof /tmp/installdir/bin
make[1]: Leaving directory `/tmp/redis-2.8.6/src'
Related Question