Makefile 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. LMBENCHDIR = lmbench-2.5
  2. LMBENCHMANIFEST = manifest-list
  3. export CC
  4. export CFLAGS
  5. all debug: $(LMBENCHMANIFEST)
  6. for f in `cat $(LMBENCHMANIFEST)`; do make $${f%.template}; done
  7. debug: CC="gcc -g"
  8. kvm: CFLAGS += -DKVM_BENCH -D_DEBUG
  9. kvm: all
  10. servers = lat_udp lat_tcp lat_rpc lat_connect bw_tcp
  11. %.manifest: manifest.template
  12. make -C .. lmbench/$@ appdir=lmbench/
  13. echo $(if $(findstring $(notdir $(basename $@)),$(servers)),"loader.daemonize = 1") >> $@
  14. $(LMBENCHDIR)/bin/linux: $(wildcard $(LMBENCHDIR)/src/*.c) $(wildcard $(LMBENCHDIR)/src/*.h)
  15. make -C $(LMBENCHDIR)/src OS=linux CC="gcc -g"
  16. manifest-list: $(LMBENCHDIR)/bin/linux
  17. mkdir -p $(LMBENCHDIR)/bin/graphene
  18. cp -n $(LMBENCHDIR)/bin/linux/* $(LMBENCHDIR)/bin/graphene
  19. find $(LMBENCHDIR)/bin/linux/ -type f -executable \
  20. -not -name lmbench -not -name hello | \
  21. sed 's:linux/\(.*\):graphene/\1.manifest.template:g' | \
  22. tee manifest-list | \
  23. xargs -l ln -sf ../../../manifest.template
  24. for f in `cat manifest-list`; do f=$${f%.manifest.template}; \
  25. ln -sf $${f##*/}.manifest $$f ; done
  26. config = $(shell $(LMBENCHDIR)/scripts/config)
  27. config-native: $(LMBENCHDIR)/bin/linux
  28. [ -f "$(LMBENCHDIR)/bin/linux/$(config)" ] || \
  29. (cd $(LMBENCHDIR)/scripts && env OS=linux ./config-run)
  30. test-native: config-native
  31. make -C $(LMBENCHDIR) OS=linux rerun
  32. config-graphene: config-native $(LMBENCHMANIFEST)
  33. [ -f "$(LMBENCHDIR)/bin/graphene/$(config)" ] || \
  34. sed -e "s/OS=\"linux\"/OS=\"graphene\"/g" "$(LMBENCHDIR)/bin/linux/$(config)" \
  35. > "$(LMBENCHDIR)/bin/graphene/$(config)"
  36. cp $(LMBENCHDIR)/bin/graphene/hello /tmp
  37. test-graphene: config-graphene
  38. make -C $(LMBENCHDIR) OS=graphene rerun
  39. clean:
  40. rm -rf $(LMBENCHMANFIEST)
  41. make -C $(LMBENCHDIR) clean