source: wscript @ 23facac

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5
Last change on this file since 23facac was 9fabad5, checked in by Martin Hermant <martin.hermant@gmail.com>, 7 years ago

wscript :

  • use waf/extra/c_emscripten
  • use node to test js files

add get_waf_emscripten to setup waf with emscripten

  • Property mode set to 100644
File size: 22.7 KB
Line 
1#! /usr/bin/python
2#
3# usage:
4#   $ python waf --help
5#
6# example:
7#   $ ./waf distclean configure build
8#
9# Note: aubio uses the waf build system, which relies on Python. Provided you
10# have Python installed, you do *not* need to install anything to build aubio.
11# For more info about waf, see http://code.google.com/p/waf/ .
12
13import sys
14
15APPNAME = 'aubio'
16
17from this_version import *
18
19VERSION = get_aubio_version()
20LIB_VERSION = get_libaubio_version()
21
22top = '.'
23out = 'build'
24
25def add_option_enable_disable(ctx, name, default = None,
26        help_str = None, help_disable_str = None):
27    if help_str == None:
28        help_str = 'enable ' + name + ' support'
29    if help_disable_str == None:
30        help_disable_str = 'do not ' + help_str
31    ctx.add_option('--enable-' + name, action = 'store_true',
32            default = default,
33            dest = 'enable_' + name.replace('-','_'),
34            help = help_str)
35    ctx.add_option('--disable-' + name, action = 'store_false',
36            #default = default,
37            dest = 'enable_' + name.replace('-','_'),
38            help = help_disable_str )
39
40def options(ctx):
41    ctx.add_option('--build-type', action = 'store',
42            default = "release",
43            choices = ('debug', 'release'),
44            dest = 'build_type',
45            help = 'whether to compile with (--build-type=release) or without (--build-type=debug) '\
46              ' compiler opimizations [default: release]')
47    add_option_enable_disable(ctx, 'fftw3f', default = False,
48            help_str = 'compile with fftw3f instead of ooura (recommended)',
49            help_disable_str = 'do not compile with fftw3f')
50    add_option_enable_disable(ctx, 'fftw3', default = False,
51            help_str = 'compile with fftw3 instead of ooura',
52            help_disable_str = 'do not compile with fftw3')
53    add_option_enable_disable(ctx, 'complex', default = False,
54            help_str ='compile with C99 complex',
55            help_disable_str = 'do not use C99 complex (default)' )
56    add_option_enable_disable(ctx, 'jack', default = None,
57            help_str = 'compile with jack (auto)',
58            help_disable_str = 'disable jack support')
59    add_option_enable_disable(ctx, 'sndfile', default = None,
60            help_str = 'compile with sndfile (auto)',
61            help_disable_str = 'disable sndfile')
62    add_option_enable_disable(ctx, 'avcodec', default = None,
63            help_str = 'compile with libavcodec (auto)',
64            help_disable_str = 'disable libavcodec')
65    add_option_enable_disable(ctx, 'samplerate', default = None,
66            help_str = 'compile with samplerate (auto)',
67            help_disable_str = 'disable samplerate')
68    add_option_enable_disable(ctx, 'memcpy', default = True,
69            help_str = 'use memcpy hacks (default)',
70            help_disable_str = 'do not use memcpy hacks')
71    add_option_enable_disable(ctx, 'double', default = False,
72            help_str = 'compile in double precision mode',
73            help_disable_str = 'compile in single precision mode (default)')
74    add_option_enable_disable(ctx, 'fat', default = False,
75            help_str = 'build fat binaries (darwin only)',
76            help_disable_str = 'do not build fat binaries (default)')
77    add_option_enable_disable(ctx, 'accelerate', default = None,
78            help_str = 'use Accelerate framework (darwin only) (auto)',
79            help_disable_str = 'do not use Accelerate framework')
80    add_option_enable_disable(ctx, 'apple-audio', default = None,
81            help_str = 'use CoreFoundation (darwin only) (auto)',
82            help_disable_str = 'do not use CoreFoundation framework')
83    add_option_enable_disable(ctx, 'atlas', default = False,
84            help_str = 'use Atlas library (no)',
85            help_disable_str = 'do not use Atlas library')
86    add_option_enable_disable(ctx, 'wavread', default = True,
87            help_str = 'compile with source_wavread (default)',
88            help_disable_str = 'do not compile source_wavread')
89    add_option_enable_disable(ctx, 'wavwrite', default = True,
90            help_str = 'compile with source_wavwrite (default)',
91            help_disable_str = 'do not compile source_wavwrite')
92
93    add_option_enable_disable(ctx, 'docs', default = None,
94            help_str = 'build documentation (auto)',
95            help_disable_str = 'do not build documentation')
96
97    ctx.add_option('--with-target-platform', type='string',
98            help='set target platform for cross-compilation', dest='target_platform')
99
100    ctx.load('compiler_c')
101    ctx.load('waf_unit_test')
102    ctx.load('gnu_dirs')
103
104def configure(ctx):
105    target_platform = sys.platform
106    if ctx.options.target_platform:
107        target_platform = ctx.options.target_platform
108   
109    from waflib import Options
110
111    if target_platform=='emscripten':
112        ctx.load('c_emscripten')
113    else:
114        ctx.load('compiler_c')
115
116    ctx.load('waf_unit_test')
117    ctx.load('gnu_dirs')
118   
119   
120   
121    # check for common headers
122    ctx.check(header_name='stdlib.h')
123    ctx.check(header_name='stdio.h')
124    ctx.check(header_name='math.h')
125    ctx.check(header_name='string.h')
126    ctx.check(header_name='limits.h')
127    ctx.check(header_name='stdarg.h')
128    ctx.check(header_name='getopt.h', mandatory = False)
129    ctx.check(header_name='unistd.h', mandatory = False)
130
131    ctx.env['DEST_OS'] = target_platform
132
133    if ctx.options.build_type == "debug":
134        ctx.define('DEBUG', 1)
135    else:
136        ctx.define('NDEBUG', 1)
137
138    if ctx.env.CC_NAME != 'msvc':
139        if ctx.options.build_type == "debug":
140            # no optimization in debug mode
141            ctx.env.prepend_value('CFLAGS', ['-O0'])
142        else:
143            if target_platform == 'emscripten':
144                # -Oz for small js file generation
145                ctx.env.prepend_value('CFLAGS', ['-Oz'])
146            else:
147                # default to -O2 in release mode
148                ctx.env.prepend_value('CFLAGS', ['-O2'])
149        # enable debug symbols and configure warnings
150        ctx.env.prepend_value('CFLAGS', ['-g', '-Wall', '-Wextra'])
151    else:
152        # enable debug symbols
153        ctx.env.CFLAGS += ['/Z7', '/FS']
154        ctx.env.LINKFLAGS += ['/DEBUG', '/INCREMENTAL:NO']
155        # configure warnings
156        ctx.env.CFLAGS += ['/W4', '/D_CRT_SECURE_NO_WARNINGS']
157        # set optimization level and runtime libs
158        if (ctx.options.build_type == "release"):
159            ctx.env.CFLAGS += ['/Ox']
160            ctx.env.CFLAGS += ['/MD']
161        else:
162            assert(ctx.options.build_type == "debug")
163            ctx.env.CFLAGS += ['/MDd']
164
165    ctx.check_cc(lib='m', uselib_store='M', mandatory=False)
166
167    if target_platform not in ['win32', 'win64']:
168        ctx.env.CFLAGS += ['-fPIC']
169    else:
170        ctx.define('HAVE_WIN_HACKS', 1)
171        ctx.env['cshlib_PATTERN'] = 'lib%s.dll'
172
173    if target_platform == 'darwin' and ctx.options.enable_fat:
174        ctx.env.CFLAGS += ['-arch', 'i386', '-arch', 'x86_64']
175        ctx.env.LINKFLAGS += ['-arch', 'i386', '-arch', 'x86_64']
176        MINSDKVER="10.4"
177        ctx.env.CFLAGS += [ '-mmacosx-version-min=' + MINSDKVER ]
178        ctx.env.LINKFLAGS += [ '-mmacosx-version-min=' + MINSDKVER ]
179
180    if target_platform in [ 'darwin', 'ios', 'iosimulator']:
181        if (ctx.options.enable_apple_audio != False):
182            ctx.env.FRAMEWORK += ['CoreFoundation', 'AudioToolbox']
183            ctx.define('HAVE_SOURCE_APPLE_AUDIO', 1)
184            ctx.define('HAVE_SINK_APPLE_AUDIO', 1)
185            ctx.msg('Checking for AudioToolbox.framework', 'yes')
186        else:
187            ctx.msg('Checking for AudioToolbox.framework', 'no (disabled)', color = 'YELLOW')
188        if (ctx.options.enable_accelerate != False):
189            ctx.define('HAVE_ACCELERATE', 1)
190            ctx.env.FRAMEWORK += ['Accelerate']
191            ctx.msg('Checking for Accelerate framework', 'yes')
192        else:
193            ctx.msg('Checking for Accelerate framework', 'no (disabled)', color = 'YELLOW')
194
195    if target_platform in [ 'ios', 'iosimulator' ]:
196        MINSDKVER="6.1"
197        ctx.env.CFLAGS += ['-std=c99']
198        if (ctx.options.enable_apple_audio != False):
199            ctx.define('HAVE_AUDIO_UNIT', 1)
200            #ctx.env.FRAMEWORK += ['CoreFoundation', 'AudioToolbox']
201        if target_platform == 'ios':
202            DEVROOT = "/Applications/Xcode.app/Contents"
203            DEVROOT += "/Developer/Platforms/iPhoneOS.platform/Developer"
204            SDKROOT = "%(DEVROOT)s/SDKs/iPhoneOS.sdk" % locals()
205            ctx.env.CFLAGS += [ '-fembed-bitcode' ]
206            ctx.env.CFLAGS += [ '-arch', 'arm64' ]
207            ctx.env.CFLAGS += [ '-arch', 'armv7' ]
208            ctx.env.CFLAGS += [ '-arch', 'armv7s' ]
209            ctx.env.LINKFLAGS += [ '-arch', 'arm64' ]
210            ctx.env.LINKFLAGS += ['-arch', 'armv7']
211            ctx.env.LINKFLAGS += ['-arch', 'armv7s']
212            ctx.env.CFLAGS += [ '-miphoneos-version-min=' + MINSDKVER ]
213            ctx.env.LINKFLAGS += [ '-miphoneos-version-min=' + MINSDKVER ]
214        else:
215            DEVROOT = "/Applications/Xcode.app/Contents"
216            DEVROOT += "/Developer/Platforms/iPhoneSimulator.platform/Developer"
217            SDKROOT = "%(DEVROOT)s/SDKs/iPhoneSimulator.sdk" % locals()
218            ctx.env.CFLAGS += [ '-arch', 'i386' ]
219            ctx.env.CFLAGS += [ '-arch', 'x86_64' ]
220            ctx.env.LINKFLAGS += ['-arch', 'i386']
221            ctx.env.LINKFLAGS += ['-arch', 'x86_64']
222            ctx.env.CFLAGS += [ '-mios-simulator-version-min=' + MINSDKVER ]
223            ctx.env.LINKFLAGS += [ '-mios-simulator-version-min=' + MINSDKVER ]
224        ctx.env.CFLAGS += [ '-isysroot' , SDKROOT]
225        ctx.env.LINKFLAGS += [ '-isysroot' , SDKROOT]
226
227    if target_platform == 'emscripten':
228        if ctx.options.build_type == "debug":
229            ctx.env.cshlib_PATTERN = '%s.js'
230            ctx.env.LINKFLAGS += ['-s','ASSERTIONS=2']
231            ctx.env.LINKFLAGS += ['-s','SAFE_HEAP=1']
232            ctx.env.LINKFLAGS += ['-s','ALIASING_FUNCTION_POINTERS=0']
233            ctx.env.LINKFLAGS += ['-O0']
234        else:
235            ctx.env.LINKFLAGS += ['-Oz']
236            ctx.env.cshlib_PATTERN = '%s.min.js'
237
238        # doesnt ship file system support in lib
239        ctx.env.LINKFLAGS_cshlib += ['-s', 'NO_FILESYSTEM=1']
240        # put memory file inside generated js files for easier portability
241        ctx.env.LINKFLAGS += ['--memory-init-file', '0']
242        ctx.env.cprogram_PATTERN = "%s.js"
243        ctx.env.cstlib_PATTERN = '%s.a'
244
245        # tell emscripten functions we want to expose
246        from python.lib.gen_external import get_c_declarations, get_cpp_objects_from_c_declarations, get_all_func_names_from_lib, generate_lib_from_c_declarations
247        c_decls = get_c_declarations(usedouble=False)  # emscripten can't use double
248        objects = get_cpp_objects_from_c_declarations(c_decls)
249        # ensure that aubio structs are exported
250        objects += ['fvec_t', 'cvec_t', 'fmat_t']
251        lib = generate_lib_from_c_declarations(objects, c_decls)
252        exported_funcnames = get_all_func_names_from_lib(lib)
253        c_mangled_names = ['_' + s for s in exported_funcnames]
254        ctx.env.LINKFLAGS_cshlib += ['-s', 'EXPORTED_FUNCTIONS=%s' % c_mangled_names]
255
256    if (ctx.options.enable_atlas != True):
257        ctx.options.enable_atlas = False
258
259    # check support for C99 __VA_ARGS__ macros
260    check_c99_varargs = '''
261#include <stdio.h>
262#define AUBIO_ERR(...) fprintf(stderr, __VA_ARGS__)
263'''
264
265    if ctx.check_cc(fragment = check_c99_varargs,
266            type='cstlib',
267            msg = 'Checking for C99 __VA_ARGS__ macro',
268            mandatory = False):
269        ctx.define('HAVE_C99_VARARGS_MACROS', 1)
270
271    # show a message about enable_double status
272    if (ctx.options.enable_double == True):
273        ctx.msg('Checking for size of smpl_t', 'double')
274        ctx.msg('Checking for size of lsmp_t', 'long double')
275    else:
276        ctx.msg('Checking for size of smpl_t', 'float')
277        ctx.msg('Checking for size of lsmp_t', 'double')
278
279    # optionally use complex.h
280    if (ctx.options.enable_complex == True):
281        ctx.check(header_name='complex.h')
282    else:
283        ctx.msg('Checking if complex.h is enabled', 'no')
284
285    # check for fftw3
286    if (ctx.options.enable_fftw3 != False or ctx.options.enable_fftw3f != False):
287        # one of fftwf or fftw3f
288        if (ctx.options.enable_fftw3f != False):
289            ctx.check_cfg(package = 'fftw3f',
290                    args = '--cflags --libs fftw3f >= 3.0.0',
291                    mandatory = ctx.options.enable_fftw3f)
292            if (ctx.options.enable_double == True):
293                ctx.msg('Warning',
294                        'fftw3f enabled, but compiling in double precision!')
295        else:
296            # fftw3f disabled, take most sensible one according to
297            # enable_double
298            if (ctx.options.enable_double == True):
299                ctx.check_cfg(package = 'fftw3',
300                        args = '--cflags --libs fftw3 >= 3.0.0.',
301                        mandatory = ctx.options.enable_fftw3)
302            else:
303                ctx.check_cfg(package = 'fftw3f',
304                        args = '--cflags --libs fftw3f >= 3.0.0',
305                        mandatory = ctx.options.enable_fftw3)
306        ctx.define('HAVE_FFTW3', 1)
307
308    # fftw not enabled, use vDSP or ooura
309    if 'HAVE_FFTW3F' in ctx.env.define_key:
310        ctx.msg('Checking for FFT implementation', 'fftw3f')
311    elif 'HAVE_FFTW3' in ctx.env.define_key:
312        ctx.msg('Checking for FFT implementation', 'fftw3')
313    elif 'HAVE_ACCELERATE' in ctx.env.define_key:
314        ctx.msg('Checking for FFT implementation', 'vDSP')
315    else:
316        ctx.msg('Checking for FFT implementation', 'ooura')
317
318    # check for libsndfile
319    if (ctx.options.enable_sndfile != False):
320        ctx.check_cfg(package = 'sndfile',
321                args = '--cflags --libs sndfile >= 1.0.4',
322                mandatory = ctx.options.enable_sndfile)
323
324    # check for libsamplerate
325    if (ctx.options.enable_double):
326        if (ctx.options.enable_samplerate):
327            ctx.fatal("Could not compile aubio in double precision mode with libsamplerate")
328        else:
329            ctx.options.enable_samplerate = False
330            ctx.msg('Checking if using samplerate', 'no (disabled in double precision mode)',
331                    color = 'YELLOW')
332    if (ctx.options.enable_samplerate != False):
333        ctx.check_cfg(package = 'samplerate',
334                args = '--cflags --libs samplerate >= 0.0.15',
335                mandatory = ctx.options.enable_samplerate)
336
337    # check for jack
338    if (ctx.options.enable_jack != False):
339        ctx.check_cfg(package = 'jack',
340                args = '--cflags --libs',
341                mandatory = ctx.options.enable_jack)
342
343    # check for libav
344    if (ctx.options.enable_avcodec != False):
345        ctx.check_cfg(package = 'libavcodec',
346                args = '--cflags --libs libavcodec >= 54.35.0',
347                uselib_store = 'AVCODEC',
348                mandatory = ctx.options.enable_avcodec)
349        ctx.check_cfg(package = 'libavformat',
350                args = '--cflags --libs libavformat >= 52.3.0',
351                uselib_store = 'AVFORMAT',
352                mandatory = ctx.options.enable_avcodec)
353        ctx.check_cfg(package = 'libavutil',
354                args = '--cflags --libs libavutil >= 52.3.0',
355                uselib_store = 'AVUTIL',
356                mandatory = ctx.options.enable_avcodec)
357        ctx.check_cfg(package = 'libswresample',
358                args = '--cflags --libs libswresample >= 1.2.0',
359                uselib_store = 'SWRESAMPLE',
360                mandatory = False)
361        if 'HAVE_SWRESAMPLE' not in ctx.env:
362            ctx.check_cfg(package = 'libavresample',
363                    args = '--cflags --libs libavresample >= 1.0.1',
364                    uselib_store = 'AVRESAMPLE',
365                    mandatory = False)
366
367        msg_check = 'Checking for all libav libraries'
368        if 'HAVE_AVCODEC' not in ctx.env:
369            ctx.msg(msg_check, 'not found (missing avcodec)', color = 'YELLOW')
370        elif 'HAVE_AVFORMAT' not in ctx.env:
371            ctx.msg(msg_check, 'not found (missing avformat)', color = 'YELLOW')
372        elif 'HAVE_AVUTIL' not in ctx.env:
373            ctx.msg(msg_check, 'not found (missing avutil)', color = 'YELLOW')
374        elif 'HAVE_SWRESAMPLE' not in ctx.env and 'HAVE_AVRESAMPLE' not in ctx.env:
375            resample_missing = 'not found (avresample or swresample required)'
376            ctx.msg(msg_check, resample_missing, color = 'YELLOW')
377        else:
378            ctx.msg(msg_check, 'yes')
379            if 'HAVE_SWRESAMPLE' in ctx.env:
380                ctx.define('HAVE_SWRESAMPLE', 1)
381            elif 'HAVE_AVRESAMPLE' in ctx.env:
382                ctx.define('HAVE_AVRESAMPLE', 1)
383            ctx.define('HAVE_LIBAV', 1)
384
385    if (ctx.options.enable_wavread != False):
386        ctx.define('HAVE_WAVREAD', 1)
387    ctx.msg('Checking if using source_wavread', ctx.options.enable_wavread and 'yes' or 'no')
388    if (ctx.options.enable_wavwrite!= False):
389        ctx.define('HAVE_WAVWRITE', 1)
390    ctx.msg('Checking if using sink_wavwrite', ctx.options.enable_wavwrite and 'yes' or 'no')
391
392    # use ATLAS
393    if (ctx.options.enable_atlas != False):
394        ctx.check(header_name = 'atlas/cblas.h', mandatory = ctx.options.enable_atlas)
395        #ctx.check(lib = 'lapack', uselib_store = 'LAPACK', mandatory = ctx.options.enable_atlas)
396        ctx.check(lib = 'cblas', uselib_store = 'BLAS', mandatory = ctx.options.enable_atlas)
397
398    # use memcpy hacks
399    if (ctx.options.enable_memcpy == True):
400        ctx.define('HAVE_MEMCPY_HACKS', 1)
401
402    # write configuration header
403    ctx.write_config_header('src/config.h')
404
405    # the following defines will be passed as arguments to the compiler
406    # instead of being written to src/config.h
407    ctx.define('HAVE_CONFIG_H', 1)
408
409    # add some defines used in examples
410    ctx.define('AUBIO_PREFIX', ctx.env['PREFIX'])
411    ctx.define('PACKAGE', APPNAME)
412
413    # double precision mode
414    if (ctx.options.enable_double == True):
415        ctx.define('HAVE_AUBIO_DOUBLE', 1)
416
417    if (ctx.options.enable_docs != False):
418        # check if txt2man is installed, optional
419        try:
420          ctx.find_program('txt2man', var='TXT2MAN')
421        except ctx.errors.ConfigurationError:
422          ctx.to_log('txt2man was not found (ignoring)')
423
424        # check if doxygen is installed, optional
425        try:
426          ctx.find_program('doxygen', var='DOXYGEN')
427        except ctx.errors.ConfigurationError:
428          ctx.to_log('doxygen was not found (ignoring)')
429
430        # check if sphinx-build is installed, optional
431        try:
432          ctx.find_program('sphinx-build', var='SPHINX')
433        except ctx.errors.ConfigurationError:
434          ctx.to_log('sphinx-build was not found (ignoring)')
435
436def build(bld):
437    bld.env['VERSION'] = VERSION
438    bld.env['LIB_VERSION'] = LIB_VERSION
439
440    # main source
441    bld.recurse('src')
442   
443    # add sub directories
444    if bld.env['DEST_OS'] not in ['ios', 'iosimulator', 'android']:
445        if bld.env['DEST_OS']=='emscripten' and not bld.options.testcmd:
446            bld.options.testcmd = 'node %s'
447        bld.recurse('examples')
448        bld.recurse('tests')
449
450    # pkg-config template
451    bld( source = 'aubio.pc.in' )
452
453    # documentation
454    txt2man(bld)
455    doxygen(bld)
456    sphinx(bld)
457
458def txt2man(bld):
459    # build manpages from txt files using txt2man
460    if bld.env['TXT2MAN']:
461        from waflib import TaskGen
462        if 'MANDIR' not in bld.env:
463            bld.env['MANDIR'] = bld.env['DATAROOTDIR'] + '/man'
464        bld.env.VERSION = VERSION
465        rule_str = '${TXT2MAN} -t `basename ${TGT} | cut -f 1 -d . | tr a-z A-Z`'
466        rule_str += ' -r ${PACKAGE}\\ ${VERSION} -P ${PACKAGE}'
467        rule_str += ' -v ${PACKAGE}\\ User\\\'s\\ manual'
468        rule_str += ' -s 1 ${SRC} > ${TGT}'
469        TaskGen.declare_chain(
470                name      = 'txt2man',
471                rule      = rule_str,
472                ext_in    = '.txt',
473                ext_out   = '.1',
474                reentrant = False,
475                install_path =  '${MANDIR}/man1',
476                )
477        bld( source = bld.path.ant_glob('doc/*.txt') )
478
479def doxygen(bld):
480    # build documentation from source files using doxygen
481    if bld.env['DOXYGEN']:
482        bld.env.VERSION = VERSION
483        rule = '( cat ${SRC} && echo PROJECT_NUMBER=${VERSION}; )'
484        rule += ' | doxygen - > /dev/null'
485        bld( name = 'doxygen', rule = rule,
486                source = 'doc/web.cfg',
487                target = '../doc/web/html/index.html',
488                cwd = 'doc')
489        bld.install_files( '${DATAROOTDIR}' + '/doc/libaubio-doc',
490                bld.path.ant_glob('doc/web/html/**'),
491                cwd = bld.path.find_dir ('doc/web'),
492                relative_trick = True)
493
494def sphinx(bld):
495    # build documentation from source files using sphinx-build
496    # note: build in ../doc/_build/html, otherwise waf wont install unsigned files
497    if bld.env['SPHINX']:
498        bld.env.VERSION = VERSION
499        bld( name = 'sphinx',
500                rule = '${SPHINX} -b html -D release=${VERSION} -D version=${VERSION} -a -q `dirname ${SRC}` `dirname ${TGT}`',
501                source = 'doc/conf.py',
502                target = '../doc/_build/html/index.html')
503        bld.install_files( '${DATAROOTDIR}' + '/doc/libaubio-doc/sphinx',
504                bld.path.ant_glob('doc/_build/html/**'),
505                cwd = bld.path.find_dir('doc/_build/html'),
506                relative_trick = True)
507
508# register the previous rules as build rules
509from waflib.Build import BuildContext
510
511class build_txt2man(BuildContext):
512    cmd = 'txt2man'
513    fun = 'txt2man'
514
515class build_manpages(BuildContext):
516    cmd = 'manpages'
517    fun = 'txt2man'
518
519class build_sphinx(BuildContext):
520    cmd = 'sphinx'
521    fun = 'sphinx'
522
523class build_doxygen(BuildContext):
524    cmd = 'doxygen'
525    fun = 'doxygen'
526
527def shutdown(bld):
528    from waflib import Logs
529    if bld.options.target_platform in ['ios', 'iosimulator']:
530        msg ='building for %s, contact the author for a commercial license' % bld.options.target_platform
531        Logs.pprint('RED', msg)
532        msg ='   Paul Brossier <piem@aubio.org>'
533        Logs.pprint('RED', msg)
534
535def dist(ctx):
536    ctx.excl  = ' **/.waf* **/*~ **/*.pyc **/*.swp **/*.swo **/*.swn **/.lock-w* **/.git*'
537    ctx.excl += ' **/build/*'
538    ctx.excl += ' doc/_build'
539    ctx.excl += ' python/demos_*'
540    ctx.excl += ' **/python/gen **/python/build **/python/dist'
541    ctx.excl += ' **/python/ext/config.h'
542    ctx.excl += ' **/python/lib/aubio/_aubio.so'
543    ctx.excl += ' **.egg-info'
544    ctx.excl += ' **/**.zip **/**.tar.bz2'
545    ctx.excl += ' **.tar.bz2'
546    ctx.excl += ' **/doc/full/* **/doc/web/*'
547    ctx.excl += ' **/doc/full.cfg'
548    ctx.excl += ' **/python/*.db'
549    ctx.excl += ' **/python.old/*'
550    ctx.excl += ' **/python/*/*.old'
551    ctx.excl += ' **/python/tests/sounds'
552    ctx.excl += ' **/**.asc'
553    ctx.excl += ' **/dist*'
554    ctx.excl += ' **/.DS_Store'
555    ctx.excl += ' **/.travis.yml'
556    ctx.excl += ' **/.landscape.yml'
557    ctx.excl += ' **/.appveyor.yml'
Note: See TracBrowser for help on using the repository browser.