Makefile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 -f OUTPUT
  31. @echo "\n\nRun a HTTP server in the background"
  32. python scripts/dummy-web-server.py 8000 & echo $$! > server.PID
  33. sleep 1
  34. @echo "\n\nRun test-http.py:"
  35. -./python.manifest scripts/test-http.py 127.0.0.1 8000 > OUTPUT1
  36. -wget -q http://127.0.0.1:8000/ -O OUTPUT2
  37. -diff -q OUTPUT1 OUTPUT2
  38. @kill `cat server.PID`
  39. @rm -f OUTPUT1 OUTPUT2 server.PID
  40. BENCHMARK = all,-rietveld,-spitfire,-tornado_http
  41. clean-tmp:
  42. rm -f python.manifest.sgx
  43. distclean: clean
  44. rm -rf $(PYTHON_SRC) benchmarks