source: Makefile @ 3d2e481

sampler
Last change on this file since 3d2e481 was fee4570, checked in by Paul Brossier <piem@piem.org>, 8 years ago

Makefile: use bdist_wheel in test_pure_python

  • Property mode set to 100644
File size: 2.5 KB
RevLine 
[81ad577]1WAFCMD=python waf
[7f35041]2WAFURL=https://waf.io/waf-1.8.22
[6a6cb48]3
[be06e53]4SOX=sox
5
[6a6cb48]6ENABLE_DOUBLE := $(shell [ -z $(HAVE_DOUBLE) ] || echo --enable-double )
[ceb884d]7TESTSOUNDS := python/tests/sounds
[6a6cb48]8
[8e94af5]9all: build
10
11checkwaf:
12        @[ -f waf ] || make getwaf
13
14getwaf:
[65fc06f]15        @./scripts/get_waf.sh
[81ad577]16
17expandwaf:
[8e94af5]18        @[ -d wafilb ] || rm -fr waflib
[81ad577]19        @$(WAFCMD) --help > /dev/null
[0e39e88]20        @mv .waf*/waflib . && rm -fr .waf*
[6121dd4]21        @sed '/^#==>$$/,$$d' waf > waf2 && mv waf2 waf
[8e94af5]22        @chmod +x waf
23
[e372a0f]24configure: checkwaf
[6a6cb48]25        $(WAFCMD) configure $(WAFOPTS) $(ENABLE_DOUBLE)
[e372a0f]26
27build: configure
[3fc5696]28        $(WAFCMD) build $(WAFOPTS)
[8e94af5]29
[972a326]30build_python:
[5a7c000]31        python ./setup.py build_ext $(ENABLE_DOUBLE)
[972a326]32
[1167631]33test_python: export LD_LIBRARY_PATH=$(PWD)/build/src
[69212a0]34test_python:
[1167631]35        pip install -v -r requirements.txt
36        pip install -v .
37        nose2 --verbose
38        pip uninstall -y -v aubio
[39122f0]39
40test_python_osx:
[1167631]41        # create links from ~/lib/lib* to build/src/lib*
[4c38b62]42        [ -f build/src/libaubio.[0-9].dylib ] && ( mkdir -p ~/lib && cp -prv build/src/libaubio.[0-9].dylib ~/lib ) || true
[1167631]43        # then run the tests
44        pip install --user -v -r requirements.txt
45        pip install --user -v .
46        nose2 --verbose
47        pip uninstall -y -v aubio
[69212a0]48
[972a326]49clean_python:
[1167631]50        ./setup.py clean
[972a326]51
[f465088]52test_pure_python:
53        -pip uninstall -v -y aubio
54        -rm -rf build/ python/gen/
55        -rm -f dist/*.egg
56        -pip install -v -r requirements.txt
[fee4570]57        CFLAGS=-Os python setup.py build_ext $(ENABLE_DOUBLE) bdist_wheel
58        pip install dist/aubio-*.whl
[f465088]59        nose2 -N 4
60        pip uninstall -v -y aubio
61
62test_pure_python_wheel:
63        -pip uninstall -v -y aubio
64        -rm -rf build/ python/gen/
65        -rm -f dist/*.whl
66        -pip install -v -r requirements.txt
67        -pip install -v wheel
[8706a42]68        CFLAGS=-Os python setup.py build_ext $(ENABLE_DOUBLE) bdist_wheel --universal
[f465088]69        wheel install dist/*.whl
70        nose2 -N 4
71        pip uninstall -v -y aubio
72
[a2ae70a]73build_python3:
[5a7c000]74        python3 ./setup.py build_ext $(ENABLE_DOUBLE)
[a2ae70a]75
76clean_python3:
[1167631]77        python3 ./setup.py clean
[a2ae70a]78
[ddd9861]79clean:
[81ad577]80        $(WAFCMD) clean
[ddd9861]81
[8706a42]82distclean:
83        $(WAFCMD) distclean
84
[e372a0f]85distcheck: checkwaf
[7aed123]86        $(WAFCMD) distcheck $(WAFOPTS) $(ENABLE_DOUBLE)
[8e94af5]87
88help:
[81ad577]89        $(WAFCMD) --help
[be06e53]90
91create_test_sounds:
[3a7b7c6]92        -[ -z `which $(SOX)` ] && ( echo $(SOX) could not be found) || true
93        -mkdir -p $(TESTSOUNDS)
[ceb884d]94        -$(SOX) -r 44100 -b 16 -n "$(TESTSOUNDS)/44100Hz_1f_silence.wav"      synth 1s   silence 0
95        -$(SOX) -r 22050 -b 16 -n "$(TESTSOUNDS)/22050Hz_5s_brownnoise.wav"   synth 5    brownnoise      vol 0.9
96        -$(SOX) -r 32000 -b 16 -n "$(TESTSOUNDS)/32000Hz_127f_sine440.wav"    synth 127s sine 440        vol 0.9
97        -$(SOX) -r  8000 -b 16 -n "$(TESTSOUNDS)/8000Hz_30s_silence.wav"      synth 30   silence 0       vol 0.9
98        -$(SOX) -r 48000 -b 32 -n "$(TESTSOUNDS)/48000Hz_60s_sweep.wav"       synth 60   sine 100-20000  vol 0.9
Note: See TracBrowser for help on using the repository browser.