source: Makefile @ 22e991b

feature/autosinkfeature/constantqfeature/pitchshiftfeature/pydocstringsfeature/timestretchsampleryinfft+
Last change on this file since 22e991b was 22e991b, checked in by Paul Brossier <piem@piem.org>, 3 years ago

Makefile, .travis.yml: merge test_python and test_python_osx rules

  • Property mode set to 100644
File size: 3.3 KB
Line 
1WAFCMD=python waf
2WAFURL=https://waf.io/waf-1.8.22
3
4SOX=sox
5
6ENABLE_DOUBLE := $(shell [ -z $(HAVE_DOUBLE) ] || echo --enable-double )
7TESTSOUNDS := python/tests/sounds
8
9all: build
10
11checkwaf:
12        @[ -f waf ] || make getwaf
13
14getwaf:
15        ./scripts/get_waf.sh
16
17expandwaf: 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
24cleanwaf:
25        rm -rf waf waflib .waf*
26
27configure: checkwaf
28        $(WAFCMD) configure $(WAFOPTS) $(ENABLE_DOUBLE)
29
30build: configure
31        $(WAFCMD) build $(WAFOPTS)
32
33build_python:
34        python ./setup.py build_ext $(ENABLE_DOUBLE)
35
36test_python: export LD_LIBRARY_PATH=$(PWD)/build/src
37test_python: local_dylib
38        # clean
39        -pip uninstall -v -y aubio
40        ./setup.py clean
41        $(WAFCMD) distclean
42        # build library
43        $(WAFCMD) configure build
44        # install python requirements
45        pip install -v -r requirements.txt
46        # install package
47        pip install -v .
48        # can clean twice
49        ./setup.py clean
50        ./setup.py clean
51        # run test with installed package
52        ./python/tests/run_all_tests --verbose
53        nose2 -N 4 #--verbose
54        # uninstall package
55        pip uninstall -y -v aubio
56
57local_dylib:
58        # create links from ~/lib/lib* to build/src/lib*
59        [ -f build/src/libaubio.[0-9].dylib ] && ( mkdir -p ~/lib && cp -prv build/src/libaubio.[0-9].dylib ~/lib ) || true
60
61clean_python:
62        ./setup.py clean
63
64test_pure_python:
65        # clean
66        -pip uninstall -v -y aubio
67        -$(WAFCMD) distclean
68        ./setup.py clean
69        # install python requirements
70        pip install --verbose --requirement requirements.txt
71        # compile
72        CFLAGS=-Os python setup.py build $(ENABLE_DOUBLE)
73        # needs recompile, disabled
74        #./setup.py test
75        # install package
76        pip install --verbose .
77        # can clean twice
78        ./setup.py clean
79        ./setup.py clean
80        # run test with installed package
81        ./python/tests/run_all_tests --verbose
82        nose2 -N 4 #--verbose
83        # uninstall
84        pip uninstall -v -y aubio
85
86test_pure_python_wheel:
87        -pip uninstall -v -y aubio
88        -rm -rf build/ python/gen/
89        -rm -f dist/*.whl
90        -pip install -v -r requirements.txt
91        -pip install -v wheel
92        CFLAGS=-Os python setup.py build_ext $(ENABLE_DOUBLE) bdist_wheel --universal
93        wheel install dist/*.whl
94        nose2 -N 4
95        pip uninstall -v -y aubio
96
97build_python3:
98        python3 ./setup.py build_ext $(ENABLE_DOUBLE)
99
100clean_python3:
101        python3 ./setup.py clean
102
103clean:
104        $(WAFCMD) clean
105
106distclean:
107        $(WAFCMD) distclean
108
109distcheck: checkwaf
110        $(WAFCMD) distcheck $(WAFOPTS) $(ENABLE_DOUBLE)
111
112help:
113        $(WAFCMD) --help
114
115create_test_sounds:
116        -[ -z `which $(SOX)` ] && ( echo $(SOX) could not be found) || true
117        -mkdir -p $(TESTSOUNDS)
118        -$(SOX) -r 44100 -b 16 -n "$(TESTSOUNDS)/44100Hz_1f_silence.wav"          synth 1s   silence 0        dcshift .01
119        -$(SOX) -r 22050 -b 16 -n "$(TESTSOUNDS)/22050Hz_5s_brownnoise.wav"   synth 5    brownnoise      vol 0.9
120        -$(SOX) -r 32000 -b 16 -n "$(TESTSOUNDS)/32000Hz_127f_sine440.wav"    synth 127s sine 440        vol 0.9
121        -$(SOX) -r  8000 -b 16 -n "$(TESTSOUNDS)/8000Hz_30s_silence.wav"      synth 30   silence 0       vol 0.9
122        -$(SOX) -r 48000 -b 32 -n "$(TESTSOUNDS)/48000Hz_60s_sweep.wav"       synth 60   sine 100-20000  vol 0.9
123        -$(SOX) -r 44100 -b 16 -n "$(TESTSOUNDS)/44100Hz_44100f_sine441.wav"  synth 44100s   sine 441   vol 0.9
124        -$(SOX) -r 44100 -b 16 -n "$(TESTSOUNDS)/44100Hz_100f_sine441.wav"    synth 100s sine 441       vol 0.9
125
126html:
127        cd doc && make html
128
129dist: distclean expandwaf
130        $(WAFCMD) dist
Note: See TracBrowser for help on using the repository browser.