X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=Makefile;h=fd1d0ff9d4dd6612242fe1d3fc7d6ba5be09ad96;hb=8a1a19b8b661face8ddee1d1c9b1edc1799c9a82;hp=024a139330d28eb59b6b674c76c1e6d95f2a33b1;hpb=ebb27fb4809a51711e05323faccb15165e610e10;p=vpp.git diff --git a/Makefile b/Makefile index 024a139330d..fd1d0ff9d4d 100644 --- a/Makefile +++ b/Makefile @@ -16,21 +16,28 @@ BR=$(WS_ROOT)/build-root CCACHE_DIR?=$(BR)/.ccache V?=0 GDB?=gdb +PLATFORM?=vpp -MINIMAL_STARTUP_CONF="unix { interactive } dpdk { no-pci socket-mem 1024 }" +MINIMAL_STARTUP_CONF="unix { interactive }" GDB_ARGS= -ex "handle SIGUSR1 noprint nostop" DEB_DEPENDS = curl build-essential autoconf automake bison libssl-dev ccache -DEB_DEPENDS += debhelper dkms openjdk-7-jdk git libtool libganglia1-dev libapr1-dev -DEB_DEPENDS += libconfuse-dev git-review +DEB_DEPENDS += debhelper dkms default-jdk git libtool libganglia1-dev libapr1-dev dh-systemd +DEB_DEPENDS += libconfuse-dev git-review exuberant-ctags cscope -ifneq ("$(wildcard $(STARTUP_DIR)/startup.conf),"") +RPM_DEPENDS_GROUPS = 'Development Tools' +RPM_DEPENDS = redhat-lsb glibc-static java-1.8.0-openjdk-devel +RPM_DEPENDS += openssl-devel https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm apr-devel +EPEL_DEPENDS = libconfuse-devel ganglia-devel + +ifneq ($(wildcard $(STARTUP_DIR)/startup.conf),) STARTUP_CONF ?= $(STARTUP_DIR)/startup.conf endif .PHONY: help bootstrap wipe wipe-release build build-release rebuild rebuild-release .PHONY: run run-release debug debug-release build-vat run-vat pkg-deb pkg-rpm +.PHONY: ctags cscope help: @echo "Make Targets:" @@ -50,6 +57,8 @@ help: @echo " run-vat - run vpp-api-test tool" @echo " pkg-deb - build DEB packages" @echo " pkg-rpm - build RPM packages" + @echo " ctags - (re)generate ctags database" + @echo " cscope - (re)generate cscope database" @echo "" @echo "Make Arguments:" @echo " V=[0|1] - set build verbosity level" @@ -59,12 +68,15 @@ help: @echo " It also sets STARTUP_CONF if" @echo " startup.conf file is present" @echo " GDB= - gdb binary to use for debugging" + @echo " PLATFORM= - target platform. default is vpp" @echo "" @echo "Current Argumernt Values:" @echo " V = $(V)" @echo " STARTUP_CONF = $(STARTUP_CONF)" @echo " STARTUP_DIR = $(STARTUP_DIR)" @echo " GDB = $(GDB)" + @echo " PLATFORM = $(PLATFORM)" + @echo " DPDK_VERSION = $(DPDK_VERSION)" $(BR)/.bootstrap.ok: ifeq ("$(shell lsb_release -si)", "Ubuntu") @@ -81,7 +93,7 @@ endif @echo 'export PATH=$(BR)/tools/ccache-bin:$$PATH' >> $(BR)/path_setup @echo 'export PATH=$(BR)/tools/bin:$$PATH' >> $(BR)/path_setup @echo 'export CCACHE_DIR=$(CCACHE_DIR)' >> $(BR)/path_setup - + ifeq ("$(wildcard /usr/bin/ccache )","") @echo "WARNING: Please install ccache AYEC and re-run this script" else @@ -97,28 +109,32 @@ bootstrap: $(BR)/.bootstrap.ok install-dep: ifeq ("$(shell lsb_release -si)", "Ubuntu") - @sudo apt-get install $(DEB_DEPENDS) + @sudo apt-get -y install $(DEB_DEPENDS) +else ifneq ("$(wildcard /etc/redhat-release)","") + @sudo yum groupinstall -y $(RPM_DEPENDS_GROUPS) + @sudo yum install -y $(RPM_DEPENDS) + @sudo yum install -y --enablerepo=epel $(EPEL_DEPENDS) else - $(error "This option currently works only on Ubuntu systems") + $(error "This option currently works only on Ubuntu or Centos systems") endif define make - @make -C $(BR) V=$(V) PLATFORM=vpp TAG=$(1) $(2) + @make -C $(BR) V=$(V) PLATFORM=$(PLATFORM) TAG=$(1) $(2) endef build: $(BR)/.bootstrap.ok - $(call make,vpp_debug,vpp-install) + $(call make,$(PLATFORM)_debug,vpp-install) wipe: $(BR)/.bootstrap.ok - $(call make,vpp_debug,vpp-wipe) + $(call make,$(PLATFORM)_debug,vpp-wipe) rebuild: wipe build build-release: $(BR)/.bootstrap.ok - $(call make,vpp,vpp-install) + $(call make,$(PLATFORM),vpp-install) wipe-release: $(BR)/.bootstrap.ok - $(call make,vpp,vpp-wipe) + $(call make,$(PLATFORM),vpp-wipe) rebuild-release: wipe-release build-release @@ -135,26 +151,40 @@ define run endef endif +%.files: .FORCE + @find . \( -name '*\.[chyS]' -o -name '*\.java' -o -name '*\.lex' \) -and \ + \( -not -path './build-root*' -o -path \ + './build-root/build-vpp_debug-native/dpdk*' \) > $@ + +.FORCE: + run: - $(call run, $(BR)/install-vpp_debug-native/vpp/bin/vpp) + $(call run, $(BR)/install-$(PLATFORM)_debug-native/vpp/bin/vpp) run-release: - $(call run, $(BR)/install-vpp-native/vpp/bin/vpp) + $(call run, $(BR)/install-$(PLATFORM)-native/vpp/bin/vpp) debug: - $(call run, $(GDB) $(GDB_ARGS) --args $(BR)/install-vpp_debug-native/vpp/bin/vpp) + $(call run, $(GDB) $(GDB_ARGS) --args $(BR)/install-$(PLATFORM)_debug-native/vpp/bin/vpp) debug-release: - $(call run, $(GDB) $(GDB_ARGS) --args $(BR)/install-vpp-native/vpp/bin/vpp) + $(call run, $(GDB) $(GDB_ARGS) --args $(BR)/install-$(PLATFORM)-native/vpp/bin/vpp) build-vat: - $(call make,vpp_debug,vpp-api-test-install) + $(call make,$(PLATFORM)_debug,vpp-api-test-install) run-vat: - @sudo $(BR)/install-vpp_debug-native/vpp-api-test/bin/vpp_api_test + @sudo $(BR)/install-$(PLATFORM)_debug-native/vpp-api-test/bin/vpp_api_test pkg-deb: - $(call make,vpp,install-deb) + $(call make,$(PLATFORM),install-deb) pkg-rpm: - $(call make,vpp,install-rpm) + $(call make,$(PLATFORM),install-rpm) + +ctags: ctags.files + @ctags --totals --tag-relative -L $< + @rm $< + +cscope: cscope.files + @cscope -b -q -v