3 # Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
10 # * Redistributions of source code must retain the above copyright
11 # notice, this list of conditions and the following disclaimer.
12 # * Redistributions in binary form must reproduce the above copyright
13 # notice, this list of conditions and the following disclaimer in
14 # the documentation and/or other materials provided with the
16 # * Neither the name of Intel Corporation nor the names of its
17 # contributors may be used to endorse or promote products derived
18 # from this software without specific prior written permission.
20 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 include $(RTE_SDK)/mk/rte.vars.mk
36 ARCH_DIR ?= $(RTE_ARCH)
37 EXPORT_MAP := rte_eal_version.map
38 VPATH += $(RTE_SDK)/lib/librte_eal/common/arch/$(ARCH_DIR)
42 VPATH += $(RTE_SDK)/lib/librte_eal/common
44 CFLAGS += -I$(SRCDIR)/include
45 CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common
46 CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include
47 CFLAGS += $(WERROR_FLAGS) -O3
53 ifeq ($(CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES),y)
57 # specific to linuxapp exec-env
58 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) := eal.c
59 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_hugepage_info.c
60 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_memory.c
61 ifeq ($(CONFIG_RTE_LIBRTE_XEN_DOM0),y)
62 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_xen_memory.c
64 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_thread.c
65 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_log.c
66 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_vfio.c
67 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_vfio_mp_sync.c
68 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_pci.c
69 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_pci_uio.c
70 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_pci_vfio.c
71 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_debug.c
72 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_lcore.c
73 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_timer.c
74 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_interrupts.c
75 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_alarm.c
78 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_lcore.c
79 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_timer.c
80 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_memzone.c
81 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_log.c
82 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_launch.c
83 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_vdev.c
84 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_pci.c
85 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_pci_uio.c
86 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_memory.c
87 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_tailqs.c
88 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_errno.c
89 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_cpuflags.c
90 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_string_fns.c
91 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_hexdump.c
92 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_devargs.c
93 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_bus.c
94 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_dev.c
95 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_options.c
96 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_thread.c
97 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_proc.c
98 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += rte_malloc.c
99 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += malloc_elem.c
100 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += malloc_heap.c
101 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += rte_keepalive.c
102 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += rte_service.c
105 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += rte_cpuflags.c
106 SRCS-$(CONFIG_RTE_ARCH_X86) += rte_spinlock.c
108 CFLAGS_eal_common_cpuflags.o := $(CPUFLAGS_LIST)
110 CFLAGS_eal.o := -D_GNU_SOURCE
111 CFLAGS_eal_interrupts.o := -D_GNU_SOURCE
112 CFLAGS_eal_vfio_mp_sync.o := -D_GNU_SOURCE
113 CFLAGS_eal_timer.o := -D_GNU_SOURCE
114 CFLAGS_eal_lcore.o := -D_GNU_SOURCE
115 CFLAGS_eal_thread.o := -D_GNU_SOURCE
116 CFLAGS_eal_log.o := -D_GNU_SOURCE
117 CFLAGS_eal_common_log.o := -D_GNU_SOURCE
118 CFLAGS_eal_hugepage_info.o := -D_GNU_SOURCE
119 CFLAGS_eal_pci.o := -D_GNU_SOURCE
120 CFLAGS_eal_pci_uio.o := -D_GNU_SOURCE
121 CFLAGS_eal_pci_vfio.o := -D_GNU_SOURCE
122 CFLAGS_eal_common_whitelist.o := -D_GNU_SOURCE
123 CFLAGS_eal_common_options.o := -D_GNU_SOURCE
124 CFLAGS_eal_common_thread.o := -D_GNU_SOURCE
125 CFLAGS_eal_common_lcore.o := -D_GNU_SOURCE
127 # workaround for a gcc bug with noreturn attribute
128 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
129 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
130 CFLAGS_eal_thread.o += -Wno-return-type
133 INC := rte_interrupts.h rte_kni_common.h rte_dom0_common.h
135 SYMLINK-$(CONFIG_RTE_EXEC_ENV_LINUXAPP)-include/exec-env := \
136 $(addprefix include/exec-env/,$(INC))
138 include $(RTE_SDK)/mk/rte.lib.mk