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