VPP requires GNU Make to build, on GNU systems (such as Debian), GNU
Make is installed as 'make', typically with a symlink from 'gmake'.
On other systems (such as FreeBSD), 'make' is a BSD Make derriviative
and GNU Make is installed a 'gmake'.
Use $(MAKE) variable for make calls from within Makefiles. This
variable is set to the path of the calling make program, i.e.,
/usr/local/bin/gmake on a bsd system.
This is the recommended way to call make from Makefiles in the GNU Make
documentation.
Type: improvement
Change-Id: Id9162a34a0f8358f22090718087918dae31c0fce
Signed-off-by: Tom Jones <thj@freebsd.org>
$(BR)/.deps.ok:
ifeq ($(findstring y,$(UNATTENDED)),y)
$(BR)/.deps.ok:
ifeq ($(findstring y,$(UNATTENDED)),y)
endif
ifeq ($(filter ubuntu debian linuxmint,$(OS_ID)),$(OS_ID))
@MISSING=$$(apt-get install -y -qq -s $(DEB_DEPENDS) | grep "^Inst ") ; \
endif
ifeq ($(filter ubuntu debian linuxmint,$(OS_ID)),$(OS_ID))
@MISSING=$$(apt-get install -y -qq -s $(DEB_DEPENDS) | grep "^Inst ") ; \
install-deps: install-dep
define make
install-deps: install-dep
define make
- @make -C $(BR) PLATFORM=$(PLATFORM) TAG=$(1) $(2)
+ @$(MAKE) -C $(BR) PLATFORM=$(PLATFORM) TAG=$(1) $(2)
endef
$(BR)/scripts/.version:
endef
$(BR)/scripts/.version:
export TEST_DIR ?= $(WS_ROOT)/test
define test
export TEST_DIR ?= $(WS_ROOT)/test
define test
- $(if $(filter-out $(2),retest),make -C $(BR) PLATFORM=vpp TAG=$(1) CC=$(CC) vpp-install,)
+ $(if $(filter-out $(2),retest),$(MAKE) -C $(BR) PLATFORM=vpp TAG=$(1) CC=$(CC) vpp-install,)
VPP_BUILD_DIR=$(BR)/build-$(1)-native/vpp \
VPP_BIN=$(BR)/install-$(1)-native/vpp/bin/vpp \
VPP_INSTALL_PATH=$(BR)/install-$(1)-native/ \
VPP_BUILD_DIR=$(BR)/build-$(1)-native/vpp \
VPP_BIN=$(BR)/install-$(1)-native/vpp/bin/vpp \
VPP_INSTALL_PATH=$(BR)/install-$(1)-native/ \
.PHONY: test-wipe-papi
test-wipe-papi:
.PHONY: test-wipe-papi
test-wipe-papi:
- @make -C test wipe-papi
+ @$(MAKE) -C test wipe-papi
.PHONY: test-help
test-help:
.PHONY: test-help
test-help:
.PHONY: test-wipe
test-wipe:
.PHONY: test-wipe
test-wipe:
.PHONY: test-shell
test-shell:
.PHONY: test-shell
test-shell:
.PHONY: test-wipe-cov
test-wipe-cov:
$(call make,$(PLATFORM)_gcov,$(addsuffix -wipe,$(TARGETS)))
.PHONY: test-wipe-cov
test-wipe-cov:
$(call make,$(PLATFORM)_gcov,$(addsuffix -wipe,$(TARGETS)))
+ @$(MAKE) -C test wipe-cov
.PHONY: test-wipe-all
test-wipe-all:
.PHONY: test-wipe-all
test-wipe-all:
+ @$(MAKE) -C test wipe-all
# Note: All python venv consolidated in test/Makefile, test/requirements*.txt
.PHONY: test-checkstyle
test-checkstyle:
$(warning test-checkstyle is deprecated. Running checkstyle-python.")
# Note: All python venv consolidated in test/Makefile, test/requirements*.txt
.PHONY: test-checkstyle
test-checkstyle:
$(warning test-checkstyle is deprecated. Running checkstyle-python.")
- @make -C test checkstyle-python-all
+ @$(MAKE) -C test checkstyle-python-all
# Note: All python venv consolidated in test/Makefile, test/requirements*.txt
.PHONY: test-checkstyle-diff
test-checkstyle-diff:
$(warning test-checkstyle-diff is deprecated. Running checkstyle-python.")
# Note: All python venv consolidated in test/Makefile, test/requirements*.txt
.PHONY: test-checkstyle-diff
test-checkstyle-diff:
$(warning test-checkstyle-diff is deprecated. Running checkstyle-python.")
- @make -C test checkstyle-python-all
+ @$(MAKE) -C test checkstyle-python-all
.PHONY: test-refresh-deps
test-refresh-deps:
.PHONY: test-refresh-deps
test-refresh-deps:
- @make -C test refresh-deps
+ @$(MAKE) -C test refresh-deps
.PHONY: build-coverity
build-coverity:
$(call make,$(PLATFORM)_coverity,install-packages)
.PHONY: build-coverity
build-coverity:
$(call make,$(PLATFORM)_coverity,install-packages)
- @make -C build-root PLATFORM=vpp TAG=vpp_coverity libmemif-install
+ @$(MAKE) -C build-root PLATFORM=vpp TAG=vpp_coverity libmemif-install
.PHONY: debug-release
debug-release:
.PHONY: debug-release
debug-release:
.PHONY: pkg-rpm
pkg-rpm: dist
.PHONY: pkg-rpm
pkg-rpm: dist
.PHONY: pkg-srpm
pkg-srpm: dist
.PHONY: pkg-srpm
pkg-srpm: dist
- make -C extras/rpm srpm
+ $(MAKE) -C extras/rpm srpm
.PHONY: install-ext-deps
install-ext-deps:
.PHONY: install-ext-deps
install-ext-deps:
- make -C build/external install-$(PKG)
+ $(MAKE) -C build/external install-$(PKG)
.PHONY: install-ext-dep
install-ext-dep: install-ext-deps
.PHONY: install-ext-dep
install-ext-dep: install-ext-deps
.PHONY: checkstyle-test
checkstyle-test:
$(warning test-checkstyle is deprecated. Running checkstyle-python.")
.PHONY: checkstyle-test
checkstyle-test:
$(warning test-checkstyle is deprecated. Running checkstyle-python.")
- @make -C test checkstyle-python-all
+ @$(MAKE) -C test checkstyle-python-all
# Note: All python venv consolidated in test/Makefile, test/requirements*.txt
.PHONY: checkstyle-python
checkstyle-python:
# Note: All python venv consolidated in test/Makefile, test/requirements*.txt
.PHONY: checkstyle-python
checkstyle-python:
- @make -C test checkstyle-python-all
+ @$(MAKE) -C test checkstyle-python-all
.PHONY: checkstyle-all
checkstyle-all: checkstyle-commit checkstyle checkstyle-python docs-spell
.PHONY: checkstyle-all
checkstyle-all: checkstyle-commit checkstyle checkstyle-python docs-spell
# Note: All python venv consolidated in test/Makefile, test/requirements*.txt
.PHONY: fixstyle-python
fixstyle-python:
# Note: All python venv consolidated in test/Makefile, test/requirements*.txt
.PHONY: fixstyle-python
fixstyle-python:
- @make -C test fixstyle-python-all
+ @$(MAKE) -C test fixstyle-python-all
.PHONY: checkstyle-api
checkstyle-api:
.PHONY: checkstyle-api
checkstyle-api:
- @make -C $(WS_ROOT)/docs $*
+ @$(MAKE) -C $(WS_ROOT)/docs $*
- @make -C $(WS_ROOT)/docs docs
+ @$(MAKE) -C $(WS_ROOT)/docs docs
.PHONY: pkg-verify
pkg-verify: install-dep $(BR)/.deps.ok install-ext-deps
$(call banner,"Building for PLATFORM=vpp")
.PHONY: pkg-verify
pkg-verify: install-dep $(BR)/.deps.ok install-ext-deps
$(call banner,"Building for PLATFORM=vpp")
- @make -C build-root PLATFORM=vpp TAG=vpp wipe-all install-packages
+ @$(MAKE) -C build-root PLATFORM=vpp TAG=vpp wipe-all install-packages
$(call banner,"Building sample-plugin")
$(call banner,"Building sample-plugin")
- @make -C build-root PLATFORM=vpp TAG=vpp sample-plugin-install
+ @$(MAKE) -C build-root PLATFORM=vpp TAG=vpp sample-plugin-install
$(call banner,"Building libmemif")
$(call banner,"Building libmemif")
- @make -C build-root PLATFORM=vpp TAG=vpp libmemif-install
+ @$(MAKE) -C build-root PLATFORM=vpp TAG=vpp libmemif-install
$(call banner,"Building $(PKG) packages")
$(call banner,"Building $(PKG) packages")
# Note: 'make verify' target is not used by ci-management scripts
MAKE_VERIFY_GATE_OS ?= ubuntu-22.04
# Note: 'make verify' target is not used by ci-management scripts
MAKE_VERIFY_GATE_OS ?= ubuntu-22.04
$(call banner,"Testing vppapigen")
@src/tools/vppapigen/test_vppapigen.py
$(call banner,"Running tests")
$(call banner,"Testing vppapigen")
@src/tools/vppapigen/test_vppapigen.py
$(call banner,"Running tests")
- @make COMPRESS_FAILED_TEST_LOGS=yes RETRIES=3 test
+ @$(MAKE) COMPRESS_FAILED_TEST_LOGS=yes RETRIES=3 test
else
$(call banner,"Skipping tests. Tests under 'make verify' supported on $(MAKE_VERIFY_GATE_OS)")
endif
.PHONY: check-dpdk-mlx
check-dpdk-mlx:
else
$(call banner,"Skipping tests. Tests under 'make verify' supported on $(MAKE_VERIFY_GATE_OS)")
endif
.PHONY: check-dpdk-mlx
check-dpdk-mlx:
- @[ $$(make -sC build/external dpdk-show-DPDK_MLX_DEFAULT) = y ]
+ @[ $$($(MAKE) -sC build/external dpdk-show-DPDK_MLX_DEFAULT) = y ]
-external_install = make $(DPDK_MAKE_ARGS) -C external ebuild-build ebuild-install
+external_install = $(MAKE) $(DPDK_MAKE_ARGS) -C external ebuild-build ebuild-install
CROSS_TOOLS_$(IS_LINUX) += glibc gcc
# must be first for bootstrapping
CROSS_TOOLS_$(IS_LINUX) += glibc gcc
# must be first for bootstrapping
-NATIVE_TOOLS = findutils make
+NATIVE_TOOLS = findutils $(MAKE)
# basic tools needed for build system
NATIVE_TOOLS += git automake autoconf libtool texinfo tar
# basic tools needed for build system
NATIVE_TOOLS += git automake autoconf libtool texinfo tar
-a ! -x "`which 2> /dev/null $${target_gcc}`" ] ; then \
$(call build_msg_fn, \
No cross-compiler found for platform $(PLATFORM) target $(TARGET); \
-a ! -x "`which 2> /dev/null $${target_gcc}`" ] ; then \
$(call build_msg_fn, \
No cross-compiler found for platform $(PLATFORM) target $(TARGET); \
- try make PLATFORM=$(PLATFORM) install-tools) ; \
+ try $(MAKE) PLATFORM=$(PLATFORM) install-tools) ; \
$(call build_msg_fn,Git pull build tools) ; \
$(call tool_make_target_fn,pull-all) ; \
$(call build_msg_fn,Git pull packages for platform $(PLATFORM)) ; \
$(call build_msg_fn,Git pull build tools) ; \
$(call tool_make_target_fn,pull-all) ; \
$(call build_msg_fn,Git pull packages for platform $(PLATFORM)) ; \
- make PLATFORM=$(PLATFORM) $(patsubst %,%-pull-all,$(ROOT_PACKAGES))
+ $(MAKE) PLATFORM=$(PLATFORM) $(patsubst %,%-pull-all,$(ROOT_PACKAGES))
$(patsubst %,%-image_install, \
basic_system \
$(ROOT_PACKAGES)) ; \
$(patsubst %,%-image_install, \
basic_system \
$(ROOT_PACKAGES)) ; \
- : make dev directory ; \
+ : $(MAKE) dev directory ; \
$(linuxrc_makedev) ; \
echo @@@@ Relocating ELF executables to run in / @@@@ ; \
scripts/set-rpath /$(arch_lib_dir):/lib ; \
$(linuxrc_makedev) ; \
echo @@@@ Relocating ELF executables to run in / @@@@ ; \
scripts/set-rpath /$(arch_lib_dir):/lib ; \
SHELL := $(shell which bash)
DL_CACHE_DIR = $(HOME)/Downloads
SHELL := $(shell which bash)
DL_CACHE_DIR = $(HOME)/Downloads
MAKE_ARGS ?= -j
BUILD_DIR ?= $(CURDIR)/_build
INSTALL_DIR ?= $(CURDIR)/_install
MAKE_ARGS ?= -j
BUILD_DIR ?= $(CURDIR)/_build
INSTALL_DIR ?= $(CURDIR)/_install
@echo "development package by invoking 'make install-ext-deps'"
@echo "from the top level directory"
@echo "=========================================================="
@echo "development package by invoking 'make install-ext-deps'"
@echo "from the top level directory"
@echo "=========================================================="
else
ifneq ($(INSTALLED_VER),)
make check-deb
endif
ifneq ($(INSTALLED_RPM_VER),)
else
ifneq ($(INSTALLED_VER),)
make check-deb
endif
ifneq ($(INSTALLED_RPM_VER),)
endif
endif
ebuild-install:
ifeq ($(INSTALLED_VER)$(INSTALLED_RPM_VER),)
endif
endif
ebuild-install:
ifeq ($(INSTALLED_VER)$(INSTALLED_RPM_VER),)
$(PYTHON_DEPENDS): requirements.txt
@bash -c "source $(VENV_PATH)/bin/activate && \
$(PYTHON_DEPENDS): requirements.txt
@bash -c "source $(VENV_PATH)/bin/activate && \
- CUSTOM_COMPILE_COMMAND='make test-refresh-deps (or update requirements.txt)' \
+ CUSTOM_COMPILE_COMMAND='$(MAKE) test-refresh-deps (or update requirements.txt)' \
python3 -m piptools compile -q --generate-hashes requirements.txt --output-file $@"
$(PIP_INSTALL_DONE): $(PIP_TOOLS_INSTALL_DONE) $(PYTHON_DEPENDS)
python3 -m piptools compile -q --generate-hashes requirements.txt --output-file $@"
$(PIP_INSTALL_DONE): $(PIP_TOOLS_INSTALL_DONE) $(PYTHON_DEPENDS)
- make -C . cov-prep test cov-post
+ $(MAKE) -C . cov-prep test cov-post
.PHONY: wipe-cov
wipe-cov: wipe
.PHONY: wipe-cov
wipe-cov: wipe