Makefile 754 B

123456789101112131415161718192021222324252627282930313233343536
  1. prefix = /usr
  2. CC = gcc
  3. LEX = flex
  4. YACC = bison
  5. CFLAGS += -Wall -O2
  6. CFLAGS += -D__EXPORTED_HEADERS__ -I../../include/uapi -I../../include
  7. %.yacc.c: %.y
  8. $(YACC) -o $@ -d $<
  9. %.lex.c: %.l
  10. $(LEX) -o $@ $<
  11. all : bpf_jit_disasm bpf_dbg bpf_asm
  12. bpf_jit_disasm : CFLAGS += -DPACKAGE='bpf_jit_disasm'
  13. bpf_jit_disasm : LDLIBS = -lopcodes -lbfd -ldl
  14. bpf_jit_disasm : bpf_jit_disasm.o
  15. bpf_dbg : LDLIBS = -lreadline
  16. bpf_dbg : bpf_dbg.o
  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