aboutsummaryrefslogtreecommitdiffstats
path: root/build/external/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'build/external/Makefile')
-rw-r--r--build/external/Makefile39
1 files changed, 27 insertions, 12 deletions
diff --git a/build/external/Makefile b/build/external/Makefile
index 55443b0c6c9..046dd7484ae 100644
--- a/build/external/Makefile
+++ b/build/external/Makefile
@@ -12,17 +12,21 @@
# limitations under the License.
# Scripts require non-POSIX parts of bash
-SHELL := /bin/bash
+SHELL := $(shell which bash)
DL_CACHE_DIR = $(HOME)/Downloads
-MAKE ?= make
MAKE_ARGS ?= -j
BUILD_DIR ?= $(CURDIR)/_build
INSTALL_DIR ?= $(CURDIR)/_install
-PKG_VERSION ?= $(shell git describe --abbrev=0 | cut -d- -f1 | cut -dv -f2 | cut -d. -f1,2)
+PKG_VERSION ?= $(shell git describe --abbrev=0 --match 'v[0-9]*' | cut -d- -f1 | cut -dv -f2 | cut -d. -f1,2)
PKG_SUFFIX ?= $(shell git log --oneline v$(PKG_VERSION)-rc0.. . | wc -l)
+SOURCE_DATE_EPOCH ?= $(shell git log -1 --pretty=%ct .)
+ifeq ($shell(uname), FreeBSD)
+JOBS := $(shell nproc)
+else
JOBS := $(if $(shell [ -f /proc/cpuinfo ] && head /proc/cpuinfo),\
$(shell grep -c ^processor /proc/cpuinfo), 2)
+endif # FreeBSD
B := $(BUILD_DIR)
I := $(INSTALL_DIR)
@@ -34,24 +38,35 @@ CMAKE?=cmake
endif
ARCH_X86_64=$(filter x86_64,$(shell uname -m))
+AARCH64=$(filter aarch64,$(shell uname -m))
include packages.mk
-include packages/nasm.mk
include packages/ipsec-mb.mk
include packages/quicly.mk
-include packages/dpdk.mk
+ifneq ($(shell uname), FreeBSD)
include packages/rdma-core.mk
-include packages/libbpf.mk
+include packages/dpdk.mk
+include packages/xdp-tools.mk
+include packages/octeon-roc.mk
+endif # FreeBSD
.PHONY: clean
clean:
@rm -rf $(B) $(I)
.PHONY: install
-install: $(if $(ARCH_X86_64), nasm-install ipsec-mb-install) dpdk-install rdma-core-install quicly-install libbpf-install
+ifeq ($(shell uname), FreeBSD)
+install: $(if $(ARCH_X86_64), ipsec-mb-install) quicly-install
+else
+install: $(if $(ARCH_X86_64), ipsec-mb-install) dpdk-install rdma-core-install quicly-install xdp-tools-install $(if $(AARCH64), octeon-roc-install)
+endif # FreeBSD
.PHONY: config
-config: $(if $(ARCH_X86_64), nasm-config ipsec-mb-config) dpdk-config rdma-core-config quicly-build
+ifeq ($(shell uname), FreeBSD)
+config: $(if $(ARCH_X86_64), ipsec-mb-config) quicly-build
+else
+config: $(if $(ARCH_X86_64), ipsec-mb-config) dpdk-config rdma-core-config quicly-build
+endif # FreeBSD
##############################################################################
# .deb packaging
@@ -69,7 +84,7 @@ deb/debian/changelog: Makefile
@echo "" >> $@
@echo " * Version $(DEB_VER)" >> $@
@echo "" >> $@
- @echo " -- VPP Dev <vpp-dev@lists.fd.io> $(shell date -R)" >> $@
+ @echo " -- VPP Dev <vpp-dev@lists.fd.io> $(shell date -R --date=@${SOURCE_DATE_EPOCH})" >> $@
$(DEV_DEB): deb/debian/changelog
@cd deb && dpkg-buildpackage -b -uc -us
@@ -157,17 +172,17 @@ ifeq ($(INSTALLED_VER)$(INSTALLED_RPM_VER),)
@echo "development package by invoking 'make install-ext-deps'"
@echo "from the top level directory"
@echo "=========================================================="
- make config
+ $(MAKE) config
else
ifneq ($(INSTALLED_VER),)
make check-deb
endif
ifneq ($(INSTALLED_RPM_VER),)
- make check-rpm
+ $(MAKE) check-rpm
endif
endif
ebuild-install:
ifeq ($(INSTALLED_VER)$(INSTALLED_RPM_VER),)
- make install
+ $(MAKE) install
endif