blob: 4002cbcf57f3d028a2a9a123d236c4d9781d216e [file] [log] [blame]
Dave Barach8d0f2f02018-03-12 09:31:36 -04001# Copyright (c) 2015 Cisco and/or its affiliates.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at:
5#
6# http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
Damjan Marion7cd468a2016-12-19 23:05:39 +010014vpp_source = src
Damjan Marion612dd6a2018-07-30 12:45:07 +020015ifneq ($(vpp_uses_cmake),yes)
Ed Warnickecb9cada2015-12-08 15:45:58 -070016
Damjan Marion28e3db92016-04-01 12:35:17 +020017ifeq ($($(PLATFORM)_dpdk_shared_lib),yes)
18vpp_configure_args = --enable-dpdk-shared
19else
20vpp_configure_args =
21endif
Ed Warnickecb9cada2015-12-08 15:45:58 -070022
23# Platform dependent configure flags
24vpp_configure_args += $(vpp_configure_args_$(PLATFORM))
25
26
Damjan Marion7cd468a2016-12-19 23:05:39 +010027vpp_CPPFLAGS =
28vpp_LDFLAGS =
Christophe Fontainefef15b42016-04-09 12:38:49 +090029
Damjan Marion802c7fa2016-02-27 00:12:55 +010030ifneq ($($(PLATFORM)_uses_dpdk),no)
Damjan Marion28e3db92016-04-01 12:35:17 +020031ifeq ($($(PLATFORM)_uses_external_dpdk),yes)
32vpp_CPPFLAGS += -I$($(PLATFORM)_dpdk_inc_dir)
33vpp_LDFLAGS += -L$($(PLATFORM)_dpdk_lib_dir)
34else
Damjan Marione936bbe2016-02-25 23:17:38 +010035vpp_configure_depend += dpdk-install
Damjan Marion2ce7f982017-01-09 20:24:50 +010036vpp_CPPFLAGS += $(call installed_includes_fn, dpdk)/dpdk
Damjan Marione936bbe2016-02-25 23:17:38 +010037vpp_LDFLAGS += $(call installed_libs_fn, dpdk)
Damjan Marion2ce7f982017-01-09 20:24:50 +010038vpp_CPPFLAGS += -I/usr/include/dpdk
Damjan Marione936bbe2016-02-25 23:17:38 +010039endif
Damjan Marion696f1ad2016-12-23 22:42:41 +010040ifeq ($($(PLATFORM)_uses_dpdk_mlx5_pmd),yes)
41vpp_configure_args += --with-dpdk-mlx5-pmd
42endif
Rui Cai60bd3022018-05-11 21:52:22 +000043ifeq ($($(PLATFORM)_uses_dpdk_mlx4_pmd),yes)
44vpp_configure_args += --with-dpdk-mlx4-pmd
45endif
Marco Varleseedfa2fd2017-09-01 14:47:53 +020046else
47vpp_configure_args += --disable-dpdk-plugin
Damjan Marion28e3db92016-04-01 12:35:17 +020048endif
Filip Tehlar816f4372017-04-26 16:09:06 +020049
50ifeq ($($(PLATFORM)_enable_tests),yes)
51vpp_configure_args += --enable-tests
52endif
Damjan Marion612dd6a2018-07-30 12:45:07 +020053
54else
Damjan Marionad1e1c52018-09-01 20:06:10 +020055ifneq ($(shell which cmake3),)
56CMAKE?=cmake3
57else
58CMAKE?=cmake
59endif
60
61vpp_cmake_args ?=
62vpp_cmake_args += -DCMAKE_INSTALL_PREFIX:PATH=$(PACKAGE_INSTALL_DIR)
63vpp_cmake_args += -DCMAKE_C_FLAGS="$($(TAG)_TAG_CFLAGS)"
64vpp_cmake_args += -DCMAKE_LINKER_FLAGS="$($(TAG)_TAG_LDFLAGS)"
65vpp_cmake_args += -DDPDK_INCLUDE_DIR_HINT="$(PACKAGE_INSTALL_DIR)/../dpdk/include"
66vpp_cmake_args += -DDPDK_LIB_DIR_HINT="$(PACKAGE_INSTALL_DIR)/../dpdk/lib"
67
68# Use devtoolset on centos 7
69ifneq ($(wildcard /opt/rh/devtoolset-7/enable),)
70vpp_cmake_args += -DCMAKE_PROGRAM_PATH:PATH="/opt/rh/devtoolset-7/root/bin"
71endif
72
Damjan Marion612dd6a2018-07-30 12:45:07 +020073vpp_configure_depend += dpdk-install
74vpp_configure = \
75 cd $(PACKAGE_BUILD_DIR) && \
Damjan Marionad1e1c52018-09-01 20:06:10 +020076 $(CMAKE) -G Ninja $(vpp_cmake_args) $(call find_source_fn,$(PACKAGE_SOURCE))
Damjan Marion612dd6a2018-07-30 12:45:07 +020077#vpp_make_args = --no-print-directory
Damjan Marionad1e1c52018-09-01 20:06:10 +020078vpp_build = $(CMAKE) --build $(PACKAGE_BUILD_DIR)
79vpp_install = $(CMAKE) --build $(PACKAGE_BUILD_DIR) -- install | grep -v 'Set runtime path'
Damjan Marion612dd6a2018-07-30 12:45:07 +020080endif