summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-02-11 23:37:07 +0200
committerPaul Buetow <paul@buetow.org>2024-02-11 23:37:07 +0200
commitc4531d8793b971565775e71cda1bdc8a45622e0a (patch)
tree00487d3170e01cbab49709c4f41ce645b018d689
parent2a04dddad59f130c2f2cca682e1b55996f3a5391 (diff)
make it phony
-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