Few additions to top-level Makefile
* Added option to specify target platform (e.g. export PLATFORM=vpp_lite) * Added ctags targed to (re)build ctags database * Added cscope targed to (re)build cscope database Change-Id: I93feb7b458abe9fbd93000f75b7be24e3865f089 Signed-off-by: Damjan Marion <damarion@cisco.com>
This commit is contained in:

committed by
Gerrit Code Review

parent
048ee2ebe5
commit
e6f9023ff0
48
Makefile
48
Makefile
@ -16,6 +16,7 @@ BR=$(WS_ROOT)/build-root
|
|||||||
CCACHE_DIR?=$(BR)/.ccache
|
CCACHE_DIR?=$(BR)/.ccache
|
||||||
V?=0
|
V?=0
|
||||||
GDB?=gdb
|
GDB?=gdb
|
||||||
|
PLATFORM?=vpp
|
||||||
|
|
||||||
MINIMAL_STARTUP_CONF="unix { interactive } dpdk { no-pci socket-mem 1024 }"
|
MINIMAL_STARTUP_CONF="unix { interactive } dpdk { no-pci socket-mem 1024 }"
|
||||||
|
|
||||||
@ -23,7 +24,7 @@ GDB_ARGS= -ex "handle SIGUSR1 noprint nostop"
|
|||||||
|
|
||||||
DEB_DEPENDS = curl build-essential autoconf automake bison libssl-dev ccache
|
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 += debhelper dkms openjdk-7-jdk git libtool libganglia1-dev libapr1-dev
|
||||||
DEB_DEPENDS += libconfuse-dev git-review
|
DEB_DEPENDS += libconfuse-dev git-review exuberant-ctags cscope
|
||||||
|
|
||||||
ifneq ("$(wildcard $(STARTUP_DIR)/startup.conf),"")
|
ifneq ("$(wildcard $(STARTUP_DIR)/startup.conf),"")
|
||||||
STARTUP_CONF ?= $(STARTUP_DIR)/startup.conf
|
STARTUP_CONF ?= $(STARTUP_DIR)/startup.conf
|
||||||
@ -31,6 +32,7 @@ endif
|
|||||||
|
|
||||||
.PHONY: help bootstrap wipe wipe-release build build-release rebuild rebuild-release
|
.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: run run-release debug debug-release build-vat run-vat pkg-deb pkg-rpm
|
||||||
|
.PHONY: ctags cscope
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@echo "Make Targets:"
|
@echo "Make Targets:"
|
||||||
@ -50,6 +52,8 @@ help:
|
|||||||
@echo " run-vat - run vpp-api-test tool"
|
@echo " run-vat - run vpp-api-test tool"
|
||||||
@echo " pkg-deb - build DEB packages"
|
@echo " pkg-deb - build DEB packages"
|
||||||
@echo " pkg-rpm - build RPM packages"
|
@echo " pkg-rpm - build RPM packages"
|
||||||
|
@echo " ctags - (re)generate ctags database"
|
||||||
|
@echo " cscope - (re)generate cscope database"
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "Make Arguments:"
|
@echo "Make Arguments:"
|
||||||
@echo " V=[0|1] - set build verbosity level"
|
@echo " V=[0|1] - set build verbosity level"
|
||||||
@ -59,12 +63,14 @@ help:
|
|||||||
@echo " It also sets STARTUP_CONF if"
|
@echo " It also sets STARTUP_CONF if"
|
||||||
@echo " startup.conf file is present"
|
@echo " startup.conf file is present"
|
||||||
@echo " GDB=<path> - gdb binary to use for debugging"
|
@echo " GDB=<path> - gdb binary to use for debugging"
|
||||||
|
@echo " PLATFORM=<name> - target platform. default is vpp"
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "Current Argumernt Values:"
|
@echo "Current Argumernt Values:"
|
||||||
@echo " V = $(V)"
|
@echo " V = $(V)"
|
||||||
@echo " STARTUP_CONF = $(STARTUP_CONF)"
|
@echo " STARTUP_CONF = $(STARTUP_CONF)"
|
||||||
@echo " STARTUP_DIR = $(STARTUP_DIR)"
|
@echo " STARTUP_DIR = $(STARTUP_DIR)"
|
||||||
@echo " GDB = $(GDB)"
|
@echo " GDB = $(GDB)"
|
||||||
|
@echo " PLATFORM = $(PLATFORM)"
|
||||||
|
|
||||||
$(BR)/.bootstrap.ok:
|
$(BR)/.bootstrap.ok:
|
||||||
ifeq ("$(shell lsb_release -si)", "Ubuntu")
|
ifeq ("$(shell lsb_release -si)", "Ubuntu")
|
||||||
@ -103,22 +109,22 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
define make
|
define make
|
||||||
@make -C $(BR) V=$(V) PLATFORM=vpp TAG=$(1) $(2)
|
@make -C $(BR) V=$(V) PLATFORM=$(PLATFORM) TAG=$(1) $(2)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
build: $(BR)/.bootstrap.ok
|
build: $(BR)/.bootstrap.ok
|
||||||
$(call make,vpp_debug,vpp-install)
|
$(call make,$(PLATFORM)_debug,vpp-install)
|
||||||
|
|
||||||
wipe: $(BR)/.bootstrap.ok
|
wipe: $(BR)/.bootstrap.ok
|
||||||
$(call make,vpp_debug,vpp-wipe)
|
$(call make,$(PLATFORM)_debug,vpp-wipe)
|
||||||
|
|
||||||
rebuild: wipe build
|
rebuild: wipe build
|
||||||
|
|
||||||
build-release: $(BR)/.bootstrap.ok
|
build-release: $(BR)/.bootstrap.ok
|
||||||
$(call make,vpp,vpp-install)
|
$(call make,$(PLATFORM),vpp-install)
|
||||||
|
|
||||||
wipe-release: $(BR)/.bootstrap.ok
|
wipe-release: $(BR)/.bootstrap.ok
|
||||||
$(call make,vpp,vpp-wipe)
|
$(call make,$(PLATFORM),vpp-wipe)
|
||||||
|
|
||||||
rebuild-release: wipe-release build-release
|
rebuild-release: wipe-release build-release
|
||||||
|
|
||||||
@ -135,26 +141,40 @@ define run
|
|||||||
endef
|
endef
|
||||||
endif
|
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:
|
run:
|
||||||
$(call run, $(BR)/install-vpp_debug-native/vpp/bin/vpp)
|
$(call run, $(BR)/install-$(PLATFORM)_debug-native/vpp/bin/vpp)
|
||||||
|
|
||||||
run-release:
|
run-release:
|
||||||
$(call run, $(BR)/install-vpp-native/vpp/bin/vpp)
|
$(call run, $(BR)/install-$(PLATFORM)-native/vpp/bin/vpp)
|
||||||
|
|
||||||
debug:
|
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:
|
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:
|
build-vat:
|
||||||
$(call make,vpp_debug,vpp-api-test-install)
|
$(call make,$(PLATFORM)_debug,vpp-api-test-install)
|
||||||
|
|
||||||
run-vat:
|
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:
|
pkg-deb:
|
||||||
$(call make,vpp,install-deb)
|
$(call make,$(PLATFORM),install-deb)
|
||||||
|
|
||||||
pkg-rpm:
|
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
|
||||||
|
Reference in New Issue
Block a user