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 | |
Kamal Mostafa | d7475de | 2015-11-11 14:24:27 -0800 | [diff] [blame] | 7 | CFLAGS += -Wall -O2 |
| 8 | CFLAGS += -D__EXPORTED_HEADERS__ -I../../include/uapi -I../../include |
| 9 | |
Daniel Borkmann | 3f35638 | 2013-12-11 23:43:44 +0100 | [diff] [blame] | 10 | %.yacc.c: %.y |
| 11 | $(YACC) -o $@ -d $< |
| 12 | |
| 13 | %.lex.c: %.l |
| 14 | $(LEX) -o $@ $< |
| 15 | |
| 16 | all : bpf_jit_disasm bpf_dbg bpf_asm |
Daniel Borkmann | e306e2c | 2013-03-20 12:11:47 +0000 | [diff] [blame] | 17 | |
Kamal Mostafa | d7475de | 2015-11-11 14:24:27 -0800 | [diff] [blame] | 18 | bpf_jit_disasm : CFLAGS += -DPACKAGE='bpf_jit_disasm' |
Daniel Borkmann | e306e2c | 2013-03-20 12:11:47 +0000 | [diff] [blame] | 19 | bpf_jit_disasm : LDLIBS = -lopcodes -lbfd -ldl |
| 20 | bpf_jit_disasm : bpf_jit_disasm.o |
| 21 | |
Daniel Borkmann | fd981e3 | 2013-12-11 23:43:43 +0100 | [diff] [blame] | 22 | bpf_dbg : LDLIBS = -lreadline |
| 23 | bpf_dbg : bpf_dbg.o |
| 24 | |
Daniel Borkmann | 3f35638 | 2013-12-11 23:43:44 +0100 | [diff] [blame] | 25 | bpf_asm : LDLIBS = |
| 26 | bpf_asm : bpf_asm.o bpf_exp.yacc.o bpf_exp.lex.o |
| 27 | bpf_exp.lex.o : bpf_exp.yacc.c |
| 28 | |
Daniel Borkmann | e306e2c | 2013-03-20 12:11:47 +0000 | [diff] [blame] | 29 | clean : |
Daniel Borkmann | 3f35638 | 2013-12-11 23:43:44 +0100 | [diff] [blame] | 30 | 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] | 31 | |
| 32 | install : |
| 33 | install bpf_jit_disasm $(prefix)/bin/bpf_jit_disasm |
Daniel Borkmann | fd981e3 | 2013-12-11 23:43:43 +0100 | [diff] [blame] | 34 | install bpf_dbg $(prefix)/bin/bpf_dbg |
Daniel Borkmann | 3f35638 | 2013-12-11 23:43:44 +0100 | [diff] [blame] | 35 | install bpf_asm $(prefix)/bin/bpf_asm |