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