1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2010-2014 Intel Corporation
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
12 $(error RTE_SDK is not defined)
14 ifeq ($(wildcard $(RTE_SDK)),)
15 $(error RTE_SDK variable points to an invalid location)
18 # define Q to '@' or not. $(Q) is used to prefix all shell commands to
19 # be executed silently.
25 ifeq ("$(origin V)", "command line")
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)
42 RTE_TARGET ?= $(RTE_ARCH)-$(RTE_MACHINE)-$(RTE_EXEC_ENV)-$(RTE_TOOLCHAIN)
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
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)
56 $(error RTE_ARCH is not defined)
59 ifeq ($(RTE_MACHINE),)
60 $(error RTE_MACHINE is not defined)
63 ifeq ($(RTE_EXEC_ENV),)
64 $(error RTE_EXEC_ENV is not defined)
67 ifeq ($(RTE_TOOLCHAIN),)
68 $(error RTE_TOOLCHAIN is not defined)
71 # can be overridden by make command line or exported environment variable
72 RTE_KERNELDIR ?= /lib/modules/$(shell uname -r)/build
80 # developer build automatically enabled in a git tree
81 ifneq ($(wildcard $(RTE_SDK)/.git),)
85 # SRCDIR is the current source directory
87 SRCDIR := $(abspath $(RTE_SRCDIR)/$(S))
89 SRCDIR := $(RTE_SRCDIR)
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)
95 # helper: return an empty string if option is set, else return y
96 not = $(if $(strip $(subst y,,$(1)) $(subst $(1),,y)),,y)
98 ifneq ($(wildcard $(RTE_SDK)/mk/target/$(RTE_TARGET)/rte.vars.mk),)
99 include $(RTE_SDK)/mk/target/$(RTE_TARGET)/rte.vars.mk
101 include $(RTE_SDK)/mk/target/generic/rte.vars.mk