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 | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 14 | vpp_source = src |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 15 | |
Damjan Marion | ad1e1c5 | 2018-09-01 20:06:10 +0200 | [diff] [blame] | 16 | ifneq ($(shell which cmake3),) |
| 17 | CMAKE?=cmake3 |
| 18 | else |
| 19 | CMAKE?=cmake |
| 20 | endif |
| 21 | |
Damjan Marion | 4a6cb83 | 2018-09-18 18:41:38 +0200 | [diff] [blame] | 22 | vpp_cmake_prefix_path = /opt/vpp/external/$(shell uname -m) |
| 23 | vpp_cmake_prefix_path += $(PACKAGE_INSTALL_DIR)external |
| 24 | vpp_cmake_prefix_path := $(subst $() $(),;,$(vpp_cmake_prefix_path)) |
| 25 | |
Damjan Marion | ad1e1c5 | 2018-09-01 20:06:10 +0200 | [diff] [blame] | 26 | vpp_cmake_args ?= |
| 27 | vpp_cmake_args += -DCMAKE_INSTALL_PREFIX:PATH=$(PACKAGE_INSTALL_DIR) |
Damjan Marion | 2baa115 | 2019-11-07 11:32:16 +0100 | [diff] [blame] | 28 | vpp_cmake_args += -DCMAKE_BUILD_TYPE="$($(TAG)_TAG_BUILD_TYPE)" |
Damjan Marion | 4a6cb83 | 2018-09-18 18:41:38 +0200 | [diff] [blame] | 29 | vpp_cmake_args += -DCMAKE_PREFIX_PATH:PATH="$(vpp_cmake_prefix_path)" |
Lijian Zhang | 2e08b1a | 2018-09-20 18:40:56 +0800 | [diff] [blame] | 30 | ifeq ("$(V)","1") |
| 31 | vpp_cmake_args += -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON |
| 32 | endif |
Damjan Marion | 01fe7ab | 2023-10-23 18:36:18 +0200 | [diff] [blame] | 33 | ifneq ($(VPP_PLATFORM),) |
| 34 | vpp_cmake_args += -DVPP_PLATFORM="$(VPP_PLATFORM)" |
| 35 | endif |
Andrew Yourtchenko | bc37878 | 2023-09-26 16:01:21 +0200 | [diff] [blame] | 36 | ifneq ($(VPP_EXCLUDED_PLUGINS),) |
| 37 | vpp_cmake_args += -DVPP_EXCLUDED_PLUGINS="$(VPP_EXCLUDED_PLUGINS)" |
| 38 | endif |
Andrew Yourtchenko | 5ca8bfc | 2023-10-18 21:18:32 +0000 | [diff] [blame] | 39 | ifneq (${SOURCE_DATE_EPOCH}),) |
| 40 | vpp_cmake_args += -DVPP_SOURCE_DATE_EPOCH="$(SOURCE_DATE_EPOCH)" |
| 41 | endif |
Damjan Marion | ad1e1c5 | 2018-09-01 20:06:10 +0200 | [diff] [blame] | 42 | |
Nathan Skrzypczak | 2973654 | 2019-09-16 16:26:58 +0200 | [diff] [blame] | 43 | ifneq ($(VPP_EXTRA_CMAKE_ARGS),) |
| 44 | vpp_cmake_args += $(VPP_EXTRA_CMAKE_ARGS) |
| 45 | endif |
| 46 | |
Damjan Marion | 4a6cb83 | 2018-09-18 18:41:38 +0200 | [diff] [blame] | 47 | vpp_configure_depend += external-install |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 48 | vpp_configure = \ |
| 49 | cd $(PACKAGE_BUILD_DIR) && \ |
Damjan Marion | ad1e1c5 | 2018-09-01 20:06:10 +0200 | [diff] [blame] | 50 | $(CMAKE) -G Ninja $(vpp_cmake_args) $(call find_source_fn,$(PACKAGE_SOURCE)) |
juraj.linkes | 1c887d9 | 2019-08-08 15:59:10 +0200 | [diff] [blame] | 51 | vpp_build = $(CMAKE) --build $(PACKAGE_BUILD_DIR) -- $(MAKE_PARALLEL_FLAGS) |
Damjan Marion | ad1e1c5 | 2018-09-01 20:06:10 +0200 | [diff] [blame] | 52 | vpp_install = $(CMAKE) --build $(PACKAGE_BUILD_DIR) -- install | grep -v 'Set runtime path' |
Damjan Marion | 4d2f86a | 2019-01-18 13:28:22 +0100 | [diff] [blame] | 53 | |
| 54 | vpp-package-deb: vpp-install |
Damjan Marion | 88b2e36 | 2021-04-29 18:47:25 +0200 | [diff] [blame] | 55 | @$(CMAKE) --build $(PACKAGE_BUILD_DIR)/vpp -- pkg-deb |
Damjan Marion | 4d2f86a | 2019-01-18 13:28:22 +0100 | [diff] [blame] | 56 | @find $(PACKAGE_BUILD_DIR) \ |
Damjan Marion | 88b2e36 | 2021-04-29 18:47:25 +0200 | [diff] [blame] | 57 | -maxdepth 2 \ |
Damjan Marion | 4d2f86a | 2019-01-18 13:28:22 +0100 | [diff] [blame] | 58 | \( -name '*.changes' -o -name '*.deb' -o -name '*.buildinfo' \) \ |
| 59 | -exec mv {} $(CURDIR) \; |