Makefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. PYTHON_SRC = Python-2.7.9
  2. PYTHON_INSTALL = $(PYTHON_SRC)/build
  3. manifests = python.manifest
  4. target = benchmarks
  5. exec_target = $(manifests)
  6. extra_rules = -e 's:\$$(PYTHONDIR):$(PYTHON_INSTALL)/:g'
  7. clean-extra += clean-tmp
  8. level = ../../
  9. include ../../Makefile
  10. $(PYTHON_INSTALL)/bin/python: $(PYTHON_SRC)/Makefile
  11. cd $(PYTHON_SRC) && $(MAKE)
  12. cd $(PYTHON_SRC) && $(MAKE) install
  13. $(PYTHON_SRC)/Makefile: $(PYTHON_SRC)/configure
  14. cd $(PYTHON_SRC) && \
  15. ./configure --prefix=$(shell readlink -f $(PYTHON_INSTALL))
  16. $(PYTHON_SRC)/configure: $(PYTHON_SRC).tgz
  17. tar -xzf $<
  18. benchmarks: benchmarks.tar.gz
  19. tar -xzf $<
  20. regression:
  21. @echo "\n\nBuilding Python..."
  22. @$(MAKE) >> /dev/null 2>&1
  23. @echo "\n\nRun helloworld.py:"
  24. ./python.manifest scripts/helloworld.py > OUTPUT
  25. grep -q "Hello World" OUTPUT
  26. @rm OUTPUT
  27. @echo "\n\nRun fibonacci.py:"
  28. ./python.manifest scripts/fibonacci.py > OUTPUT
  29. grep -q "fib2 55" OUTPUT
  30. @rm OUTPUT
  31. @echo "\n\nRun test-http.py:"
  32. ./python.manifest scripts/test-http.py > OUTPUT
  33. wget -q http://google.com/ -O OUTPUT2
  34. @DS=`sdiff -B -b -s OUTPUT OUTPUT2 | wc -c`; \
  35. TS=`stat -c%s OUTPUT2`; \
  36. awk "BEGIN{ percentage = 100.0 * $$DS / $$TS; printf(\"%.3f%% is different\\n\", percentage); if (percentage > 10.0) { exit 1; }}"
  37. @rm OUTPUT OUTPUT2
  38. BENCHMARK = all,-rietveld,-spitfire,-tornado_http
  39. clean-tmp:
  40. rm -f python.manifest.sgx
  41. distclean: clean
  42. rm -rf $(PYTHON_SRC) benchmarks