-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
31 lines (21 loc) · 713 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
BPFTOOL ?= bpftool
CLANG ?= clang
CFLAGS = -Wall -Wextra -ggdb
LDFLAGS = -lbpf
BPF_CFLAGS = -Wall -Wextra -ggdb -O2 -fno-asynchronous-unwind-tables
ALL = 01/map-create 02/pkt_counter.o 05/pkt_counter.skel.h 05/attach-pkt-counter 06/map-dump
.PHONY: all
all: $(ALL)
01/map-create: 01/map_create.c
$(CLANG) $(CFLAGS) -o $@ $< $(LDFLAGS)
02/pkt_counter.o: 02/pkt_counter.c
$(CLANG) $(BPF_CFLAGS) -target bpf -c $< -o $@
05/pkt_counter.skel.h: 02/pkt_counter.o
$(BPFTOOL) gen skeleton $< > $@
05/attach-pkt-counter: 05/attach_pkt_counter.c 05/pkt_counter.skel.h
$(CLANG) $(CFLAGS) $< -o $@ $(LDFLAGS)
06/map-dump: 06/map_dump.c
$(CLANG) $(CFLAGS) $< -o $@ $(LDFLAGS)
.PHONY: clean
clean:
rm -f $(ALL)