============ Build System ============ If you want to use Python with other programming languages, a build system is usually needed. A build system is used to `automate the processes of compiling, linking, packaging, and deploying software `__. This chapter will focus on a tool called `SCons `_, which is implement with pure Python. Building scripts of SCons can be highly modularized and reused, and cross-platform as well. Using a build system involves writing building scripts. Building scripts of SCons can have three parts: - Front-end script (``SConstruct``), - Rule script (``Sconscript``), and - Tools (``site_scons/site_tools/*``). Below is the ``SConstruct`` and the ``SConscript`` files of an example project. The ``SConstruct`` file is: .. literalinclude:: ../../examples/inter_build/SConstruct :language: python The ``SConscript`` file is: .. literalinclude:: ../../examples/inter_build/SConscript :language: python SCons tools provide a means to reuse the building code. For example, we can use the `SCons tools provided by the Cython team `__ to build your cython code, by copying the files ``cython.py`` and ``pyext.py`` into the directory ``site_scons/site_tools`` inside your project. .. vim: set spell ft=rst ff=unix fenc=utf8 ai et sw=4 ts=4 tw=79