forked from cryptodev-linux/cryptodev-linux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
77 lines (60 loc) · 1.89 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#
# Since version 1.6 the asynchronous mode has been
# disabled by default. To re-enable it uncomment the
# corresponding CFLAG.
#
CRYPTODEV_CFLAGS ?= #-DENABLE_ASYNC
KBUILD_CFLAGS += -I$(src) $(CRYPTODEV_CFLAGS) -Wvla
KERNEL_DIR ?= /lib/modules/$(shell uname -r)/build
VERSION = 1.12
prefix ?= /usr/local
includedir = $(prefix)/include
cryptodev-objs = ioctl.o main.o cryptlib.o authenc.o zc.o util.o
obj-m += cryptodev.o
KERNEL_MAKE_OPTS := -C $(KERNEL_DIR) M=$(CURDIR)
ifneq ($(ARCH),)
KERNEL_MAKE_OPTS += ARCH=$(ARCH)
endif
ifneq ($(CROSS_COMPILE),)
KERNEL_MAKE_OPTS += CROSS_COMPILE=$(CROSS_COMPILE)
endif
ifneq ($(INSTALL_MOD_PATH),)
KERNEL_MAKE_OPTS += INSTALL_MOD_PATH=$(INSTALL_MOD_PATH)
endif
build: version.h
$(MAKE) $(KERNEL_MAKE_OPTS) modules
version.h: Makefile
@echo "#define VERSION \"$(VERSION)\"" > version.h
install: modules_install
modules_install:
$(MAKE) $(KERNEL_MAKE_OPTS) modules_install
install -m 644 -D crypto/cryptodev.h $(DESTDIR)/$(includedir)/crypto/cryptodev.h
install_tests: tests
$(MAKE) -C tests install DESTDIR=$(PREFIX)
clean:
$(MAKE) $(KERNEL_MAKE_OPTS) clean
CFLAGS=$(CRYPTODEV_CFLAGS) KERNEL_DIR=$(KERNEL_DIR) $(MAKE) -C tests clean
check:
CFLAGS=$(CRYPTODEV_CFLAGS) KERNEL_DIR=$(KERNEL_DIR) $(MAKE) -C tests check
tests:
KERNEL_DIR=$(KERNEL_DIR) $(MAKE) -C tests
.PHONY: install modules_install tests install_tests
CPOPTS =
ifneq ($(SHOW_TYPES),)
CPOPTS += --show-types
endif
ifneq ($(IGNORE_TYPES),)
CPOPTS += --ignore $(IGNORE_TYPES)
endif
checkpatch:
$(KERNEL_DIR)/scripts/checkpatch.pl $(CPOPTS) --file *.c *.h
VERSIONTAG = refs/tags/cryptodev-linux-$(VERSION)
FILEBASE = cryptodev-linux-$(VERSION)
OUTPUT = $(FILEBASE).tar.gz
dist: clean
@echo Packing
@rm -f *.tar.gz
@git archive --format=tar.gz --prefix=$(FILEBASE)/ --output=$(OUTPUT) $(VERSIONTAG)
@echo Signing $(OUTPUT)
@gpg --output $(OUTPUT).sig -sb $(OUTPUT)
@gpg --verify $(OUTPUT).sig $(OUTPUT)