X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=Makefile;h=024a139330d28eb59b6b674c76c1e6d95f2a33b1;hb=988a7c482ce1c7685816b238ac776b03c237ed8e;hp=b7c3e27fd22ff319e27545b940e1201dd0ea8124;hpb=e17fdb5ddfdd4275e785bf4266653243e76e000d;p=vpp.git diff --git a/Makefile b/Makefile index b7c3e27fd22..024a139330d 100644 --- a/Makefile +++ b/Makefile @@ -19,10 +19,15 @@ GDB?=gdb MINIMAL_STARTUP_CONF="unix { interactive } dpdk { no-pci socket-mem 1024 }" +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 +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 @@ -30,6 +35,7 @@ DEB_DEPENDS += libconfuse-dev git-review help: @echo "Make Targets:" @echo " bootstrap - prepare tree for build" + @echo " install-dep - install software dependencies" @echo " wipe - wipe all products of debug build " @echo " wipe-release - wipe all products of release build " @echo " build - build debug binaries" @@ -49,11 +55,15 @@ help: @echo " V=[0|1] - set build verbosity level" @echo " STARTUP_CONF= - startup configuration file" @echo " (e.g. /etc/vpp/startup.conf)" + @echo " STARTUP_DIR= - startup drectory (e.g. /etc/vpp)" + @echo " It also sets STARTUP_CONF if" + @echo " startup.conf file is present" @echo " GDB= - gdb binary to use for debugging" @echo "" @echo "Current Argumernt Values:" @echo " V = $(V)" @echo " STARTUP_CONF = $(STARTUP_CONF)" + @echo " STARTUP_DIR = $(STARTUP_DIR)" @echo " GDB = $(GDB)" $(BR)/.bootstrap.ok: @@ -61,6 +71,7 @@ ifeq ("$(shell lsb_release -si)", "Ubuntu") @MISSING=$$(apt-get install -y -qq -s $(DEB_DEPENDS) | grep "^Inst ") ; \ if [ -n "$$MISSING" ] ; then \ echo "\nPlease install missing packages: \n$$MISSING\n" ; \ + echo "by executing \"make install-dep\"\n" ; \ exit 1 ; \ fi ; \ exit 0 @@ -84,6 +95,13 @@ endif bootstrap: $(BR)/.bootstrap.ok +install-dep: +ifeq ("$(shell lsb_release -si)", "Ubuntu") + @sudo apt-get install $(DEB_DEPENDS) +else + $(error "This option currently works only on Ubuntu systems") +endif + define make @make -C $(BR) V=$(V) PLATFORM=vpp TAG=$(1) $(2) endef @@ -104,15 +122,16 @@ wipe-release: $(BR)/.bootstrap.ok rebuild-release: wipe-release build-release +STARTUP_DIR ?= $(PWD) ifeq ("$(wildcard $(STARTUP_CONF))","") define run @echo "WARNING: STARTUP_CONF not defined or file doesn't exist." @echo " Running with minimal startup config: $(MINIMAL_STARTUP_CONF)\n" - @sudo $(1) $(MINIMAL_STARTUP_CONF) + @cd $(STARTUP_DIR) && sudo $(1) $(MINIMAL_STARTUP_CONF) endef else define run - @sudo $(1) -c $(STARTUP_CONF) + @cd $(STARTUP_DIR) && sudo $(1) -c $(STARTUP_CONF) endef endif @@ -123,10 +142,10 @@ run-release: $(call run, $(BR)/install-vpp-native/vpp/bin/vpp) debug: - $(call run, $(GDB) --args $(BR)/install-vpp_debug-native/vpp/bin/vpp) + $(call run, $(GDB) $(GDB_ARGS) --args $(BR)/install-vpp_debug-native/vpp/bin/vpp) debug-release: - $(call run, $(GDB) --args $(BR)/install-vpp-native/vpp/bin/vpp) + $(call run, $(GDB) $(GDB_ARGS) --args $(BR)/install-vpp-native/vpp/bin/vpp) build-vat: $(call make,vpp_debug,vpp-api-test-install)