summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
1 files changed, 4 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 30d40d1..c2bb4af 100644
--- a/Makefile
+++ b/Makefile
@@ -9,20 +9,24 @@ all: build run
build: bpfbuild gobuild
+.PHONY: bpfbuild
bpfbuild:
bpftool btf dump file /sys/kernel/btf/vmlinux format c > vmlinux.h
$(CC) -g -O2 -Wall -fpie -I$(LIBBPFGO)/selftest/common -target bpf -D__TARGET_ARCH_amd64 -I$(LIBBPFGO)/output -I$(LIBBPFGO)/selftest/common -c ioriotng.bpf.c -o ioriotng.bpf.o
+.PHONY: gobuild
gobuild:
echo 'package main' > internal/opids.go
echo >> internal/opids.go
sed -E 's/#define (.*) ([0-9]+)/const \1 = \2/' opids.h >> internal/opids.go
go build -tags netgo -ldflags '-w -extldflags "-static"' -o ioriotng ./cmd/ioriotng/main.go
+.PHONY: clean
clean:
find . -type f -name ioriotng -delete
find . -name \*.o -delete
find . -name vmlinux.h -delete
+.PHONY: run
run:
sudo ./ioriotng