]> git.proxmox.com Git - ceph.git/blob - ceph/src/spdk/intel-ipsec-mb/LibTestApp/Makefile
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / spdk / intel-ipsec-mb / LibTestApp / Makefile
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
28 APP := ipsec_MB_testapp
29 INSTPATH ?= /usr/include/intel-ipsec-mb.h
30
31 CFLAGS = -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
38 LDFLAGS = -fPIE -z noexecstack -z relro -z now
39 LDLIBS = -lIPSec_MB
40
41 ifeq ("$(shell test -r $(INSTPATH) && echo -n yes)","yes")
42 # library installed
43 CFLAGS +=
44 else
45 # library not installed
46 CFLAGS += -I../include -I../
47 LDFLAGS += -L../
48 endif
49
50 ifeq ($(DEBUG),y)
51 CFLAGS += -O0 -DDEBUG
52 LDFLAGS += -g
53 else
54 CFLAGS += -O3
55 endif
56
57 SOURCES := main.c gcm_test.c ctr_test.c customop_test.c des_test.c ccm_test.c cmac_test.c
58 OBJECTS := $(SOURCES:%.c=%.o)
59
60 all: $(APP)
61
62 $(APP): $(OBJECTS)
63 $(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@
64
65 main.o: main.c do_test.h
66 gcm_test.o: gcm_test.c gcm_ctr_vectors_test.h
67 ctr_test.o: ctr_test.c gcm_ctr_vectors_test.h
68 des_test.o: des_test.c
69 ccm_test.o: ccm_test.c
70 cmac_test.o: cmac_test.c
71 customop_test.o: customop_test.c customop_test.h
72
73 .PHONY: clean
74 clean:
75 -rm -f $(OBJECTS) $(APP)
76
77 SOURCES_STYLE := $(foreach infile,$(SOURCES),-f $(infile))
78 CHECKPATCH?=checkpatch.pl
79 .PHONY: style
80 style:
81 $(CHECKPATCH) --no-tree --no-signoff --emacs --no-color \
82 --ignore CODE_INDENT,INITIALISED_STATIC,LEADING_SPACE,SPLIT_STRING,\
83 UNSPECIFIED_INT,ARRAY_SIZE,BLOCK_COMMENT_STYLE,GLOBAL_INITIALISERS,\
84 AVOID_EXTERNS,USE_FUNC,CONSTANT_COMPARISON $(SOURCES_STYLE)