mirror of
https://github.com/eunomia-bpf/bpf-developer-tutorial.git
synced 2026-02-03 18:24:27 +08:00
docs: add CLAUDE.md for project guidance and create master Makefile for eBPF tutorials
- Introduced CLAUDE.md to provide an overview and guidance for the eBPF Developer Tutorial repository. - Added a master Makefile to automate the building and cleaning of eBPF tutorial subdirectories. - Updated .gitignore in the sslsniff example to include the sslsniff binary. - Made minor code adjustments in user_ringbuf.c and xdp-tcpdump.c to include necessary headers. - Modified the Makefile in the btf-uprobe example to streamline the build process.
This commit is contained in:
1
src/30-sslsniff/.gitignore
vendored
1
src/30-sslsniff/.gitignore
vendored
@@ -7,3 +7,4 @@ package.yaml
|
||||
ecli
|
||||
bootstrap
|
||||
openssl
|
||||
sslsniff
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <sys/resource.h>
|
||||
#include <bpf/libbpf.h>
|
||||
#include "user_ringbuf.h"
|
||||
|
||||
@@ -66,7 +66,7 @@ $(call allow-override,CC,$(CROSS_COMPILE)cc)
|
||||
$(call allow-override,LD,$(CROSS_COMPILE)ld)
|
||||
|
||||
.PHONY: all
|
||||
all: $(APPS) merge-btf all-btf
|
||||
all: $(APPS)
|
||||
|
||||
.PHONY: all-btf
|
||||
all-btf: merge-btf
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <net/if.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include <bpf/libbpf.h>
|
||||
#include <bpf/bpf.h>
|
||||
|
||||
23
src/Makefile
Normal file
23
src/Makefile
Normal file
@@ -0,0 +1,23 @@
|
||||
# Master Makefile for eBPF tutorials
|
||||
# Detects subdirectories with Makefiles and builds them
|
||||
|
||||
# Find all subdirectories containing a Makefile
|
||||
SUBDIRS := $(shell find . -mindepth 2 -maxdepth 2 -name Makefile -exec dirname {} \; | sort)
|
||||
|
||||
# Default target
|
||||
all: $(SUBDIRS)
|
||||
|
||||
# Build each subdirectory
|
||||
$(SUBDIRS):
|
||||
@echo "Building $@"
|
||||
@$(MAKE) -C $@
|
||||
|
||||
# Clean all subdirectories
|
||||
clean:
|
||||
@for dir in $(SUBDIRS); do \
|
||||
echo "Cleaning $$dir"; \
|
||||
$(MAKE) -C $$dir clean; \
|
||||
done
|
||||
|
||||
# Phony targets
|
||||
.PHONY: all clean $(SUBDIRS)
|
||||
Reference in New Issue
Block a user