blob: 5830670feae1eef1f97bcc9830aded5d428ab309 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001# SPDX-License-Identifier: GPL-2.0
Daniel Borkmanne306e2c2013-03-20 12:11:47 +00002prefix = /usr
3
4CC = gcc
Daniel Borkmann3f356382013-12-11 23:43:44 +01005LEX = flex
6YACC = bison
Daniel Borkmanne306e2c2013-03-20 12:11:47 +00007
Kamal Mostafad7475de2015-11-11 14:24:27 -08008CFLAGS += -Wall -O2
9CFLAGS += -D__EXPORTED_HEADERS__ -I../../include/uapi -I../../include
10
Daniel Borkmann3f356382013-12-11 23:43:44 +010011%.yacc.c: %.y
12 $(YACC) -o $@ -d $<
13
14%.lex.c: %.l
15 $(LEX) -o $@ $<
16
17all : bpf_jit_disasm bpf_dbg bpf_asm
Daniel Borkmanne306e2c2013-03-20 12:11:47 +000018
Kamal Mostafad7475de2015-11-11 14:24:27 -080019bpf_jit_disasm : CFLAGS += -DPACKAGE='bpf_jit_disasm'
Daniel Borkmanne306e2c2013-03-20 12:11:47 +000020bpf_jit_disasm : LDLIBS = -lopcodes -lbfd -ldl
21bpf_jit_disasm : bpf_jit_disasm.o
22
Daniel Borkmannfd981e32013-12-11 23:43:43 +010023bpf_dbg : LDLIBS = -lreadline
24bpf_dbg : bpf_dbg.o
25
Daniel Borkmann3f356382013-12-11 23:43:44 +010026bpf_asm : LDLIBS =
27bpf_asm : bpf_asm.o bpf_exp.yacc.o bpf_exp.lex.o
28bpf_exp.lex.o : bpf_exp.yacc.c
29
Daniel Borkmanne306e2c2013-03-20 12:11:47 +000030clean :
Daniel Borkmann3f356382013-12-11 23:43:44 +010031 rm -rf *.o bpf_jit_disasm bpf_dbg bpf_asm bpf_exp.yacc.* bpf_exp.lex.*
Daniel Borkmanne306e2c2013-03-20 12:11:47 +000032
33install :
34 install bpf_jit_disasm $(prefix)/bin/bpf_jit_disasm
Daniel Borkmannfd981e32013-12-11 23:43:43 +010035 install bpf_dbg $(prefix)/bin/bpf_dbg
Daniel Borkmann3f356382013-12-11 23:43:44 +010036 install bpf_asm $(prefix)/bin/bpf_asm