kivy/Makefile

83 lines
2.2 KiB
Makefile
Raw Normal View History

PYTHON = python
CHECKSCRIPT = kivy/tools/pep8checker/pep8kivy.py
KIVY_DIR = kivy/
HOSTPYTHON = $(KIVYIOSROOT)/Python-2.7.1/hostpython
2011-05-14 18:46:46 +00:00
IOSPATH := $(PATH):/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin
.PHONY: build force mesabuild pdf style stylereport hook test batchtest cover clean distclean
build:
$(PYTHON) setup.py build_ext --inplace
force:
$(PYTHON) setup.py build_ext --inplace -f
mesabuild:
$(PYTHON) setup.py build_ext --inplace --define __MESAGL__
ios-build:
-ln -s $(KIVYIOSROOT)/Python-2.7.1/python
-ln -s $(KIVYIOSROOT)/Python-2.7.1/python.exe
2011-05-12 09:54:22 +00:00
-rm -rdf iosbuild/
mkdir iosbuild
echo "First build ========================================"
-PATH="$(IOSPATH)" $(HOSTPYTHON) setup.py build_ext -g
echo "cythoning =========================================="
find . -name *.pyx -exec cython {} \;
ios-install:
echo "Second build ======================================="
PATH="$(IOSPATH)" $(HOSTPYTHON) setup.py build_ext -g
PATH="$(IOSPATH)" $(HOSTPYTHON) setup.py install -O0 --root iosbuild
2011-05-12 09:54:22 +00:00
# Strip away the large stuff
find iosbuild/ | grep -E '*\.(py|pyc|so\.o|so\.a|so\.libs)$$' | xargs rm
-rm -rdf "$(KIVYIOSROOT)/python_files/Python-2.7.1-IOS5.0-device/lib/python2.7/site-packages/kivy"
2011-05-12 09:54:22 +00:00
# Copy to python for iOS installation
cp -R "iosbuild/usr/local/lib/python2.7/site-packages/kivy" "$(KIVYIOSROOT)/python_files/Python-2.7.1-IOS5.0-device/lib/python2.7/site-packages"
ios: ios-build ios-install
pdf:
$(MAKE) -C doc latex && make -C doc/build/latex all-pdf
html:
$(MAKE) -C doc html
style:
$(PYTHON) $(CHECKSCRIPT) $(KIVY_DIR)
stylereport:
$(PYTHON) $(CHECKSCRIPT) -html $(KIVY_DIR)
2011-01-13 14:25:07 +00:00
hook:
# 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
test:
-rm -rf kivy/tests/build
nosetests kivy/tests
batchtest:
-rm -rf kivy/tests/build
nosetests kivy/tests
cover:
coverage html --include='$(KIVY_DIR)*' --omit '$(KIVY_DIR)lib/*,$(KIVY_DIR)tools/*,$(KIVY_DIR)tests/*'
clean:
-rm -rf doc/build
-rm -rf build
-rm -rf htmlcov
-rm .coverage
-rm .noseids
-rm -rf kivy/tests/build
-find kivy -iname '*.pyc' -exec rm {} \;
-find kivy -iname '*.pyo' -exec rm {} \;
distclean: clean
-git clean -dxf