SConstruct 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # -*- coding: utf-8; mode: Python -*-
  2. # SConstruct for ra/docs
  3. # (c) Daniel Llorens - 2016, 2019
  4. # This library is free software; you can redistribute it and/or modify it under
  5. # the terms of the GNU Lesser General Public License as published by the Free
  6. # Software Foundation; either version 3 of the License, or (at your option) any
  7. # later version.
  8. # TODO Shared pieces with {examples,test,bench}/SConstruct
  9. import os, string, atexit
  10. from os.path import join, abspath
  11. import imp
  12. ra = imp.load_source('ra', '../config/ra.py')
  13. try:
  14. Import('top')
  15. except:
  16. top = {}
  17. vars = Variables()
  18. vars.AddVariables(PathVariable('variant_dir', 'build directory', '.', PathVariable.PathIsDirCreate))
  19. env = Environment(options=vars,
  20. BUILDERS={'INFOBuilder' : Builder(action = '$MAKEINFO < $SOURCES > $TARGET',
  21. suffix = '.info',
  22. src_suffix = '.texi'),
  23. 'HTMLBuilder' : Builder(action = '$MAKEINFO --html --no-split -o $TARGET < $SOURCES',
  24. suffix = '.html',
  25. src_suffix = '.texi')})
  26. variant_dir = env['variant_dir']
  27. for var, default in [('MAKEINFO', 'makeinfo')]:
  28. ra.take_from_environ(env, var, default=default)
  29. if 'skip_summary' not in top:
  30. atexit.register(lambda: ra.print_summary(GetBuildFailures, 'ra/docs'))
  31. env.INFOBuilder(target = 'ra-ra.info', source = 'ra-ra.texi')
  32. env.HTMLBuilder(target = 'index.html', source = 'ra-ra.texi')