blob: 230f89047868874264fdad1e8dfe288b1e0996c8 [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
55vpp_configure_depend += dpdk-install
56vpp_configure = \
57 cd $(PACKAGE_BUILD_DIR) && \
58 cmake -G Ninja \
59 -DCMAKE_INSTALL_PREFIX:PATH=$(PACKAGE_INSTALL_DIR) \
60 -DCMAKE_C_FLAGS="$($(TAG)_TAG_CFLAGS)" \
61 -DDPDK_INCLUDE_DIR_HINT="$(PACKAGE_INSTALL_DIR)/../dpdk/include" \
62 -DDPDK_LIB_DIR_HINT="$(PACKAGE_INSTALL_DIR)/../dpdk/lib" \
63 $(call find_source_fn,$(PACKAGE_SOURCE))
64#vpp_make_args = --no-print-directory
65vpp_build = cmake --build $(PACKAGE_BUILD_DIR)
66vpp_install = cmake --build $(PACKAGE_BUILD_DIR) -- install | grep -v 'Set runtime path'
67endif