blob: 34188f9e7a7df134257d94af69bf6b33857b3cd2 [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 Marion686c1c82017-04-19 14:09:07 +020014sample-plugin_source = src
15sample-plugin_configure_subdir = examples/sample-plugin
16sample-plugin_configure_depend = vpp-install
17sample-plugin_CPPFLAGS = $(call installed_includes_fn, vpp)
18sample-plugin_LDFLAGS = $(call installed_libs_fn, vpp)
Damjan Marion92b44ea2018-03-14 22:09:22 +010019sample-plugin_PATH = $(call package_install_dir_fn,vpp)/bin
Damjan Marion0fa900e2018-09-12 12:12:36 +020020
21ifneq ($(shell which cmake3),)
22CMAKE?=cmake3
23else
24CMAKE?=cmake
25endif
26
27sample-plugin_cmake_args ?=
28sample-plugin_cmake_args += -DCMAKE_INSTALL_PREFIX:PATH=$(PACKAGE_INSTALL_DIR)
29sample-plugin_cmake_args += -DCMAKE_C_FLAGS="$($(TAG)_TAG_CFLAGS)"
30sample-plugin_cmake_args += -DCMAKE_SHARED_LINKER_FLAGS="$($(TAG)_TAG_LDFLAGS)"
31sample-plugin_cmake_args += -DCMAKE_PREFIX_PATH:PATH="$(PACKAGE_INSTALL_DIR)/../vpp"
32
33# Use devtoolset on centos 7
Damjan Marion162330f2020-04-29 21:28:15 +020034ifneq ($(wildcard /opt/rh/devtoolset-9/enable),)
35sample-plugin_cmake_args += -DCMAKE_PROGRAM_PATH:PATH="/opt/rh/devtoolset-9/root/bin"
Damjan Marion0fa900e2018-09-12 12:12:36 +020036endif
37
38sample-plugin_configure = \
39 cd $(PACKAGE_BUILD_DIR) && \
40 $(CMAKE) -G Ninja $(sample-plugin_cmake_args) \
41 $(call find_source_fn,$(PACKAGE_SOURCE))$(PACKAGE_SUBDIR)
42
43sample-plugin_build = $(CMAKE) --build $(PACKAGE_BUILD_DIR) -- $(MAKE_PARALLEL_FLAGS)
44
45sample-plugin_install = $(CMAKE) --build $(PACKAGE_BUILD_DIR) -- install