Daniel Borkmann | e306e2c | 2013-03-20 12:11:47 +0000 | [diff] [blame] | 1 | prefix = /usr |
| 2 | |
| 3 | CC = gcc |
Daniel Borkmann | 3f35638 | 2013-12-11 23:43:44 +0100 | [diff] [blame] | 4 | LEX = flex |
| 5 | YACC = bison |
Daniel Borkmann | e306e2c | 2013-03-20 12:11:47 +0000 | [diff] [blame] | 6 | |
Daniel Borkmann | 3f35638 | 2013-12-11 23:43:44 +0100 | [diff] [blame] | 7 | %.yacc.c: %.y |
| 8 | $(YACC) -o $@ -d $< |
| 9 | |
| 10 | %.lex.c: %.l |
| 11 | $(LEX) -o $@ $< |
| 12 | |
| 13 | all : bpf_jit_disasm bpf_dbg bpf_asm |
Daniel Borkmann | e306e2c | 2013-03-20 12:11:47 +0000 | [diff] [blame] | 14 | |
Markos Chandras | 4067646 | 2014-03-11 08:49:39 +0000 | [diff] [blame] | 15 | bpf_jit_disasm : CFLAGS = -Wall -O2 -DPACKAGE='bpf_jit_disasm' |
Daniel Borkmann | e306e2c | 2013-03-20 12:11:47 +0000 | [diff] [blame] | 16 | bpf_jit_disasm : LDLIBS = -lopcodes -lbfd -ldl |
| 17 | bpf_jit_disasm : bpf_jit_disasm.o |
| 18 | |
Daniel Borkmann | fd981e3 | 2013-12-11 23:43:43 +0100 | [diff] [blame] | 19 | bpf_dbg : CFLAGS = -Wall -O2 |
| 20 | bpf_dbg : LDLIBS = -lreadline |
| 21 | bpf_dbg : bpf_dbg.o |
| 22 | |
Daniel Borkmann | 3f35638 | 2013-12-11 23:43:44 +0100 | [diff] [blame] | 23 | bpf_asm : CFLAGS = -Wall -O2 -I. |
| 24 | bpf_asm : LDLIBS = |
| 25 | bpf_asm : bpf_asm.o bpf_exp.yacc.o bpf_exp.lex.o |
| 26 | bpf_exp.lex.o : bpf_exp.yacc.c |
| 27 | |
Daniel Borkmann | e306e2c | 2013-03-20 12:11:47 +0000 | [diff] [blame] | 28 | clean : |
Daniel Borkmann | 3f35638 | 2013-12-11 23:43:44 +0100 | [diff] [blame] | 29 | rm -rf *.o bpf_jit_disasm bpf_dbg bpf_asm bpf_exp.yacc.* bpf_exp.lex.* |
Daniel Borkmann | e306e2c | 2013-03-20 12:11:47 +0000 | [diff] [blame] | 30 | |
| 31 | install : |
| 32 | install bpf_jit_disasm $(prefix)/bin/bpf_jit_disasm |
Daniel Borkmann | fd981e3 | 2013-12-11 23:43:43 +0100 | [diff] [blame] | 33 | install bpf_dbg $(prefix)/bin/bpf_dbg |
Daniel Borkmann | 3f35638 | 2013-12-11 23:43:44 +0100 | [diff] [blame] | 34 | install bpf_asm $(prefix)/bin/bpf_asm |