cmake: fix errors in external when building past point-release
[vpp.git] / build / external / Makefile
index 0c2d837..bc54efe 100644 (file)
@@ -19,7 +19,7 @@ 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)
+PKG_VERSION ?= $(shell git describe --abbrev=0 | cut -d- -f1 | cut -dv -f2 | cut -d. -f1,2)
 PKG_SUFFIX ?= $(shell git log --oneline v$(PKG_VERSION)-rc0.. . | wc -l)
 JOBS := $(if $(shell [ -f /proc/cpuinfo ] && head /proc/cpuinfo),\
        $(shell grep -c ^processor /proc/cpuinfo), 2)
@@ -27,6 +27,12 @@ JOBS := $(if $(shell [ -f /proc/cpuinfo ] && head /proc/cpuinfo),\
 B := $(BUILD_DIR)
 I := $(INSTALL_DIR)
 
+ifneq ($(shell which cmake3),)
+CMAKE?=cmake3
+else
+CMAKE?=cmake
+endif
+
 include packages.mk
 include packages/nasm.mk
 include packages/ipsec-mb.mk
@@ -64,7 +70,7 @@ deb/debian/changelog: Makefile
 
 $(DEV_DEB): deb/debian/changelog
        @cd deb && dpkg-buildpackage -b -uc -us
-       @git clean -ffdx deb
+       git clean -fdx deb
 
 build-deb: $(DEV_DEB)
 
@@ -108,7 +114,7 @@ $(DEV_RPM): Makefile rpm/vpp-ext-deps.spec
          --define "_release $(PKG_SUFFIX)" \
          $(CURDIR)/rpm/vpp-ext-deps.spec
        mv rpm/RPMS/$(RPM_ARCH)/*.rpm .
-       @git clean -ffdx rpm
+       @git clean -fdx rpm
 
 build-rpm: $(DEV_RPM)