You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. # If you want to build in MSYS2 on Windows
  2. # export CMAKE_OPTS=-G "MSYS Makefiles"
  3. VERSION_FILE = src/pillowfight/_version.h
  4. PYTHON = python3
  5. build: build_c build_py
  6. install: install_py install_c
  7. uninstall: uninstall_py
  8. build_py: ${VERSION_FILE}
  9. ${PYTHON} ./setup.py build
  10. build_c: ${VERSION_FILE} build/libpillowfight.so
  11. build/libpillowfight.so: ${VERSION_FILE} build/Makefile
  12. (cd build && make -j4)
  13. build/Makefile:
  14. mkdir -p build
  15. (cd build && cmake ${CMAKE_OPTS} ..)
  16. ${VERSION_FILE}:
  17. echo -n "#define INTERNAL_PILLOWFIGHT_VERSION \"" >| $@
  18. echo -n $(shell git describe --always) >> $@
  19. echo "\"" >> $@
  20. version: ${VERSION_FILE}
  21. doc: install_py
  22. (cd doc && make html)
  23. doxygen doc/doxygen.conf
  24. cp doc/index.html doc/build/index.html
  25. check:
  26. flake8
  27. # pydocstyle src
  28. test: build_py
  29. tox
  30. linux_exe:
  31. windows_exe:
  32. release:
  33. ifeq (${RELEASE}, )
  34. @echo "You must specify a release version (make release RELEASE=1.2.3)"
  35. else
  36. @echo "Will release: ${RELEASE}"
  37. @echo "Checking release is in ChangeLog ..."
  38. grep ${RELEASE} ChangeLog | grep -v "/xx"
  39. @echo "Releasing ..."
  40. git tag -a ${RELEASE} -m ${RELEASE}
  41. git push origin ${RELEASE}
  42. make clean
  43. make version
  44. ${PYTHON} ./setup.py sdist upload
  45. @echo "All done"
  46. endif
  47. clean:
  48. rm -rf doc/build
  49. rm -rf build dist *.egg-info
  50. rm -f ${VERSION_FILE}
  51. install_py: ${VERSION_FILE}
  52. ${PYTHON} ./setup.py install ${PIP_ARGS}
  53. install_c: build/Makefile ${VERSION_FILE}
  54. (cd build && make install)
  55. uninstall_py:
  56. pip3 uninstall -y pypillowfight
  57. uninstall_c:
  58. echo "Can't uninstall C library. Sorry"
  59. help:
  60. @echo "make build || make build_c || make build_py"
  61. @echo "make check"
  62. @echo "make doc"
  63. @echo "make help: display this message"
  64. @echo "make install || make install_c || make install_py"
  65. @echo "make release"
  66. @echo "make test"
  67. @echo "make uninstall || make uninstall_py"
  68. .PHONY: \
  69. build \
  70. build_c \
  71. build_py \
  72. check \
  73. doc \
  74. exe \
  75. exe \
  76. help \
  77. install \
  78. install_c \
  79. install_py \
  80. release \
  81. test \
  82. uninstall \
  83. uninstall_c \
  84. version