The standard variable for staged installations is DESTDIR and it should
be set only by the user, outside of Makefile. This is consistent with
recommendations from both GNU Make and FreeBSD porters-handbook.

        make DESTDIR=/tmp/stage install

$prefix and $PREFIX (in FreeBSD world) are used to specify where the
files will be installed. It defaults to /usr/local but can be /usr or
/opt or something else.

Usually one wants to do a stage installation when cross-building or for
other purposes. The convention is to use DESTDIR.
Changing $prefix is useful for installers. They can override its value
when calling make:

        make prefix=/usr install

Signed-off-by: Cristian Stoica <>
 Makefile | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 7f8df37..9871a8e 100644
--- a/Makefile
+++ b/Makefile
 KERNEL_DIR ?= /lib/modules/$(shell uname -r)/build
 VERSION = 1.8
+prefix ?= /usr/local
+includedir = $(prefix)/include
 cryptodev-objs = ioctl.o main.o cryptlib.o authenc.o zc.o util.o
@@ -31,8 +33,7 @@ install: modules_install
        $(MAKE) -C $(KERNEL_DIR) M=$(PWD) modules_install
-       @echo "Installing cryptodev.h in $(PREFIX)/usr/include/crypto ..."
-       @install -D crypto/cryptodev.h $(PREFIX)/usr/include/crypto/cryptodev.h
+       install -m 644 -D crypto/cryptodev.h 
        $(MAKE) -C $(KERNEL_DIR) M=$(PWD) clean

Cryptodev-linux-devel mailing list

Reply via email to