test mbuf attach
[dpdk.git] / mk / rte.vars.mk
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2010-2014 Intel Corporation
3
4 #
5 # To be included at the beginning of all RTE user Makefiles. This
6 # .mk will define the RTE environment variables by including the
7 # config file of SDK. It also includes the config file from external
8 # application if any.
9 #
10
11 ifeq ($(RTE_SDK),)
12 $(error RTE_SDK is not defined)
13 endif
14 ifeq ($(wildcard $(RTE_SDK)),)
15 $(error RTE_SDK variable points to an invalid location)
16 endif
17
18 # define Q to '@' or not. $(Q) is used to prefix all shell commands to
19 # be executed silently.
20 Q=@
21 ifeq '$V' '0'
22 override V=
23 endif
24 ifdef V
25 ifeq ("$(origin V)", "command line")
26 Q=
27 endif
28 endif
29 export Q
30
31 # if we are building SDK, only includes SDK configuration
32 ifneq ($(BUILDING_RTE_SDK),)
33   include $(RTE_OUTPUT)/.config
34   # remove double-quotes from config names
35   RTE_ARCH := $(CONFIG_RTE_ARCH:"%"=%)
36   RTE_MACHINE := $(CONFIG_RTE_MACHINE:"%"=%)
37   RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%)
38   RTE_TOOLCHAIN := $(CONFIG_RTE_TOOLCHAIN:"%"=%)
39   RTE_SDK_BIN := $(RTE_OUTPUT)
40 endif
41
42 RTE_TARGET ?= $(RTE_ARCH)-$(RTE_MACHINE)-$(RTE_EXEC_ENV)-$(RTE_TOOLCHAIN)
43
44 ifeq ($(BUILDING_RTE_SDK),)
45 # if we are building an external app/lib, include internal/rte.extvars.mk that will
46 # define RTE_OUTPUT, RTE_SRCDIR, RTE_EXTMK, RTE_SDK_BIN, (etc ...)
47 include $(RTE_SDK)/mk/internal/rte.extvars.mk
48 endif
49
50 CONFIG_RTE_LIBRTE_E1000_PMD = $(CONFIG_RTE_LIBRTE_IGB_PMD)
51 ifneq ($(CONFIG_RTE_LIBRTE_E1000_PMD),y)
52   CONFIG_RTE_LIBRTE_E1000_PMD = $(CONFIG_RTE_LIBRTE_EM_PMD)
53 endif
54
55 ifeq ($(RTE_ARCH),)
56 $(error RTE_ARCH is not defined)
57 endif
58
59 ifeq ($(RTE_MACHINE),)
60 $(error RTE_MACHINE is not defined)
61 endif
62
63 ifeq ($(RTE_EXEC_ENV),)
64 $(error RTE_EXEC_ENV is not defined)
65 endif
66
67 ifeq ($(RTE_TOOLCHAIN),)
68 $(error RTE_TOOLCHAIN is not defined)
69 endif
70
71 # can be overridden by make command line or exported environment variable
72 RTE_KERNELDIR ?= /lib/modules/$(shell uname -r)/build
73
74 export RTE_TARGET
75 export RTE_ARCH
76 export RTE_MACHINE
77 export RTE_EXEC_ENV
78 export RTE_TOOLCHAIN
79
80 # developer build automatically enabled in a git tree
81 ifneq ($(wildcard $(RTE_SDK)/.git),)
82 RTE_DEVEL_BUILD ?= y
83 endif
84
85 # SRCDIR is the current source directory
86 ifdef S
87 SRCDIR := $(abspath $(RTE_SRCDIR)/$(S))
88 else
89 SRCDIR := $(RTE_SRCDIR)
90 endif
91
92 # helper: return y if option is set to y, else return an empty string
93 testopt = $(if $(strip $(subst y,,$(1)) $(subst $(1),,y)),,y)
94
95 # helper: return an empty string if option is set, else return y
96 not = $(if $(strip $(subst y,,$(1)) $(subst $(1),,y)),,y)
97
98 ifneq ($(wildcard $(RTE_SDK)/mk/target/$(RTE_TARGET)/rte.vars.mk),)
99 include $(RTE_SDK)/mk/target/$(RTE_TARGET)/rte.vars.mk
100 else
101 include $(RTE_SDK)/mk/target/generic/rte.vars.mk
102 endif