1 # SPDX-License-Identifier: GPL-2.0
10 CFLAGS
+= -D__EXPORTED_HEADERS__
-I..
/..
/include/uapi
-I..
/..
/include
13 srctree
:= $(patsubst %/,%,$(dir $(CURDIR
)))
14 srctree
:= $(patsubst %/,%,$(dir $(srctree
)))
18 FEATURE_TESTS
= libbfd disassembler-four-args
19 FEATURE_DISPLAY
= libbfd disassembler-four-args
22 NON_CHECK_FEAT_TARGETS
:= clean bpftool_clean
24 ifeq ($(filter-out $(NON_CHECK_FEAT_TARGETS
),$(MAKECMDGOALS
)),)
29 ifeq ($(check_feat
),1)
30 ifeq ($(FEATURES_DUMP
),)
31 include $(srctree
)/tools
/build
/Makefile.feature
33 include $(FEATURES_DUMP
)
37 ifeq ($(feature-disassembler-four-args
), 1)
38 CFLAGS
+= -DDISASM_FOUR_ARGS_SIGNATURE
47 all: bpf_jit_disasm bpf_dbg bpf_asm bpftool
49 bpf_jit_disasm
: CFLAGS
+= -DPACKAGE
='bpf_jit_disasm'
50 bpf_jit_disasm
: LDLIBS
= -lopcodes
-lbfd
-ldl
51 bpf_jit_disasm
: bpf_jit_disasm.o
53 bpf_dbg
: LDLIBS
= -lreadline
57 bpf_asm
: bpf_asm.o bpf_exp.
yacc.o bpf_exp.
lex.o
58 bpf_exp.
lex.o
: bpf_exp.
yacc.c
61 rm -rf
*.o bpf_jit_disasm bpf_dbg bpf_asm bpf_exp.
yacc.
* bpf_exp.
lex.
*
63 install: bpftool_install
64 install bpf_jit_disasm
$(prefix)/bin
/bpf_jit_disasm
65 install bpf_dbg
$(prefix)/bin
/bpf_dbg
66 install bpf_asm
$(prefix)/bin
/bpf_asm
72 $(MAKE
) -C bpftool
install
75 $(MAKE
) -C bpftool
clean