2011-01-12 18:05:55 +00:00
|
|
|
PYTHON = python
|
|
|
|
CHECKSCRIPT = kivy/tools/pep8checker/pep8kivy.py
|
|
|
|
KIVY_DIR = kivy/
|
2015-04-02 03:53:05 +00:00
|
|
|
NOSETESTS = $(PYTHON) -m nose.core
|
2013-02-12 19:31:10 +00:00
|
|
|
KIVY_USE_DEFAULTCONFIG = 1
|
2012-03-09 01:27:40 +00:00
|
|
|
HOSTPYTHON = $(KIVYIOSROOT)/tmp/Python-$(PYTHON_VERSION)/hostpython
|
2015-01-24 11:09:09 +00:00
|
|
|
|
|
|
|
GIT_COMMAND := $(shell which git)
|
|
|
|
|
2011-05-14 18:46:46 +00:00
|
|
|
IOSPATH := $(PATH):/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin
|
2011-01-12 18:05:55 +00:00
|
|
|
|
2015-01-25 12:09:36 +00:00
|
|
|
BUILD_OPTS = build_ext --inplace
|
|
|
|
BUILD_OPTS_FORCE = $(BUILD_OPTS) -f
|
Windows: add support for ANGLE as an alternative for GL rendering
This can be achieve by asking a ES profile implementation to SDL2, and compile then copy ANGLE libEGL.dll and libGLESv2.dll to c:\Python27\share\sdl2\bin.
Support in kivy for ANGLE must be activated at compilation: USE_ANGLE=1 make
The changes intruduce a "dynamic" opengl backend, that uses SDL2 GetProcAddress to gather all the GL pointers that we need for opengl, and expose them in "cgl" context.
All the graphics implementation now use cgl (either a module or the new context for dynamic gl) as a base for accessing GL functions. The GL definitions are extracted and shared in c_opengl_def.
ANGLE give us:
- ability to execute Kivy application with default driver (at least for Virtualbox and intel, no need to install specific vendor graphics)
- works starting Direct3d 9 support (use dxdiag to find out)
- works on older computer (intel drop opengl support older graphics card (< 2011, according to a customer) on Windows 10 while there where no issue on Windows 7)
Known issues:
- stencil doesn't work on Windows 7 on Virtual BOX, but even their samples doesn't work, while firefox and chrome that uses angle (according to http://www.browserleaks.com/webgl)
- line doesn't show on Windows 10
TODO:
- continue to separate fully the GL context in order to dynamically switch to another implementation at runtime
- be able to use MOCK without recompilation
- be able to use DEBUG opengl (check glGetError after every command) without recompilation
- be able to either use DESKTOP opengl or ANGLE opengl without recompilation
- stencil fixes or alternative
- line fixes or alternative
Suggestions:
- if stencil is really an issue, there is a possibility to use scissor. It might be faster, but doesn't support stack, and have addional limitation, such as: scissor must be aligned to the windows while stencil can be rotated + position of the scissor must be in windows coordinate. They may have a possibility to make "hybrid" instructions that either use scissor or stencil depending the current matrix. On standard ui (without any scatter/rotation), only scissor would be used.
2016-05-30 21:51:36 +00:00
|
|
|
BUILD_OPTS_DEBUG = $(BUILD_OPTS_FORCE) -g
|
2015-01-25 12:09:36 +00:00
|
|
|
|
|
|
|
INSTALL_OPTIONS = install
|
2015-12-01 10:22:13 +00:00
|
|
|
INSTALL_ROOT =
|
|
|
|
INSTALL_PREFIX =
|
|
|
|
INSTALL_LAYOUT =
|
2015-01-25 12:09:36 +00:00
|
|
|
|
2015-01-25 15:02:28 +00:00
|
|
|
ifneq ($(INSTALL_ROOT),)
|
2015-01-25 12:09:36 +00:00
|
|
|
INSTALL_OPTIONS += --root=$(INSTALL_ROOT)
|
|
|
|
endif
|
2015-01-25 15:02:28 +00:00
|
|
|
ifneq ($(INSTALL_PREFIX),)
|
2015-01-25 12:09:36 +00:00
|
|
|
INSTALL_OPTIONS += --prefix=$(INSTALL_PREFIX)
|
|
|
|
endif
|
2015-01-25 15:02:28 +00:00
|
|
|
ifneq ($(INSTALL_LAYOUT),)
|
2015-01-25 12:09:36 +00:00
|
|
|
INSTALL_OPTIONS += --install-layout=$(INSTALL_LAYOUT)
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2016-12-17 17:12:14 +00:00
|
|
|
.PHONY: build force mesabuild pdf style hook test batchtest cover clean distclean theming
|
2011-04-23 16:08:31 +00:00
|
|
|
|
2011-01-16 15:55:21 +00:00
|
|
|
build:
|
2015-01-25 12:09:36 +00:00
|
|
|
$(PYTHON) setup.py $(BUILD_OPTS)
|
2011-01-16 15:55:21 +00:00
|
|
|
|
2011-03-24 18:05:20 +00:00
|
|
|
force:
|
2015-01-25 12:09:36 +00:00
|
|
|
$(PYTHON) setup.py $(BUILD_OPTS_FORCE)
|
2011-03-24 18:05:20 +00:00
|
|
|
|
2013-04-19 09:18:18 +00:00
|
|
|
debug:
|
2015-01-25 12:09:36 +00:00
|
|
|
$(PYTHON) setup.py $(BUILD_OPTS_DEBUG)
|
2013-04-19 09:18:18 +00:00
|
|
|
|
2011-03-16 12:53:35 +00:00
|
|
|
mesabuild:
|
2015-01-25 12:09:36 +00:00
|
|
|
env USE_MESAGL=1 $(PYTHON) setup.py $(BUILD_OPTS)
|
2011-03-16 12:53:35 +00:00
|
|
|
|
2012-02-24 01:09:45 +00:00
|
|
|
ios:
|
2011-12-01 16:45:33 +00:00
|
|
|
-ln -s $(KIVYIOSROOT)/Python-2.7.1/python
|
|
|
|
-ln -s $(KIVYIOSROOT)/Python-2.7.1/python.exe
|
2011-05-12 08:12:38 +00:00
|
|
|
|
2011-05-12 09:54:22 +00:00
|
|
|
-rm -rdf iosbuild/
|
|
|
|
mkdir iosbuild
|
|
|
|
|
2011-05-12 08:12:38 +00:00
|
|
|
echo "First build ========================================"
|
2012-02-25 10:38:19 +00:00
|
|
|
-PATH="$(IOSPATH)" $(HOSTPYTHON) setup.py build_ext -g
|
2011-05-12 08:12:38 +00:00
|
|
|
echo "cythoning =========================================="
|
2012-07-18 11:19:31 +00:00
|
|
|
find . -name *.pyx -exec cython {} \;
|
2011-05-12 08:12:38 +00:00
|
|
|
echo "Second build ======================================="
|
2011-12-01 16:45:33 +00:00
|
|
|
PATH="$(IOSPATH)" $(HOSTPYTHON) setup.py build_ext -g
|
2011-12-02 18:23:28 +00:00
|
|
|
PATH="$(IOSPATH)" $(HOSTPYTHON) setup.py install -O2 --root iosbuild
|
2011-05-12 09:54:22 +00:00
|
|
|
# Strip away the large stuff
|
2013-01-04 16:41:13 +00:00
|
|
|
find iosbuild/ | grep -E '.*\.(py|pyc|so\.o|so\.a|so\.libs)$$' | xargs rm
|
2011-12-06 09:51:47 +00:00
|
|
|
-rm -rdf "$(BUILDROOT)/python/lib/python2.7/site-packages/kivy"
|
2011-05-12 09:54:22 +00:00
|
|
|
# Copy to python for iOS installation
|
2011-12-06 09:51:47 +00:00
|
|
|
cp -R "iosbuild/usr/local/lib/python2.7/site-packages/kivy" "$(BUILDROOT)/python/lib/python2.7/site-packages"
|
2011-05-12 08:12:38 +00:00
|
|
|
|
2015-01-27 10:58:03 +00:00
|
|
|
pdf: build
|
2016-02-24 21:53:48 +00:00
|
|
|
-cd doc && $(MAKE) pdf
|
2015-12-01 10:22:13 +00:00
|
|
|
cd doc && $(MAKE) pdf
|
2011-03-16 12:48:07 +00:00
|
|
|
|
2015-01-27 10:58:03 +00:00
|
|
|
html: build
|
2015-01-25 11:58:14 +00:00
|
|
|
cd doc && $(MAKE) html
|
2015-01-25 10:21:51 +00:00
|
|
|
|
|
|
|
html-embedded:
|
2013-02-25 15:42:24 +00:00
|
|
|
env USE_EMBEDSIGNATURE=1 $(MAKE) force
|
2011-06-24 13:56:24 +00:00
|
|
|
$(MAKE) -C doc html
|
|
|
|
|
2011-01-12 18:05:55 +00:00
|
|
|
style:
|
2015-02-01 21:09:53 +00:00
|
|
|
$(PYTHON) $(CHECKSCRIPT) .
|
2011-01-12 18:05:55 +00:00
|
|
|
|
2011-01-13 14:25:07 +00:00
|
|
|
hook:
|
2011-03-16 12:48:07 +00:00
|
|
|
# Install pre-commit git hook to check your changes for styleguide
|
|
|
|
# consistency.
|
2011-01-13 14:25:07 +00:00
|
|
|
cp kivy/tools/pep8checker/pre-commit.githook .git/hooks/pre-commit
|
|
|
|
chmod +x .git/hooks/pre-commit
|
2011-01-20 23:02:29 +00:00
|
|
|
|
|
|
|
test:
|
2011-01-27 15:42:48 +00:00
|
|
|
-rm -rf kivy/tests/build
|
2012-06-11 08:34:02 +00:00
|
|
|
$(NOSETESTS) kivy/tests
|
2011-01-20 23:02:29 +00:00
|
|
|
|
|
|
|
cover:
|
2012-01-20 12:18:46 +00:00
|
|
|
coverage html --include='$(KIVY_DIR)*' --omit '$(KIVY_DIR)data/*,$(KIVY_DIR)lib/*,$(KIVY_DIR)tools/*,$(KIVY_DIR)tests/*'
|
2011-01-20 23:11:42 +00:00
|
|
|
|
2012-01-02 19:10:03 +00:00
|
|
|
install:
|
2015-01-25 15:28:55 +00:00
|
|
|
$(PYTHON) setup.py $(INSTALL_OPTIONS)
|
2015-01-25 12:09:36 +00:00
|
|
|
|
2011-01-20 23:11:42 +00:00
|
|
|
clean:
|
2015-01-25 10:25:44 +00:00
|
|
|
$(MAKE) -C doc clean
|
2011-01-20 23:11:42 +00:00
|
|
|
-rm -rf build
|
|
|
|
-rm -rf htmlcov
|
2015-01-24 16:29:43 +00:00
|
|
|
-rm -f .coverage
|
|
|
|
-rm -f .noseids
|
2011-01-27 02:38:24 +00:00
|
|
|
-rm -rf kivy/tests/build
|
2012-07-24 05:52:34 +00:00
|
|
|
-find kivy -iname '*.so' -exec rm {} \;
|
2011-01-30 13:59:02 +00:00
|
|
|
-find kivy -iname '*.pyc' -exec rm {} \;
|
|
|
|
-find kivy -iname '*.pyo' -exec rm {} \;
|
2013-04-03 18:07:31 +00:00
|
|
|
-find . -iname '*.pyx' -exec sh -c 'echo `dirname {}`/`basename {} .pyx`.c' \; | xargs rm
|
2011-01-20 23:11:42 +00:00
|
|
|
|
|
|
|
distclean: clean
|
2015-01-24 13:22:31 +00:00
|
|
|
ifneq ($(GIT_COMMAND),)
|
2015-01-24 11:09:09 +00:00
|
|
|
@echo "Using GIT at $(GIT_COMMAND) to make a distclean..."
|
2014-02-26 16:56:57 +00:00
|
|
|
-git clean -dxf -e debian
|
2015-01-24 11:09:09 +00:00
|
|
|
else
|
|
|
|
@echo "GIT not found to make a distclean..."
|
|
|
|
endif
|
2012-06-23 17:26:55 +00:00
|
|
|
|
|
|
|
theming:
|
2012-07-28 18:09:35 +00:00
|
|
|
$(PYTHON) -m kivy.atlas kivy/data/images/defaulttheme 512 kivy/tools/theming/defaulttheme/*.png
|
2015-02-08 14:41:33 +00:00
|
|
|
|
|
|
|
help:
|
|
|
|
@echo "Please use \`make <target>' where <target> is one of"
|
|
|
|
@echo " build for a standard build"
|
|
|
|
@echo " clean remove generated and compiled files"
|
|
|
|
@echo " cover create an html coverage report of unittests"
|
|
|
|
@echo " debug for a debug build (with -g)"
|
|
|
|
@echo " dist-clean clean then use 'git clean'"
|
|
|
|
@echo " force for a forced build (with -f)"
|
|
|
|
@echo " hook add Pep-8 checking as a git precommit hook"
|
|
|
|
@echo " html to make standalone HTML files"
|
|
|
|
@echo " install run a setup.py install"
|
|
|
|
@echo " mesabuild for a build with MesaGL"
|
2016-12-17 16:04:22 +00:00
|
|
|
@echo " style to check Python code for style issues"
|
2015-02-08 14:41:33 +00:00
|
|
|
@echo " test run unittests (nosetests)"
|
|
|
|
@echo " theming create a default theme atlas"
|
|
|
|
@echo " "
|
|
|
|
@echo "You can also 'cd doc && make help' to build more documentation types"
|