span: add feature (rx only) (VPP-185)
[vpp.git] / Makefile
index 3a6c783..4e084d4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,7 @@ endif
 DEB_DEPENDS  = curl build-essential autoconf automake bison libssl-dev ccache
 DEB_DEPENDS += debhelper dkms git libtool libganglia1-dev libapr1-dev dh-systemd
 DEB_DEPENDS += libconfuse-dev git-review exuberant-ctags cscope
-DEB_DEPENDS += python-dev python-virtualenv
+DEB_DEPENDS += python-dev python-virtualenv python-pip
 ifeq ($(OS_VERSION_ID),14.04)
        DEB_DEPENDS += openjdk-8-jdk-headless
 else
@@ -167,10 +167,27 @@ define make
        @make -C $(BR) PLATFORM=$(PLATFORM) TAG=$(1) $(2)
 endef
 
+$(BR)/scripts/.version:
+ifneq ("$(wildcard /etc/redhat-release)","")
+       $(shell $(BR)/scripts/version rpm-string > $(BR)/scripts/.version)
+else
+       $(shell $(BR)/scripts/version > $(BR)/scripts/.version)
+endif
+
+dist:  $(BR)/scripts/.version
+       $(MAKE) verstring=$(PLATFORM)-$(shell cat $(BR)/scripts/.version) prefix=$(PLATFORM) distversion
+
+distversion:   $(BR)/scripts/.version
+       $(BR)/scripts/verdist ${BR} ${prefix}-$(shell $(BR)/scripts/version rpm-version) ${verstring}
+       mv $(verstring).tar.gz $(BR)/rpm
+
 build: $(BR)/.bootstrap.ok
        $(call make,$(PLATFORM)_debug,vpp-install)
 
-wipe: $(BR)/.bootstrap.ok
+wipedist:
+       $(RM) $(BR)/scripts/.version $(BR)/rpm/*.tar.gz
+
+wipe: wipedist $(BR)/.bootstrap.ok
        $(call make,$(PLATFORM)_debug,vpp-wipe)
 
 rebuild: wipe build
@@ -195,7 +212,7 @@ build-vpp-api: $(BR)/.bootstrap.ok
 VPP_PYTHON_PREFIX=$(BR)/python
 
 define test
-       $(if $(filter-out $(3),retest),make -C $(BR) PLATFORM=$(1) TAG=$(2) vpp-api-install plugins-install vpp-install vpp-api-test-install,)
+       $(if $(filter-out $(3),retest),make -C $(BR) PLATFORM=$(1) TAG=$(2) vpp-api-install plugins-install vpp-install,)
        make -C test \
          VPP_TEST_BIN=$(BR)/install-$(2)-native/vpp/bin/vpp \
          VPP_TEST_API_TEST_BIN=$(BR)/install-$(2)-native/vpp-api-test/bin/vpp_api_test \
@@ -271,7 +288,7 @@ run-vat:
 pkg-deb:
        $(call make,$(PLATFORM),install-deb)
 
-pkg-rpm:
+pkg-rpm: dist
        $(call make,$(PLATFORM),install-rpm)
 
 ctags: ctags.files
@@ -312,3 +329,24 @@ doxygen:
 wipe-doxygen:
        $(call make-doxy)
 
+define banner
+       @echo "========================================================================"
+       @echo " $(1)"
+       @echo "========================================================================"
+       @echo " "
+endef
+
+verify: $(BR)/.bootstrap.ok
+ifeq ($(OS_ID),ubuntu)
+ifeq ($(OS_VERSION_ID),16.04)
+       $(call banner,"Installing dependencies")
+       @sudo -E apt-get update
+       @sudo -E apt-get $(CONFIRM) $(FORCE) install clang
+       $(call banner,"Building for PLATFORM=vpp using clang")
+       @make -C build-root CC=clang PLATFORM=vpp TAG=vpp_clang wipe-all install-packages
+endif
+endif
+       $(call banner,"Building for PLATFORM=vpp using gcc")
+       @make -C build-root PLATFORM=vpp TAG=vpp wipe-all install-packages
+       $(call banner,"Building for PLATFORM=vpp_lite using gcc")
+       @make -C build-root PLATFORM=vpp_lite TAG=vpp_lite wipe-all install-packages