blob: ee577ea03ba50f05a4b14379ddcd17a3f73593c0 [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
Markos Chandras40676462014-03-11 08:49:39 +000015bpf_jit_disasm : CFLAGS = -Wall -O2 -DPACKAGE='bpf_jit_disasm'
Daniel Borkmanne306e2c2013-03-20 12:11:47 +000016bpf_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