blob: 004cd74734b62b941cf64db1634d2774f70f6e3c [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
Daniel Borkmann3f356382013-12-11 23:43:44 +01007%.yacc.c: %.y
8 $(YACC) -o $@ -d $<
9
10%.lex.c: %.l
11 $(LEX) -o $@ $<
12
13all : bpf_jit_disasm bpf_dbg bpf_asm
Daniel Borkmanne306e2c2013-03-20 12:11:47 +000014
15bpf_jit_disasm : CFLAGS = -Wall -O2
16bpf_jit_disasm : LDLIBS = -lopcodes -lbfd -ldl
17bpf_jit_disasm : bpf_jit_disasm.o
18
Daniel Borkmannfd981e32013-12-11 23:43:43 +010019bpf_dbg : CFLAGS = -Wall -O2
20bpf_dbg : LDLIBS = -lreadline
21bpf_dbg : bpf_dbg.o
22
Daniel Borkmann3f356382013-12-11 23:43:44 +010023bpf_asm : CFLAGS = -Wall -O2 -I.
24bpf_asm : LDLIBS =
25bpf_asm : bpf_asm.o bpf_exp.yacc.o bpf_exp.lex.o
26bpf_exp.lex.o : bpf_exp.yacc.c
27
Daniel Borkmanne306e2c2013-03-20 12:11:47 +000028clean :
Daniel Borkmann3f356382013-12-11 23:43:44 +010029 rm -rf *.o bpf_jit_disasm bpf_dbg bpf_asm bpf_exp.yacc.* bpf_exp.lex.*
Daniel Borkmanne306e2c2013-03-20 12:11:47 +000030
31install :
32 install bpf_jit_disasm $(prefix)/bin/bpf_jit_disasm
Daniel Borkmannfd981e32013-12-11 23:43:43 +010033 install bpf_dbg $(prefix)/bin/bpf_dbg
Daniel Borkmann3f356382013-12-11 23:43:44 +010034 install bpf_asm $(prefix)/bin/bpf_asm