+#!/usr/bin/make -f
+# -*- makefile -*-
+#
+# This makefile contains simple rules to prepare, compile, test, and install
+# aubio. Try one of the following rules:
+#
+# $ make configure
+# $ make build
+# $ make install
+# $ make test_python
+
WAFCMD=python waf
WAFURL=https://waf.io/waf-1.8.22
#WAFOPTS:=
# turn on verbose mode
-#WAFOPTS += --verbose
+WAFOPTS += --verbose
# build wafopts
WAFOPTS += --destdir $(DESTDIR)
# multiple jobs
WAFOPTS += --jobs 4
+# if HAVE_AUBIO_DOUBLE is defined, pass --enable-double to waf
+# python/lib/moresetuptools.py also checks for HAVE_AUBIO_DOUBLE
+WAFOPTS += $(shell [ -z $(HAVE_AUBIO_DOUBLE) ] || echo --enable-double )
+
+PIPOPTS += --verbose
DESTDIR:=$(PWD)/build/dist
PYDESTDIR:=$(PWD)/build/pydist
SOX=sox
-ENABLE_DOUBLE := $(shell [ -z $(HAVE_DOUBLE) ] || echo --enable-double )
TESTSOUNDS := python/tests/sounds
all: build
rm -rf waf waflib .waf*
configure: checkwaf
- $(WAFCMD) configure $(WAFOPTS) $(ENABLE_DOUBLE)
+ $(WAFCMD) configure $(WAFOPTS)
build: configure
$(WAFCMD) build $(WAFOPTS)
install:
# install
$(WAFCMD) install $(WAFOPTS)
- make list_installed
list_installed:
find $(DESTDIR) -ls | sed 's|$(DESTDIR)|/«destdir»|'
list_installed_python:
- find $(PYDESTDIR) -ls | sed 's|$(PYDESTDIR)|/«pydestdir»|'
+ pip show -f aubio
+
+list_all_installed: list_installed list_installed_python
uninstall:
# uninstall
build_python:
# build python-aubio, using locally built libaubio if found
- python ./setup.py build $(ENABLE_DOUBLE)
+ python ./setup.py build
build_python_extlib:
# build python-aubio using (locally) installed libaubio
[ -d $(DESTDIR)/$(LIBDIR) ]
[ -f $(DESTDIR)/$(LIBDIR)/pkgconfig/aubio.pc ]
PKG_CONFIG_PATH=$(DESTDIR)/$(LIBDIR)/pkgconfig \
- CFLAGS="-I$(DESTDIR)/$(INCLUDEDIR) $(CFLAGS)" \
- LDFLAGS="-L$(DESTDIR)/$(LIBDIR) $(CFLAGS)" \
+ CFLAGS="-I$(DESTDIR)/$(INCLUDEDIR)" \
+ LDFLAGS="-L$(DESTDIR)/$(LIBDIR)" \
make build_python
- make list_installed
- cat $(DESTDIR)/$(LIBDIR)/pkgconfig/aubio.pc
deps_python:
# install or upgrade python requirements
- pip install --verbose --upgrade --requirement requirements.txt
+ pip install $(PIPOPTS) --requirement requirements.txt
# use pip or distutils?
-#install_python: install_python_with_pip
+install_python: install_python_with_pip
uninstall_python: uninstall_python_with_pip
-install_python: install_python_with_distutils
+#install_python: install_python_with_distutils
#uninstall_python: uninstall_python_with_distutils
install_python_with_pip:
# install package
- pip install --verbose .
+ pip install $(PIPOPTS) .
uninstall_python_with_pip:
# uninstall package
pip uninstall -y -v aubio || make uninstall_python_with_distutils
install_python_with_distutils:
- ./setup.py install $(DISTUTILSOPTS)
+ ./setup.py install $(PIPOPTS) $(DISTUTILSOPTS)
uninstall_python_with_distutils:
#./setup.py uninstall
./python/tests/run_all_tests --verbose
# also run with nose, multiple processes
nose2 -N 4
- # list installed files
- #find $(DESTDIR) -ls | sed 's|$(DESTDIR)||'
- make list_installed_python
clean_python:
./setup.py clean
clean: checkwaf
# optionnaly clean before build
-$(WAFCMD) clean
+ # remove possible left overs
+ -rm -rf doc/_build
check_clean:
# check cleaning after build works
make distclean
distcheck: checkwaf
- $(WAFCMD) distcheck $(WAFOPTS) $(ENABLE_DOUBLE)
+ $(WAFCMD) distcheck $(WAFOPTS)
help:
$(WAFCMD) --help
-$(SOX) -r 44100 -b 16 -n "$(TESTSOUNDS)/44100Hz_100f_sine441.wav" synth 100s sine 441 vol 0.9
# build only libaubio, no python-aubio
-test_lib_only: clean distclean configure build install
+test_lib_only: clean distclean configure build install list_installed
# additionally, clean after a fresh build
test_lib_only_clean: test_lib_only uninstall check_clean check_distclean
clean_python clean distclean \
configure build build_python \
install install_python \
- test_python
+ test_python \
+ list_all_installed
test_lib_python_clean: test_lib_python \
uninstall_python uninstall \
install \
build_python_extlib \
install_python \
- test_python
+ test_python \
+ list_all_installed
test_lib_install_python_clean: test_lib_install_python \
uninstall_python \
clean_python clean distclean \
build_python \
install_python \
- test_python
+ test_python \
+ list_installed_python
test_python_only_clean: test_python_only \
uninstall_python \
check_clean_python
+sphinx: configure
+ $(WAFCMD) sphinx $(WAFOPTS)
+
+doxygen: configure
+ $(WAFCMD) doxygen $(WAFOPTS)
+
+manpages: configure
+ $(WAFCMD) manpages $(WAFOPTS)
+
+html: doxygen sphinx
-html:
- cd doc && make html
+docs: html manpages
dist: distclean expandwaf
$(WAFCMD) dist