blob: 546164c0d16ebdff296289c3019630cb4499e450 [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
Damjan Marion0fa900e2018-09-12 12:12:36 +020033sample-plugin_configure = \
34 cd $(PACKAGE_BUILD_DIR) && \
35 $(CMAKE) -G Ninja $(sample-plugin_cmake_args) \
36 $(call find_source_fn,$(PACKAGE_SOURCE))$(PACKAGE_SUBDIR)
37
38sample-plugin_build = $(CMAKE) --build $(PACKAGE_BUILD_DIR) -- $(MAKE_PARALLEL_FLAGS)
39
40sample-plugin_install = $(CMAKE) --build $(PACKAGE_BUILD_DIR) -- install