Rules.mk 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. BENCH_MODS = bench.so $(BENCH_ALGOS:%=bench-%.so)
  2. BENCH_ALGOS = wheel heap llrb
  3. BENCH_OPS = add del expire
  4. $(top_builddir)/bench/bench.so: $(top_srcdir)/bench/bench.c
  5. $(top_builddir)/bench/bench-wheel.so: $(top_srcdir)/bench/bench-wheel.c
  6. $(top_builddir)/bench/bench-heap.so: $(top_srcdir)/bench/bench-heap.c
  7. $(top_builddir)/bench/bench-llrb.so: $(top_srcdir)/bench/bench-llrb.c
  8. $(BENCH_MODS:%=$(top_builddir)/bench/%): $(top_srcdir)/timeout.h $(top_srcdir)/timeout.c $(top_srcdir)/bench/bench.h
  9. mkdir -p $(@D)
  10. @$(SHRC); echo_cmd $(CC) -o $@ $(top_srcdir)/bench/$(@F:%.so=%.c) $(ALL_CPPFLAGS) $(ALL_CFLAGS) $(ALL_SOFLAGS) $(ALL_LDFLAGS) $(ALL_LIBS)
  11. $(BENCH_OPS:%=$(top_builddir)/bench/wheel-%.dat): $(top_builddir)/bench/bench-wheel.so $(top_builddir)/bench/bench.so $(top_srcdir)/bench/bench-aux.lua
  12. $(BENCH_OPS:%=$(top_builddir)/bench/heap-%.dat): $(top_builddir)/bench/bench-heap.so $(top_builddir)/bench/bench.so $(top_srcdir)/bench/bench-aux.lua
  13. $(BENCH_OPS:%=$(top_builddir)/bench/llrb-%.dat): $(top_builddir)/bench/bench-llrb.so $(top_builddir)/bench/bench.so $(top_srcdir)/bench/bench-aux.lua
  14. $(BENCH_ALGOS:%=$(top_builddir)/bench/%-add.dat): $(top_srcdir)/bench/bench-add.lua
  15. @$(SHRC); echo_cmd cd $(@D) && echo_cmd $(LUA) $${top_srcdir}/bench/bench-add.lua $${top_builddir}/bench/bench-$(@F:%-add.dat=%).so > $(@F).tmp
  16. mv $@.tmp $@
  17. $(BENCH_ALGOS:%=$(top_builddir)/bench/%-del.dat): $(top_srcdir)/bench/bench-del.lua
  18. @$(SHRC); echo_cmd cd $(@D) && echo_cmd $(LUA) $${top_srcdir}/bench/bench-del.lua $${top_builddir}/bench/bench-$(@F:%-del.dat=%).so > $(@F).tmp
  19. mv $@.tmp $@
  20. $(BENCH_ALGOS:%=$(top_builddir)/bench/%-expire.dat): $(top_srcdir)/bench/bench-expire.lua
  21. @$(SHRC); echo_cmd cd $(@D) && echo_cmd $(LUA) $${top_srcdir}/bench/bench-expire.lua $${top_builddir}/bench/bench-$(@F:%-expire.dat=%).so > $(@F).tmp
  22. mv $@.tmp $@
  23. $(top_builddir)/bench/bench.eps: \
  24. $(BENCH_OPS:%=$(top_builddir)/bench/wheel-%.dat) \
  25. $(BENCH_OPS:%=$(top_builddir)/bench/heap-%.dat)
  26. # $(BENCH_OPS:%=$(top_builddir)/bench/llrb-%.dat)
  27. $(top_builddir)/bench/bench.eps: $(top_srcdir)/bench/bench.plt
  28. @$(SHRC); echo_cmd cd $(@D) && echo_cmd gnuplot $${top_srcdir}/bench/bench.plt > $(@F).tmp
  29. mv $@.tmp $@
  30. $(top_builddir)/bench/bench.pdf: $(top_builddir)/bench/bench.eps
  31. @$(SHRC); echo_cmd ps2pdf $${top_builddir}/bench/bench.eps $@
  32. bench-mods: $(BENCH_MODS:%=$(top_builddir)/bench/%)
  33. bench-all: $(top_builddir)/bench/bench.pdf
  34. bench-clean:
  35. $(RM) -r $(top_builddir)/bench/*.so $(top_builddir)/bench/*.dSYM
  36. $(RM) $(top_builddir)/bench/*.dat $(top_builddir)/bench/*.tmp
  37. $(RM) $(top_builddir)/bench/bench.{eps,pdf}