Dave Barach | 8d0f2f0 | 2018-03-12 09:31:36 -0400 | [diff] [blame] | 1 | # 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 Marion | 686c1c8 | 2017-04-19 14:09:07 +0200 | [diff] [blame] | 14 | sample-plugin_source = src |
| 15 | sample-plugin_configure_subdir = examples/sample-plugin |
| 16 | sample-plugin_configure_depend = vpp-install |
| 17 | sample-plugin_CPPFLAGS = $(call installed_includes_fn, vpp) |
| 18 | sample-plugin_LDFLAGS = $(call installed_libs_fn, vpp) |
Damjan Marion | 92b44ea | 2018-03-14 22:09:22 +0100 | [diff] [blame] | 19 | sample-plugin_PATH = $(call package_install_dir_fn,vpp)/bin |
Damjan Marion | 0fa900e | 2018-09-12 12:12:36 +0200 | [diff] [blame] | 20 | |
| 21 | ifneq ($(shell which cmake3),) |
| 22 | CMAKE?=cmake3 |
| 23 | else |
| 24 | CMAKE?=cmake |
| 25 | endif |
| 26 | |
| 27 | sample-plugin_cmake_args ?= |
| 28 | sample-plugin_cmake_args += -DCMAKE_INSTALL_PREFIX:PATH=$(PACKAGE_INSTALL_DIR) |
| 29 | sample-plugin_cmake_args += -DCMAKE_C_FLAGS="$($(TAG)_TAG_CFLAGS)" |
| 30 | sample-plugin_cmake_args += -DCMAKE_SHARED_LINKER_FLAGS="$($(TAG)_TAG_LDFLAGS)" |
| 31 | sample-plugin_cmake_args += -DCMAKE_PREFIX_PATH:PATH="$(PACKAGE_INSTALL_DIR)/../vpp" |
| 32 | |
| 33 | # Use devtoolset on centos 7 |
| 34 | ifneq ($(wildcard /opt/rh/devtoolset-7/enable),) |
| 35 | sample-plugin_cmake_args += -DCMAKE_PROGRAM_PATH:PATH="/opt/rh/devtoolset-7/root/bin" |
| 36 | endif |
| 37 | |
| 38 | sample-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 | |
| 43 | sample-plugin_build = $(CMAKE) --build $(PACKAGE_BUILD_DIR) -- $(MAKE_PARALLEL_FLAGS) |
| 44 | |
| 45 | sample-plugin_install = $(CMAKE) --build $(PACKAGE_BUILD_DIR) -- install |