summaryrefslogtreecommitdiff
path: root/docs/source/buildreference.rst
blob: 704c8120ceec01b36636977cd39a133bbebf7fc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
===============
Build Reference
===============

Xnt has several "build" modules to aid you in your compliation and project/
sub-project build steps

Overview
========

* `Make`_

* `Compiler Collection`_

Make
====

Apache Ant
----------

.. _xnt.build.make.ant:
.. function:: ant(path="", target="")

    Invoke Apache Ant in either the current working directory or the specified
    directory using the empty (default) target or the specified target.

Gnu Make
--------

.. _xnt.bulid.make.make:
.. function:: make(path="", target="")

    Invoke Gnu Make (*make*) in either the current working directory or the
    specified directory using the empty (default) target or the specified
    target.

(.NET)Ant
---------

.. _xnt.build.make.nant:
.. function:: nant(path="", target="")

    Invoke NAnt in either the current working directory or the specified
    directory using the empty (default) target or the specified target.

Compiler Collection
===================

For all compilers so far, Xnt assumes they are installed and in your `$PATH`.
If they are not, an error will be thrown (by subprocess)

gcc/g++
-------

.. _xnt.build.cc.gcc:
.. function:: gcc(src, flags=[])

    Compile `src` with the `gcc` to the default `out` (:ref:`defaultOut`) of
    that source. Passing `flags` as given.

.. _xnt.build.cc.gcc_o:
.. function:: gcc_o(src, o, flags=[])

    Compile `src` with `gcc` to the out file specified by `o`. Passing `flags`
    as given.

.. _xnt.build.cc.gpp:
.. function:: gpp(src, flags=[])

    Compile `src` with `g++` to the default `out` (:ref:`defaultOut`) of that
    source. Passing `flags` as given.

.. _xnt.bulid.cc.gpp_o:
.. function:: gpp_o(src, o, flags=[])

    Compile `src` with `g++` to the out file specified by `o`. Passing `flags`
    as given.

Javac
-----

.. _xnt.build.cc.javac:
.. function:: javac(src, flags=[])

    Compile `src` with `javac` to the default out file for the source. Passing
    `flags` as given.

Notes
-----

.. _defaultOut:

Default out
~~~~~~~~~~~

Most, if not all, compilers have a default name given to compiled binaries when
no output file name is given. For example, `gcc` will give code with a `main`
method a name of `a.out` or `%.o` for objects, and so on. `javac` defaults to
`<class-name>.class`.

.. _recompile:

Recompile
~~~~~~~~~

At the current moment, all compile wrappers do not do "smart" checks for
compilation. That is, *all* compile steps will `rebuild` regardless if the
binary file is modified later than the source file. This would be a nice
feature, but I fear it would be too expensive (complicated) and out of the
scope of this project to implement correctly.