]> git.proxmox.com Git - ceph.git/blame - ceph/src/spdk/intel-ipsec-mb/LibTestApp/Makefile
import 15.2.0 Octopus source
[ceph.git] / ceph / src / spdk / intel-ipsec-mb / LibTestApp / Makefile
CommitLineData
11fdf7f2
TL
1#
2# Copyright (c) 2012-2018, Intel Corporation
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are met:
6#
7# * Redistributions of source code must retain the above copyright notice,
8# this list of conditions and the following disclaimer.
9# * Redistributions in binary form must reproduce the above copyright
10# notice, this list of conditions and the following disclaimer in the
11# documentation and/or other materials provided with the distribution.
12# * Neither the name of Intel Corporation nor the names of its contributors
13# may be used to endorse or promote products derived from this software
14# without specific prior written permission.
15#
16# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
20# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26#
27
28APP := ipsec_MB_testapp
29INSTPATH ?= /usr/include/intel-ipsec-mb.h
30
31CFLAGS = -g -DLINUX -D_GNU_SOURCE \
32 -W -Wall -Wextra -Wmissing-declarations -Wpointer-arith \
33 -Wcast-qual -Wundef -Wwrite-strings \
34 -Wformat -Wformat-security \
35 -Wunreachable-code -Wmissing-noreturn -Wsign-compare -Wno-endif-labels \
36 -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
37
38LDFLAGS = -fPIE -z noexecstack -z relro -z now
39LDLIBS = -lIPSec_MB
40
41ifeq ("$(shell test -r $(INSTPATH) && echo -n yes)","yes")
42# library installed
43CFLAGS +=
44else
45# library not installed
46CFLAGS += -I../include -I../
47LDFLAGS += -L../
48endif
49
50ifeq ($(DEBUG),y)
51CFLAGS += -O0 -DDEBUG
52LDFLAGS += -g
53else
54CFLAGS += -O3
55endif
56
9f95a23c
TL
57SOURCES := main.c gcm_test.c ctr_test.c customop_test.c des_test.c ccm_test.c \
58 cmac_test.c utils.c hmac_sha1_test.c hmac_sha256_sha512_test.c \
59 hmac_md5_test.c aes_test.c sha_test.c
11fdf7f2
TL
60OBJECTS := $(SOURCES:%.c=%.o)
61
62all: $(APP)
63
64$(APP): $(OBJECTS)
65 $(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@
66
67main.o: main.c do_test.h
68gcm_test.o: gcm_test.c gcm_ctr_vectors_test.h
69ctr_test.o: ctr_test.c gcm_ctr_vectors_test.h
70des_test.o: des_test.c
9f95a23c
TL
71ccm_test.o: ccm_test.c utils.h
72cmac_test.o: cmac_test.c utils.h
73hmac_sha1_test.o: hmac_sha1_test.c utils.h
74hmac_md5_test.o: hmac_md5_test.c utils.h
75hmac_sha256_sha512_test.o: hmac_sha256_sha512_test.c utils.h
76aes_test.o: aes_test.c gcm_ctr_vectors_test.h utils.h
11fdf7f2 77customop_test.o: customop_test.c customop_test.h
9f95a23c
TL
78utils.o: utils.c utils.h
79sha_test.o: sha_test.c utils.h
11fdf7f2
TL
80
81.PHONY: clean
82clean:
83 -rm -f $(OBJECTS) $(APP)
84
85SOURCES_STYLE := $(foreach infile,$(SOURCES),-f $(infile))
86CHECKPATCH?=checkpatch.pl
87.PHONY: style
88style:
89 $(CHECKPATCH) --no-tree --no-signoff --emacs --no-color \
90--ignore CODE_INDENT,INITIALISED_STATIC,LEADING_SPACE,SPLIT_STRING,\
91UNSPECIFIED_INT,ARRAY_SIZE,BLOCK_COMMENT_STYLE,GLOBAL_INITIALISERS,\
9f95a23c 92AVOID_EXTERNS,COMPLEX_MACRO,USE_FUNC,CONSTANT_COMPARISON,MISSING_SPACE $(SOURCES_STYLE)