Skip to content

make gen_compile_commands for tetragon #3698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ kind: ## Create a kind cluster for Tetragon development.
./contrib/kind/bootstrap-kind-cluster.sh

KIND_BUILD_IMAGES ?= 1
VALUES ?=
VALUES ?=

## kind-install-tetragon: ## Install Tetragon in a kind cluster.
## kind-install-tetragon KIND_BUILD_IMAGES=0: ## Install Tetragon in a kind cluster without (re-)building images.
Expand Down Expand Up @@ -494,3 +494,14 @@ docs: ## Preview documentation website.
.PHONY: version
version: ## Print Tetragon version.
@echo $(VERSION)

.PHONY: gen-compile-commands
BEAR_CLI := $(shell which bear 2> /dev/null)
gen-compile-commands: ## Generates compile_commands.json
ifeq ($(BEAR_CLI),)
@echo "Error: 'bear' must be installed and available in \$\$PATH to generate the compile_commands.json"
@exit 1
else
@echo "Generating compile_commands.json using bear..."
@$(BEAR_CLI) $(MAKE) tetragon-bpf LOCAL_CLANG=1 LOCAL_CLANG_FORMAT=1
endif
Loading