2 # Copyright (c) 2012-2018, Intel Corporation
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are met:
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.
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.
28 APP
:= ipsec_MB_testapp
29 INSTPATH ?
= /usr
/include/intel-ipsec-mb.h
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
38 LDFLAGS
= -fPIE
-z noexecstack
-z relro
-z now
41 ifeq ("$(shell test -r $(INSTPATH) && echo -n yes)","yes")
45 # library not installed
46 CFLAGS
+= -I..
/include -I..
/
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
)
63 $(CC
) $(LDFLAGS
) $^
$(LDLIBS
) -o
$@
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
75 -rm -f
$(OBJECTS
) $(APP
)
77 SOURCES_STYLE
:= $(foreach infile
,$(SOURCES
),-f
$(infile
))
78 CHECKPATCH?
=checkpatch.pl
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
)