X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=build%2Fexternal%2FMakefile;h=046dd7484ae2fb323a74a5a449bc28be42717610;hb=26eec75f2b30f4c03b4ca671165cd0d4823f0175;hp=1e1f5da1d1f6b2fbab9122956e00ce3db979813c;hpb=01fe7ab88efe1771618358ee5e90f56996ba909e;p=vpp.git diff --git a/build/external/Makefile b/build/external/Makefile index 1e1f5da1d1f..046dd7484ae 100644 --- a/build/external/Makefile +++ b/build/external/Makefile @@ -12,18 +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 --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) @@ -40,20 +43,30 @@ AARCH64=$(filter aarch64,$(shell uname -m)) include packages.mk include packages/ipsec-mb.mk include packages/quicly.mk +ifneq ($(shell uname), FreeBSD) include packages/rdma-core.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 +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 +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 @@ -159,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