examples: put app name and sources at top of makefiles
[dpdk.git] / examples / vm_power_manager / Makefile
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2010-2014 Intel Corporation
3
4 # binary name
5 APP = vm_power_mgr
6
7 # all source are stored in SRCS-y
8 SRCS-y := main.c vm_power_cli.c power_manager.c channel_manager.c
9 SRCS-y += channel_monitor.c
10
11 ifneq ($(shell pkg-config --atleast-version=0.9.3 libvirt; echo $$?), 0)
12 $(error vm_power_manager requires libvirt >= 0.9.3)
13 else
14
15 ifeq ($(RTE_SDK),)
16 $(error "Please define RTE_SDK environment variable")
17 endif
18
19 # Default target, can be overridden by command line or environment
20 RTE_TARGET ?= x86_64-native-linuxapp-gcc
21
22 include $(RTE_SDK)/mk/rte.vars.mk
23
24 CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/
25 CFLAGS += $(WERROR_FLAGS)
26
27 LDLIBS += -lvirt
28
29 ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
30
31 ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y)
32 LDLIBS += -lrte_pmd_ixgbe
33 endif
34
35 ifeq ($(CONFIG_RTE_LIBRTE_I40E_PMD),y)
36 LDLIBS += -lrte_pmd_i40e
37 endif
38
39 ifeq ($(CONFIG_RTE_LIBRTE_BNXT_PMD),y)
40 LDLIBS += -lrte_pmd_bnxt
41 endif
42
43 endif
44
45 # workaround for a gcc bug with noreturn attribute
46 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
47 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
48 CFLAGS_main.o += -Wno-return-type
49 endif
50
51 include $(RTE_SDK)/mk/rte.extapp.mk
52
53 endif # libvirt check