-clean:
- @rm -f cmd/binapi-generator/binapi-generator
- @rm -f examples/cmd/simple-client/simple-client
- @rm -f examples/cmd/stats-client/stats-client
- @rm -f examples/cmd/perf-bench/perf-bench
- @rm -f extras/libmemif/examples/raw-data/raw-data
- @rm -f extras/libmemif/examples/icmp-responder/icmp-responder
+clean: ## Clean all
+ @echo "# cleaning"
+ $(GO) clean -v ./...
+
+test: ## Run unit tests
+ @echo "# running tests"
+ $(GO) test -tags="${GO_BUILD_TAGS}" ./...
+
+integration: ## Run integration tests
+ @echo "# running integration tests"
+ $(GO) test -tags="integration ${GO_BUILD_TAGS}" ./test/integration
+
+lint: ## Run code linter
+ @echo "# running linter"
+ @golint ./...
+
+install: install-generator install-proxy ## Install all
+
+install-generator: ## Install binapi-generator
+ @echo "# installing binapi-generator ${VERSION}"
+ $(GO) install ${GO_BUILD_ARGS} ./cmd/binapi-generator
+
+install-proxy: ## Install vpp-proxy
+ @echo "# installing vpp-proxy ${VERSION}"
+ $(GO) install ${GO_BUILD_ARGS} ./cmd/vpp-proxy
+
+generate: ## Generate all
+ @echo "# generating code"
+ $(GO) generate -x ./...
+
+generate-binapi: install-generator ## Generate binapi code
+ @echo "# generating binapi VPP $(VPP_VERSION)"
+ $(GO) generate -x "$(BINAPI_DIR)"
+
+gen-binapi-docker: install-generator ## Generate binapi code (using Docker)
+ @echo "# generating binapi in docker image ${VPP_IMG}"
+ $(eval cmds := $(shell go generate -n $(BINAPI_DIR) 2>&1 | tr "\n" ";"))
+ docker run -t --rm \
+ -e DEBUG_GOVPP \
+ -v "$(shell which binapi-generator):/usr/local/bin/binapi-generator:ro" \
+ -v "$(shell pwd):/govpp" -w /govpp \
+ -u "$(shell id -u):$(shell id -g)" \
+ "${VPP_IMG}" \
+ sh -ec "cd $(BINAPI_DIR) && $(cmds)"
+
+extras:
+ @make -C extras