Makefile 734 B

1234567891011121314151617181920212223242526272829303132333435
  1. prefix = /usr
  2. CC = gcc
  3. LEX = flex
  4. YACC = bison
  5. %.yacc.c: %.y
  6. $(YACC) -o $@ -d $<
  7. %.lex.c: %.l
  8. $(LEX) -o $@ $<
  9. all : bpf_jit_disasm bpf_dbg bpf_asm
  10. bpf_jit_disasm : CFLAGS = -Wall -O2 -DPACKAGE='bpf_jit_disasm'
  11. bpf_jit_disasm : LDLIBS = -lopcodes -lbfd -ldl
  12. bpf_jit_disasm : bpf_jit_disasm.o
  13. bpf_dbg : CFLAGS = -Wall -O2
  14. bpf_dbg : LDLIBS = -lreadline
  15. bpf_dbg : bpf_dbg.o
  16. bpf_asm : CFLAGS = -Wall -O2 -I.
  17. bpf_asm : LDLIBS =
  18. bpf_asm : bpf_asm.o bpf_exp.yacc.o bpf_exp.lex.o
  19. bpf_exp.lex.o : bpf_exp.yacc.c
  20. clean :
  21. rm -rf *.o bpf_jit_disasm bpf_dbg bpf_asm bpf_exp.yacc.* bpf_exp.lex.*
  22. install :
  23. install bpf_jit_disasm $(prefix)/bin/bpf_jit_disasm
  24. install bpf_dbg $(prefix)/bin/bpf_dbg
  25. install bpf_asm $(prefix)/bin/bpf_asm