blob: acc0d64257fec32d4c49766ab6a0a8e3b4b6c424 [file] [log] [blame]
msardara8f554b72018-12-11 18:36:55 +01001# Copyright (c) 2017-2018 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.
Damjan Marion23d4e8a2018-03-26 14:09:38 +020013
msardara8f554b72018-12-11 18:36:55 +010014libmemif_source = extras
15libmemif_configure_subdir = libmemif
16
17ifneq ($(shell which cmake3),)
18CMAKE?=cmake3
19else
20CMAKE?=cmake
21endif
22
23libmemif_cmake_args ?=
24libmemif_cmake_args += -DCMAKE_INSTALL_PREFIX:PATH=$(PACKAGE_INSTALL_DIR)
25libmemif_cmake_args += -DCMAKE_C_FLAGS="$($(TAG)_TAG_CFLAGS)"
26libmemif_cmake_args += -DCMAKE_SHARED_LINKER_FLAGS="$($(TAG)_TAG_LDFLAGS)"
27libmemif_cmake_args += -DCMAKE_PREFIX_PATH:PATH="$(PACKAGE_INSTALL_DIR)/../vpp"
28
29# Use devtoolset on centos 7
Damjan Marion162330f2020-04-29 21:28:15 +020030ifneq ($(wildcard /opt/rh/devtoolset-9/enable),)
31libmemif_cmake_args += -DCMAKE_PROGRAM_PATH:PATH="/opt/rh/devtoolset-9/root/bin"
msardara8f554b72018-12-11 18:36:55 +010032endif
33
34libmemif_configure = \
35 cd $(PACKAGE_BUILD_DIR) && \
36 $(CMAKE) -G Ninja $(libmemif_cmake_args) $(call find_source_fn,$(PACKAGE_SOURCE))$(PACKAGE_SUBDIR)
37
38libmemif_build = $(CMAKE) --build $(PACKAGE_BUILD_DIR) -- $(MAKE_PARALLEL_FLAGS)
39
40libmemif_install = $(CMAKE) --build $(PACKAGE_BUILD_DIR) -- install