-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (29 loc) · 850 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
.SUFFIXES:
.PHONY: default all observer test-svc disasm run-mesh observe-mesh graph
default: observer
all: observer test-svc
observer: /tmp/observer
@echo 'Built $@ at $<' >&2
test-svc: /tmp/test-svc
@echo 'Built $@ at $<' >&2
# Build observer
probes := bpfel_x86 bpfel_arm64
probes := $(patsubst %,observer/probe_%.go,$(probes))
$(probes) &: observer/bpf/*
go generate -x ./observer
/tmp/observer: observer/*.go $(probes)
go build -o '$@' ./observer
sudo setcap 'cap_sys_admin=ep' '$@'
# Build test-svc
/tmp/test-svc: mesh/*.go
go build -o '$@' ./mesh
# Utility commands
disasm: $(probes)
@llvm-objdump -dS -fhr --no-show-raw-insn '$(<:.go=.o)'
run-mesh:
@exec mesh/fake-mesh.sh
observe-mesh: /tmp/observer
@exec '$<' /tmp/fake-service
graph: g ?= g.dot
graph:
dot -Tpng -O -Gdpi=300 -Nshape=egg -Npenwidth=2 -Epenwidth=2.5 '$(g)'