1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2018 Intel Corporation
7 # all source are stored in SRCS-y
8 SRCS-y := fips_validation.c
9 SRCS-y += fips_validation_aes.c
10 SRCS-y += fips_validation_hmac.c
11 SRCS-y += fips_validation_tdes.c
12 SRCS-y += fips_validation_gcm.c
13 SRCS-y += fips_validation_cmac.c
14 SRCS-y += fips_validation_ccm.c
15 SRCS-y += fips_validation_sha.c
16 SRCS-y += fips_dev_self_test.c
17 SRCS-y += fips_validation_xts.c
22 # Build using pkg-config variables if possible
23 ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
24 $(error "no installation of DPDK found")
29 shared: build/$(APP)-shared
30 ln -sf $(APP)-shared build/$(APP)
31 static: build/$(APP)-static
32 ln -sf $(APP)-static build/$(APP)
34 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
35 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
36 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
37 LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
39 ifeq ($(MAKECMDGOALS),static)
40 # check for broken pkg-config
41 ifeq ($(shell echo $(LDFLAGS_STATIC) | grep 'whole-archive.*l:lib.*no-whole-archive'),)
42 $(warning "pkg-config output list does not contain drivers between 'whole-archive'/'no-whole-archive' flags.")
43 $(error "Cannot generate statically-linked binaries with this version of pkg-config")
47 CFLAGS += -DALLOW_EXPERIMENTAL_API
49 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
50 $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
52 build/$(APP)-static: $(SRCS-y) Makefile $(PC_FILE) | build
53 $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_STATIC)
60 rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
61 test -d build && rmdir -p build || true