|
| 1 | +# SPDX-License-Identifier: Apache-2.0 |
| 2 | +# Copyright (c) 2024 Marvell. |
| 3 | + |
| 4 | +DAO_DEBUG ?= n |
| 5 | +octeon-dao_version := dao-cn10k-26.02.0-ubuntu-24.04-26.02.0 |
| 6 | +octeon-dao_tarball := $(octeon-dao_version).tar.gz |
| 7 | +octeon-dao_tarball_sha256sum := 0bd606591bd9d42d6b04d656da2ca4bbf4b5c66762e4acaf93664ad1a505f387 |
| 8 | + |
| 9 | +octeon-dao_tarball_strip_dirs := 1 |
| 10 | +octeon-dao_url := https://github.com/MarvellEmbeddedProcessors/dao/archive/refs/tags/$(octeon-dao_tarball) |
| 11 | + |
| 12 | +octeon_dao_cmake_args ?= |
| 13 | + |
| 14 | +DAO_BUILD_TYPE:=release |
| 15 | +ifeq ($(DAO_DEBUG), y) |
| 16 | +DAO_BUILD_TYPE:=debug |
| 17 | +endif |
| 18 | + |
| 19 | +DAO_MESON_ARGS = \ |
| 20 | + --default-library static \ |
| 21 | + -Dprefer_static_build=true --prefer-static \ |
| 22 | + -Denable_apps=virtio-l2fwd \ |
| 23 | + -Denable_libs=virtio,virtio_net,vfio,pem,pal,common \ |
| 24 | + --buildtype=$(DAO_BUILD_TYPE) \ |
| 25 | + -Denable_kmods=false |
| 26 | + |
| 27 | +PREFIX = $(OCTEON_SDK_SYSROOT) |
| 28 | + |
| 29 | +ifeq (,$(findstring $(OCTEON_VERSION),cn10k cn9k)) |
| 30 | + DAO_MESON_ARGS += -Dplatform=native |
| 31 | + DAO_MESON_ARGS += --prefix $(octeon-dao_install_dir) |
| 32 | + PREFIX = $(octeon-dao_install_dir) |
| 33 | +else ifeq ($(OCTEON_VERSION), cn10k) |
| 34 | + DAO_MESON_ARGS += --cross-file=$(octeon-dao_src_dir)/config/arm64_cn10k_linux_gcc |
| 35 | + DAO_MESON_ARGS += --prefix $(OCTEON_SDK_SYSROOT) |
| 36 | +else ifeq ($(OCTEON_VERSION), cn9k) |
| 37 | + DAO_MESON_ARGS += --cross-file=$(octeon-dao_src_dir)/config/arm64_cn9k_linux_gcc |
| 38 | + DAO_MESON_ARGS += --prefix $(OCTEON_SDK_SYSROOT) |
| 39 | +endif |
| 40 | + |
| 41 | +PIP_DOWNLOAD_DIR = $(CURDIR)/downloads/ |
| 42 | + |
| 43 | +define octeon-dao_config_cmds |
| 44 | + PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig meson setup $(octeon-dao_src_dir) \ |
| 45 | + $(octeon-dao_build_dir) \ |
| 46 | + $(DAO_MESON_ARGS) -Dc_args="-Wno-error" -Dc_link_args="-Wno-error"\ |
| 47 | + | tee $(dao_config_log) && \ |
| 48 | + echo "DAO post meson configuration" |
| 49 | +endef |
| 50 | + |
| 51 | +define octeon-dao_build_cmds |
| 52 | + cd ${octeon-dao_build_dir} && rm -f $(octeon-dao_build_log) && \ |
| 53 | + ninja install -C ${octeon-dao_build_dir} | tee $(octeon-dao_build_log) |
| 54 | +endef |
| 55 | + |
| 56 | +define octeon-dao_install_cmds |
| 57 | + cd ${octeon-dao_build_dir} && \ |
| 58 | + meson install &&\ |
| 59 | + echo "meson installed directory ${octeon-dao_install_dir}" |
| 60 | +endef |
| 61 | + |
| 62 | +$(eval $(call package,octeon-dao)) |
0 commit comments