New upstream version 18.02
[deb_dpdk.git] / mk / internal / rte.extvars.mk
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2010-2014 Intel Corporation
3
4 #
5 # directory where sources are located
6 #
7 ifdef S
8 ifeq ("$(origin S)", "command line")
9 RTE_SRCDIR := $(abspath $(S))
10 endif
11 endif
12 RTE_SRCDIR  ?= $(CURDIR)
13 export RTE_SRCDIR
14
15 #
16 # Makefile to call once $(RTE_OUTPUT) is created
17 #
18 ifdef M
19 ifeq ("$(origin M)", "command line")
20 RTE_EXTMK := $(abspath $(M))
21 endif
22 endif
23 RTE_EXTMK ?= $(RTE_SRCDIR)/$(notdir $(firstword $(MAKEFILE_LIST)))
24 export RTE_EXTMK
25
26 # RTE_SDK_BIN must point to .config, include/ and lib/.
27 RTE_SDK_BIN := $(RTE_SDK)/$(RTE_TARGET)
28 ifeq ($(wildcard $(RTE_SDK_BIN)/.config),)
29 $(error Cannot find .config in $(RTE_SDK_BIN))
30 endif
31
32 #
33 # Output files wil go in a separate directory: default output is
34 # $(RTE_SRCDIR)/build
35 # Output dir can be given as command line using "O="
36 #
37 ifdef O
38 ifeq ("$(origin O)", "command line")
39 RTE_OUTPUT := $(abspath $(O))
40 endif
41 endif
42 RTE_OUTPUT ?= $(RTE_SRCDIR)/build
43 export RTE_OUTPUT
44
45 # if we are building an external application, include SDK
46 # configuration and include project configuration if any
47 include $(RTE_SDK_BIN)/.config
48 ifneq ($(wildcard $(RTE_OUTPUT)/.config),)
49   include $(RTE_OUTPUT)/.config
50 endif
51 # remove double-quotes from config names
52 RTE_ARCH := $(CONFIG_RTE_ARCH:"%"=%)
53 RTE_MACHINE := $(CONFIG_RTE_MACHINE:"%"=%)
54 RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%)
55 RTE_TOOLCHAIN := $(CONFIG_RTE_TOOLCHAIN:"%"=%)