diff --git a/.gitignore b/.gitignore index 8e11b42e0..66e923a2d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.o +*.d *.pb.go .cache /.idea diff --git a/support/ebpf/Makefile b/support/ebpf/Makefile index 0acb416df..4b370cdb8 100644 --- a/support/ebpf/Makefile +++ b/support/ebpf/Makefile @@ -48,6 +48,7 @@ FLAGS=$(TARGET_FLAGS) -g \ SRCS := $(wildcard *.ebpf.c) OBJS := $(SRCS:.c=.$(TARGET_ARCH).o) +DEPS := $(OBJS:.o=.d) .DEFAULT_GOAL := all @@ -62,10 +63,8 @@ arm64: errors.h: ../../tools/errors-codegen/errors.json go run ../../tools/errors-codegen/main.go bpf $@ -%.ebpf.c: errors.h ; - -%.ebpf.$(TARGET_ARCH).o: %.ebpf.c - $(BPF_CLANG) $(FLAGS) -o $@ +%.ebpf.$(TARGET_ARCH).o: %.ebpf.c errors.h + $(BPF_CLANG) $(FLAGS) -MMD -MP -o $@ $(TRACER_NAME): $(OBJS) $(BPF_LINK) $^ -o - | $(LLC) -march=bpf -mcpu=v2 -filetype=obj -o $@ @@ -88,4 +87,6 @@ format: $(CLANG_FORMAT) -i -style=file *.[ch] clean: - rm -f *.o + rm -f *.o *.d + +-include $(DEPS)