xref: /spdk/test/external_code/Makefile (revision 45a053c5777494f4e8ce4bc1191c9de3920377f7)
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 accel_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
53accel_module_shared:
54	$(MAKE) --directory=accel shared_module
55
56accel_driver_shared:
57	$(MAKE) --directory=accel shared_driver
58
59accel_module_static:
60	$(MAKE) --directory=accel static_module
61
62accel_driver_static:
63	$(MAKE) --directory=accel static_driver
64
65passthru_shared:
66	$(MAKE) --directory=passthru shared
67
68passthru_static:
69	$(MAKE) --directory=passthru static
70
71nvme_shared:
72	$(MAKE) --directory=nvme shared
73
74nvme_static:
75	$(MAKE) --directory=nvme static
76
77clean:
78	rm -f ./hello_world/hello_bdev
79	rm -f ./passthru/libpassthru_external.*
80	rm -f ./nvme/*.{so,o} ./nvme/identify
81	rm -f ./accel/*.{so,o} ./accel/module ./accel/driver
82