source: Makefile @ f465088

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since f465088 was f465088, checked in by Paul Brossier <piem@piem.org>, 8 years ago

Makefile: added rules to build python-aubio without libaubio

  • Property mode set to 100644
File size: 2.4 KB
Line 
1WAFCMD=python waf
2
3SOX=sox
4
5ENABLE_DOUBLE := $(shell [ -z $(HAVE_DOUBLE) ] || echo --enable-double )
6TESTSOUNDS := python/tests/sounds
7
8all: build
9
10checkwaf:
11        @[ -f waf ] || make getwaf
12
13getwaf:
14        curl https://waf.io/waf-1.8.20 > waf
15        @chmod +x waf
16
17expandwaf:
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
24configure: checkwaf
25        $(WAFCMD) configure $(WAFOPTS) $(ENABLE_DOUBLE)
26
27build: configure
28        $(WAFCMD) build $(WAFOPTS)
29
30build_python:
31        python ./setup.py generate $(ENABLE_DOUBLE) build
32
33test_python: export LD_LIBRARY_PATH=$(PWD)/build/src
34test_python:
35        pip install -v -r requirements.txt
36        pip install -v .
37        nose2 --verbose
38        pip uninstall -y -v aubio
39
40test_python_osx:
41        # create links from ~/lib/lib* to build/src/lib*
42        [ -f build/src/libaubio.[0-9].dylib ] && ( mkdir -p ~/lib && cp -prv build/src/libaubio.4.dylib ~/lib ) || true
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
48
49clean_python:
50        ./setup.py clean
51
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
57        CFLAGS=-Os python setup.py bdist_egg
58        easy_install dist/*.egg
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
68        CFLAGS=-Os python setup.py bdist_wheel --universal
69        wheel install dist/*.whl
70        nose2 -N 4
71        pip uninstall -v -y aubio
72
73build_python3:
74        python3 ./setup.py generate $(ENABLE_DOUBLE) build
75
76clean_python3:
77        python3 ./setup.py clean
78
79clean:
80        $(WAFCMD) clean
81
82distcheck: checkwaf
83        $(WAFCMD) distcheck $(WAFOPTS) $(ENABLE_DOUBLE)
84
85help:
86        $(WAFCMD) --help
87
88create_test_sounds:
89        -[ -z `which $(SOX)` ] && ( echo $(SOX) could not be found) || true
90        -mkdir -p $(TESTSOUNDS)
91        -$(SOX) -r 44100 -b 16 -n "$(TESTSOUNDS)/44100Hz_1f_silence.wav"      synth 1s   silence 0
92        -$(SOX) -r 22050 -b 16 -n "$(TESTSOUNDS)/22050Hz_5s_brownnoise.wav"   synth 5    brownnoise      vol 0.9
93        -$(SOX) -r 32000 -b 16 -n "$(TESTSOUNDS)/32000Hz_127f_sine440.wav"    synth 127s sine 440        vol 0.9
94        -$(SOX) -r  8000 -b 16 -n "$(TESTSOUNDS)/8000Hz_30s_silence.wav"      synth 30   silence 0       vol 0.9
95        -$(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.