Mohsin Kazmi | d4d7e8a | 2018-09-03 15:25:43 +0200 | [diff] [blame] | 1 | # 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. |
| 13 | |
Damjan Marion | 164e5f8 | 2018-04-25 19:11:15 +0200 | [diff] [blame] | 14 | vom_configure_depend = vpp-install |
| 15 | vom_source = extras |
| 16 | vom_configure_subdir = vom |
Damjan Marion | 164e5f8 | 2018-04-25 19:11:15 +0200 | [diff] [blame] | 17 | |
Mohsin Kazmi | d4d7e8a | 2018-09-03 15:25:43 +0200 | [diff] [blame] | 18 | ifneq ($(shell which cmake3),) |
| 19 | CMAKE?=cmake3 |
| 20 | else |
| 21 | CMAKE?=cmake |
| 22 | endif |
| 23 | |
| 24 | vom_cmake_args ?= |
| 25 | vom_cmake_args += -DCMAKE_INSTALL_PREFIX:PATH=$(PACKAGE_INSTALL_DIR) |
| 26 | vom_cmake_args += -DCMAKE_CXX_FLAGS="$($(TAG)_TAG_CPPFLAGS)" |
| 27 | vom_cmake_args += -DCMAKE_SHARED_LINKER_FLAGS="$($(TAG)_TAG_LDFLAGS)" |
Damjan Marion | 79dcbc7 | 2018-09-12 14:01:10 +0200 | [diff] [blame] | 28 | vom_cmake_args += -DCMAKE_PREFIX_PATH:PATH="$(PACKAGE_INSTALL_DIR)/../vpp" |
Mohsin Kazmi | d4d7e8a | 2018-09-03 15:25:43 +0200 | [diff] [blame] | 29 | |
| 30 | # Use devtoolset on centos 7 |
Damjan Marion | 162330f | 2020-04-29 21:28:15 +0200 | [diff] [blame] | 31 | ifneq ($(wildcard /opt/rh/devtoolset-9/enable),) |
| 32 | vom_cmake_args += -DCMAKE_PROGRAM_PATH:PATH="/opt/rh/devtoolset-9/root/bin" |
Mohsin Kazmi | d4d7e8a | 2018-09-03 15:25:43 +0200 | [diff] [blame] | 33 | endif |
| 34 | |
| 35 | vom_configure = \ |
| 36 | cd $(PACKAGE_BUILD_DIR) && \ |
| 37 | $(CMAKE) -G Ninja $(vom_cmake_args) $(call find_source_fn,$(PACKAGE_SOURCE))$(PACKAGE_SUBDIR) |
| 38 | |
Neale Ranns | 255299c | 2018-09-10 05:42:56 -0700 | [diff] [blame] | 39 | vom_build = $(CMAKE) --build $(PACKAGE_BUILD_DIR) -- $(MAKE_PARALLEL_FLAGS) |
| 40 | |
Mohsin Kazmi | d4d7e8a | 2018-09-03 15:25:43 +0200 | [diff] [blame] | 41 | vom_install = $(CMAKE) --build $(PACKAGE_BUILD_DIR) -- install |
Mohsin Kazmi | 752f5b4 | 2019-02-12 17:24:17 +0100 | [diff] [blame] | 42 | |
| 43 | vom-package-deb: vom-install |
| 44 | @$(CMAKE) --build $(PACKAGE_BUILD_DIR)/vom -- package |
| 45 | @find $(PACKAGE_BUILD_DIR)/vom -name '*.deb' -exec mv {} $(CURDIR) \; |