1# SPDX-License-Identifier: BSD-3-Clause 2# Copyright (C) 2020 Intel Corporation. 3# All rights reserved. 4# 5 6rootdir = $(shell dirname $(shell realpath $(word 1,$(MAKEFILE_LIST))))/../.. 7 8SPDK_HEADER_DIR ?= $(rootdir)/include 9SPDK_LIB_DIR ?= $(rootdir)/build/lib 10DPDK_LIB_DIR ?= $(rootdir)/dpdk/build/lib 11ISAL_LIB_DIR ?= $(rootdir)/isa-l/.libs 12ISAL_CRYPTO_LIB_DIR ?= $(rootdir)/isa-l-crypto/.libs 13VFIO_LIB_DIR ?= $(rootdir)/build/libvfio-user/usr/local/lib 14ISAL_LIB_DIR ?= $(rootdir)/isa-l/.libs 15ISAL_CRYPTO_LIB_DIR ?= $(rootdir)/isa-l-crypto/.libs 16 17ifneq ($(SPDK_HEADER_DIR),) 18COMMON_CFLAGS+=-I$(SPDK_HEADER_DIR) 19endif 20 21ifneq ($(SPDK_LIB_DIR),) 22COMMON_CFLAGS+=-L$(SPDK_LIB_DIR) 23endif 24 25ifneq ($(DPDK_LIB_DIR),) 26COMMON_CFLAGS+=-L$(DPDK_LIB_DIR) 27endif 28 29ifneq ($(ISAL_LIB_DIR),) 30COMMON_CFLAGS+=-L$(ISAL_LIB_DIR) 31endif 32 33ifneq ($(ISAL_CRYPTO_LIB_DIR),) 34COMMON_CFLAGS+=-L$(ISAL_CRYPTO_LIB_DIR) 35endif 36 37ifneq ($(VFIO_LIB_DIR),) 38COMMON_CFLAGS+=-L$(VFIO_LIB_DIR) 39endif 40 41ifneq ($(ISAL_LIB_DIR),) 42COMMON_CFLAGS+=-L$(ISAL_LIB_DIR) 43endif 44 45ifneq ($(ISAL_CRYPTO_LIB_DIR),) 46COMMON_CFLAGS+=-L$(ISAL_CRYPTO_LIB_DIR) 47endif 48 49export 50.PHONY: all 51 52all: hello_world_bdev_shared_combo nvme_shared accel_shared 53 54static: hello_world_bdev_static nvme_static 55 56hello_world_bdev_shared_combo: passthru_shared 57 $(MAKE) --directory=hello_world bdev_shared_combo 58 59hello_world_bdev_shared_iso: passthru_shared 60 $(MAKE) --directory=hello_world bdev_shared_iso 61 62hello_world_no_bdev_shared_combo: 63 $(MAKE) --directory=hello_world alone_shared_combo 64 65hello_world_no_bdev_shared_iso: 66 $(MAKE) --directory=hello_world alone_shared_iso 67 68hello_world_bdev_static: passthru_static 69 $(MAKE) --directory=hello_world bdev_static 70 71hello_world_no_bdev_static: 72 $(MAKE) --directory=hello_world alone_static 73 74accel_module_shared: 75 $(MAKE) --directory=accel shared_module 76 77accel_driver_shared: 78 $(MAKE) --directory=accel shared_driver 79 80accel_module_static: 81 $(MAKE) --directory=accel static_module 82 83accel_driver_static: 84 $(MAKE) --directory=accel static_driver 85 86passthru_shared: 87 $(MAKE) --directory=passthru shared 88 89passthru_static: 90 $(MAKE) --directory=passthru static 91 92nvme_shared: 93 $(MAKE) --directory=nvme shared 94 95nvme_static: 96 $(MAKE) --directory=nvme static 97 98clean: 99 rm -f ./hello_world/hello_bdev 100 rm -f ./passthru/libpassthru_external.* 101 rm -f ./nvme/*.{so,o} ./nvme/identify 102 rm -f ./accel/*.{so,o} ./accel/module ./accel/driver 103