Makefile 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. LMBENCHDIR = lmbench-2.5
  2. LINUXDIR = $(LMBENCHDIR)/bin/linux/
  3. host_files = /bin/sh /usr/include/x86_64-linux-gnu/sys/types.h
  4. lmbench_tests = $(addprefix $(LINUXDIR),lat_syscall lat_connect lat_fcntl \
  5. lat_select lat_fs lat_mmap lat_fifo lat_mem_rd lat_msg \
  6. lat_tcp lat_udp lat_unix_connect lat_pagefault \
  7. bw_tcp bw_mem bw_unix lat_proc lat_ctx lat_rpc \
  8. lat_unix lat_sig lat_http lat_pipe \
  9. bw_pipe bw_file_rd bw_mmap_rd lmhttp lmdd)
  10. manifests = $(addprefix $(LINUXDIR),$(patsubst %.template,%,$(wildcard *.manifest.template)) manifest)
  11. target = $(lmbench_tests)
  12. clean-extra = clean-lmbench
  13. level = ../../
  14. include ../../Makefile
  15. export CC
  16. export CFLAGS
  17. $(LINUXDIR)Makefile: Makefile.lmbench
  18. ln -sf ../../../$< $@
  19. build-manifest: $(LINUXDIR) $(LINUXDIR)Makefile
  20. $(MAKE) -C $(LINUXDIR)
  21. ifeq ($(SYS),x86_64-linux-gnu)
  22. $(lmbench_tests): $(LINUXDIR) build-manifest
  23. $(LINUXDIR): $(wildcard $(LMBENCHDIR)/src/*.c) $(wildcard $(LMBENCHDIR)/src/*.h)
  24. $(MAKE) -C $(LMBENCHDIR)/src OS=linux
  25. .PHONY: pack
  26. $(addprefix host,$(host_files)):
  27. @echo "$(patsubst host%,%,$@) -> $@"
  28. @mkdir -p $(dir $@)
  29. @cp -LTrf $(patsubst host%,%,$@) $@
  30. pack: $(host_files) $(lmbench_tests) $(manifests)
  31. @../../../../../Scripts/pack_binaries.sh lmbench $^
  32. else
  33. all: $(addprefix /tmp/host,$(HOST_BINARIES))
  34. $(filter-out $(HOST_BINARIES),$(BINARIES)): .packed/lmbench.tar.gz
  35. tar -xmozf $< $@
  36. $(addprefix /tmp/host,$(HOST_BINARIES)): .packed/lmbench.tar.gz
  37. cd /tmp && tar -xmozf $(abspath $<) $(subst /tmp/,,$@)
  38. endif
  39. lmbench_config = $(LINUXDIR)$(shell $(LMBENCHDIR)/scripts/config)
  40. $(lmbench_config):
  41. cd $(LMBENCHDIR)/scripts && env OS=linux ./config-run
  42. test-native: $(lmbench_tests) $(lmbench_config)
  43. cd $(LMBENCHDIR)/scripts && env OS=linux ./results
  44. test-graphene: all $(lmbench_config)
  45. cd $(LMBENCHDIR)/scripts && \
  46. env LOADER=./pal_loader OS=linux RESULTS=results/graphene \
  47. ./results
  48. clean-lmbench:
  49. $(MAKE) -C $(LMBENCHDIR) clean