xref: /spdk/test/external_code/Makefile (revision b3bec07939ebe2ea2e0c43931705d32aa9e06719)
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
11VFIO_LIB_DIR	?= $(rootdir)/build/libvfio-user/usr/local/lib
12
13ifneq ($(SPDK_HEADER_DIR),)
14COMMON_CFLAGS+=-I$(SPDK_HEADER_DIR)
15endif
16
17ifneq ($(SPDK_LIB_DIR),)
18COMMON_CFLAGS+=-L$(SPDK_LIB_DIR)
19endif
20
21ifneq ($(DPDK_LIB_DIR),)
22COMMON_CFLAGS+=-L$(DPDK_LIB_DIR)
23endif
24
25ifneq ($(VFIO_LIB_DIR),)
26COMMON_CFLAGS+=-L$(VFIO_LIB_DIR)
27endif
28export
29.PHONY: all
30
31all: hello_world_bdev_shared_combo nvme_shared
32
33static: hello_world_bdev_static nvme_static
34
35hello_world_bdev_shared_combo: passthru_shared
36	$(MAKE) --directory=hello_world bdev_shared_combo
37
38hello_world_bdev_shared_iso: passthru_shared
39	$(MAKE) --directory=hello_world bdev_shared_iso
40
41hello_world_no_bdev_shared_combo:
42	$(MAKE) --directory=hello_world alone_shared_combo
43
44hello_world_no_bdev_shared_iso:
45	$(MAKE) --directory=hello_world alone_shared_iso
46
47hello_world_bdev_static: passthru_static
48	$(MAKE) --directory=hello_world bdev_static
49
50hello_world_no_bdev_static:
51	$(MAKE) --directory=hello_world alone_static
52
53passthru_shared:
54	$(MAKE) --directory=passthru shared
55
56passthru_static:
57	$(MAKE) --directory=passthru static
58
59nvme_shared:
60	$(MAKE) --directory=nvme shared
61
62nvme_static:
63	$(MAKE) --directory=nvme static
64
65clean:
66	rm -f ./hello_world/hello_bdev
67	rm -f ./passthru/libpassthru_external.*
68	rm -f ./nvme/*.{so,o} ./nvme/identify
69