ethdev: add tracepoints
[dpdk.git] / examples / vm_power_manager / Makefile
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2010-2014 Intel Corporation
3
4 ifneq ($(shell pkg-config --atleast-version=0.9.3 libvirt; echo $$?), 0)
5 $(error vm_power_manager requires libvirt >= 0.9.3)
6 else
7
8 ifeq ($(RTE_SDK),)
9 $(error "Please define RTE_SDK environment variable")
10 endif
11
12 # Default target, detect a build directory, by looking for a path with a .config
13 RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.config)))))
14
15 include $(RTE_SDK)/mk/rte.vars.mk
16
17 # binary name
18 APP = vm_power_mgr
19
20 # all source are stored in SRCS-y
21 SRCS-y := main.c vm_power_cli.c power_manager.c channel_manager.c
22 SRCS-y += channel_monitor.c parse.c
23 ifeq ($(CONFIG_RTE_ARCH_X86_64),y)
24 SRCS-y += oob_monitor_x86.c
25 else
26 SRCS-y += oob_monitor_nop.c
27 endif
28
29 CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/
30 CFLAGS += $(WERROR_FLAGS)
31 CFLAGS += -DALLOW_EXPERIMENTAL_API
32
33 LDLIBS += -lvirt
34
35 JANSSON := $(shell pkg-config --exists jansson; echo $$?)
36 ifeq ($(JANSSON), 0)
37 LDLIBS += $(shell pkg-config --libs jansson)
38 CFLAGS += -DUSE_JANSSON
39 endif
40
41 ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
42
43 ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y)
44 LDLIBS += -lrte_pmd_ixgbe
45 endif
46
47 ifeq ($(CONFIG_RTE_LIBRTE_I40E_PMD),y)
48 LDLIBS += -lrte_pmd_i40e
49 endif
50
51 ifeq ($(CONFIG_RTE_LIBRTE_BNXT_PMD),y)
52 LDLIBS += -lrte_pmd_bnxt
53 endif
54
55 endif
56
57 # workaround for a gcc bug with noreturn attribute
58 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
59 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
60 CFLAGS_main.o += -Wno-return-type
61 endif
62
63 include $(RTE_SDK)/mk/rte.extapp.mk
64
65 endif # libvirt check