blob: ddf8880106524c1b2882122b3e5ed76f3c5cc3f6 [file] [log] [blame]
Daniel Borkmanne306e2c2013-03-20 12:11:47 +00001prefix = /usr
2
3CC = gcc
Daniel Borkmann3f356382013-12-11 23:43:44 +01004LEX = flex
5YACC = bison
Daniel Borkmanne306e2c2013-03-20 12:11:47 +00006
Kamal Mostafad7475de2015-11-11 14:24:27 -08007CFLAGS += -Wall -O2
8CFLAGS += -D__EXPORTED_HEADERS__ -I../../include/uapi -I../../include
9
Daniel Borkmann3f356382013-12-11 23:43:44 +010010%.yacc.c: %.y
11 $(YACC) -o $@ -d $<
12
13%.lex.c: %.l
14 $(LEX) -o $@ $<
15
16all : bpf_jit_disasm bpf_dbg bpf_asm
Daniel Borkmanne306e2c2013-03-20 12:11:47 +000017
Kamal Mostafad7475de2015-11-11 14:24:27 -080018bpf_jit_disasm : CFLAGS += -DPACKAGE='bpf_jit_disasm'
Daniel Borkmanne306e2c2013-03-20 12:11:47 +000019bpf_jit_disasm : LDLIBS = -lopcodes -lbfd -ldl
20bpf_jit_disasm : bpf_jit_disasm.o
21
Daniel Borkmannfd981e32013-12-11 23:43:43 +010022bpf_dbg : LDLIBS = -lreadline
23bpf_dbg : bpf_dbg.o
24
Daniel Borkmann3f356382013-12-11 23:43:44 +010025bpf_asm : LDLIBS =
26bpf_asm : bpf_asm.o bpf_exp.yacc.o bpf_exp.lex.o
27bpf_exp.lex.o : bpf_exp.yacc.c
28
Daniel Borkmanne306e2c2013-03-20 12:11:47 +000029clean :
Daniel Borkmann3f356382013-12-11 23:43:44 +010030 rm -rf *.o bpf_jit_disasm bpf_dbg bpf_asm bpf_exp.yacc.* bpf_exp.lex.*
Daniel Borkmanne306e2c2013-03-20 12:11:47 +000031
32install :
33 install bpf_jit_disasm $(prefix)/bin/bpf_jit_disasm
Daniel Borkmannfd981e32013-12-11 23:43:43 +010034 install bpf_dbg $(prefix)/bin/bpf_dbg
Daniel Borkmann3f356382013-12-11 23:43:44 +010035 install bpf_asm $(prefix)/bin/bpf_asm