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