kivy/Makefile

122 lines
3.3 KiB
Makefile
Raw Normal View History

PYTHON = python
CHECKSCRIPT = kivy/tools/pep8checker/pep8kivy.py
KIVY_DIR = kivy/
NOSETESTS = nosetests
KIVY_USE_DEFAULTCONFIG = 1
HOSTPYTHON = $(KIVYIOSROOT)/tmp/Python-$(PYTHON_VERSION)/hostpython
2011-05-14 18:46:46 +00:00
IOSPATH := $(PATH):/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin
2015-01-25 12:09:36 +00:00
BUILD_OPTS = build_ext --inplace
BUILD_OPTS_FORCE = $(BUILD_OPTS) -f
BUILD_OPTS_DEBUG = $(BUILD_OPTS_FORCE)-g
INSTALL_OPTIONS = install
INSTALL_ROOT =
INSTALL_PREFIX =
INSTALL_LAYOUT =
ifeq ($(INSTALL_ROOT),)
INSTALL_OPTIONS += --root=$(INSTALL_ROOT)
endif
ifeq ($(INSTALL_PREFIX),)
INSTALL_OPTIONS += --prefix=$(INSTALL_PREFIX)
endif
ifeq ($(INSTALL_LAYOUT),)
INSTALL_OPTIONS += --install-layout=$(INSTALL_LAYOUT)
endif
2012-06-23 17:26:55 +00:00
.PHONY: build force mesabuild pdf style stylereport hook test batchtest cover clean distclean theming
prebuild:
ifeq ("$(wildcard kivy-already-built-for-$(PYTHON))","")
@echo Building Kivy as it is not already done!
2015-01-25 12:09:36 +00:00
$(PYTHON) setup.py $(BUILD_OPTS)
touch kivy-already-built-for-$(PYTHON)
else
@echo Kivy is already built for \"$(PYTHON)\"!
endif
build:
2015-01-25 12:09:36 +00:00
$(PYTHON) setup.py $(BUILD_OPTS)
force:
2015-01-25 12:09:36 +00:00
$(PYTHON) setup.py $(BUILD_OPTS_FORCE)
debug:
2015-01-25 12:09:36 +00:00
$(PYTHON) setup.py $(BUILD_OPTS_DEBUG)
mesabuild:
2015-01-25 12:09:36 +00:00
env USE_MESAGL=1 $(PYTHON) setup.py $(BUILD_OPTS)
ios:
-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 {} \;
echo "Second build ======================================="
PATH="$(IOSPATH)" $(HOSTPYTHON) setup.py build_ext -g
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
-rm -rdf "$(BUILDROOT)/python/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" "$(BUILDROOT)/python/lib/python2.7/site-packages"
pdf: prebuild
cd doc && $(MAKE) pdf
html: prebuild
cd doc && $(MAKE) html
html-embedded:
env USE_EMBEDSIGNATURE=1 $(MAKE) force
$(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
cover:
coverage html --include='$(KIVY_DIR)*' --omit '$(KIVY_DIR)data/*,$(KIVY_DIR)lib/*,$(KIVY_DIR)tools/*,$(KIVY_DIR)tests/*'
2012-01-02 19:10:03 +00:00
install:
2015-01-25 12:09:36 +00:00
python setup.py $(INSTALL_OPTIONS)
clean:
$(MAKE) -C doc clean
-rm -f kivy-already-built*
-rm -rf build
-rm -rf htmlcov
-rm -f .coverage
-rm -f .noseids
-rm -rf kivy/tests/build
-find kivy -iname '*.so' -exec rm {} \;
-find kivy -iname '*.pyc' -exec rm {} \;
-find kivy -iname '*.pyo' -exec rm {} \;
-find . -iname '*.pyx' -exec sh -c 'echo `dirname {}`/`basename {} .pyx`.c' \; | xargs rm
distclean: clean
-git clean -dxf -e debian
2012-06-23 17:26:55 +00:00
theming:
$(PYTHON) -m kivy.atlas kivy/data/images/defaulttheme 512 kivy/tools/theming/defaulttheme/*.png