]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | # SPDX-License-Identifier: GPL-2.0 |
e306e2c1 DB |
2 | prefix = /usr |
3 | ||
4 | CC = gcc | |
3f356385 DB |
5 | LEX = flex |
6 | YACC = bison | |
71bb428f | 7 | MAKE = make |
e306e2c1 | 8 | |
d7475de5 KM |
9 | CFLAGS += -Wall -O2 |
10 | CFLAGS += -D__EXPORTED_HEADERS__ -I../../include/uapi -I../../include | |
11 | ||
3f356385 DB |
12 | %.yacc.c: %.y |
13 | $(YACC) -o $@ -d $< | |
14 | ||
15 | %.lex.c: %.l | |
16 | $(LEX) -o $@ $< | |
17 | ||
71bb428f | 18 | all: bpf_jit_disasm bpf_dbg bpf_asm bpftool |
e306e2c1 | 19 | |
d7475de5 | 20 | bpf_jit_disasm : CFLAGS += -DPACKAGE='bpf_jit_disasm' |
e306e2c1 DB |
21 | bpf_jit_disasm : LDLIBS = -lopcodes -lbfd -ldl |
22 | bpf_jit_disasm : bpf_jit_disasm.o | |
23 | ||
fd981e3c DB |
24 | bpf_dbg : LDLIBS = -lreadline |
25 | bpf_dbg : bpf_dbg.o | |
26 | ||
3f356385 DB |
27 | bpf_asm : LDLIBS = |
28 | bpf_asm : bpf_asm.o bpf_exp.yacc.o bpf_exp.lex.o | |
29 | bpf_exp.lex.o : bpf_exp.yacc.c | |
30 | ||
71bb428f | 31 | clean: bpftool_clean |
3f356385 | 32 | rm -rf *.o bpf_jit_disasm bpf_dbg bpf_asm bpf_exp.yacc.* bpf_exp.lex.* |
e306e2c1 | 33 | |
71bb428f | 34 | install: bpftool_install |
e306e2c1 | 35 | install bpf_jit_disasm $(prefix)/bin/bpf_jit_disasm |
fd981e3c | 36 | install bpf_dbg $(prefix)/bin/bpf_dbg |
3f356385 | 37 | install bpf_asm $(prefix)/bin/bpf_asm |
71bb428f JK |
38 | |
39 | bpftool: | |
40 | $(MAKE) -C bpftool | |
41 | ||
42 | bpftool_install: | |
43 | $(MAKE) -C bpftool install | |
44 | ||
45 | bpftool_clean: | |
46 | $(MAKE) -C bpftool clean | |
47 | ||
48 | .PHONY: bpftool FORCE |