aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 12 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index ec01313..fce72ac 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,8 @@
VERSION ?= $(shell git describe --always --tags --dirty)
+BINAPI_DIR ?= $(shell cd examples/bin_api && pwd)
+VPP_VERSION := $(shell apt-cache show vpp | grep Version: | cut -d' ' -f2-)
+
all: test build examples
install:
@@ -39,10 +42,19 @@ clean:
rm -f extras/libmemif/examples/jumbo-frames/jumbo-frames
rm -f extras/libmemif/examples/raw-data/raw-data
+generate-binapi:
+ @echo "=> generating binapi"
+ @go generate "${BINAPI_DIR}"
+
generate: install
@echo "=> generating code"
cd examples && go generate ./...
+update-vppapi:
+ @echo "=> updating API JSON files using installed VPP (${VPP_VERSION})"
+ @cd ${BINAPI_DIR} && find . -type f -name '*.api.json' -exec cp /usr/share/vpp/api/'{}' '{}' \;
+ @echo ${VPP_VERSION} > ${BINAPI_DIR}/VPP_VERSION
+
lint:
@echo "=> running linter"
@golint ./... | grep -v vendor | grep -v bin_api || true