aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--README.md92
1 files changed, 92 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..3b055fb
--- /dev/null
+++ b/README.md
@@ -0,0 +1,92 @@
1# Build
2
3Xagasoft Build is a comprehensive build tool for nearly any multi-step
4automation process, but is intended primarily for compiling source code.
5
6Features:
7
8 * Does _NOT_ rely on make of any sort.
9 * Can auto-generate targets based on builtin and user proided rules.
10 * Contains it's own turing complete scripting language.
11 * Provides a variety of output modes to make errors easier to see.
12 * Supports plugins.
13 * Write much, much less and do more.
14 * Builtin understanding of dependancy tracking.
15
16## Requirements
17
18There are different requirements depending on how you got your source code and
19what you intend to do with it. If you just want to use build, then I recommend
20getting one of the release tarballs. They include most of the dependancies and
21are the easiest to use.
22
23### Tarball Releases
24
25To compile a tarball release you need:
26
27 * bash (or similar)
28 * C++ compiler (gcc is the primary development target)
29 * libc with pthreads and libdl support (glibc and most compatibles)
30
31### SCM Checkouts
32
33If you're getting the code from source control or want to do more there are
34these additional requirements:
35
36 * flex
37 * bison
38
39The flex and bison source code are pre-processed into C source code for the
40tarballs, so you do not need these programs in order to compile.
41
42Build also relies on libbu++, but the shell script 'build.sh' will check out
43the files it needs from libbu++ SVN. These files are also included in the
44tarball release.
45
46Build also builds the easiest when using build. Once you have a working
47version of build it's very easy to keep working on build.
48
49# Example Build Scripts
50
51Just to give you a taste, here are some real, simple build scripts.
52
53 target "filescan"
54 {
55 rule "exe";
56 input files("src/*.cpp");
57 CXXFLAGS += "-ggdb";
58 LDFLAGS += "-lbu++";
59 }
60
61Build has sensible defaults for many things, this creates an explicit target
62named filescan that relies on the source code in the directory src. It adds
63debugging flags, and it links libbu++.
64
65The build system uses a variation on a standard boolean transitive closure
66algorithm to provide "path-finding" between the .cpp files and the inputs the
67"exe" rule needs to create output. In this case it will automatically create
68targets needed to produce all of the object code.
69
70 CXXFLAGS += "-ggdb -I. -Ilibgats";
71 LDFLAGS += "-ggdb";
72
73 target "libjove.a"
74 {
75 rule "lib";
76 input files("src/libjove/*.cpp");
77 }
78
79 target "joved"
80 {
81 rule "exe";
82 input files("src/joved/*.cpp");
83 requires "libjove.a";
84
85 LDFLAGS += "-L. -ljove -lbu++ -Llibgats -lgats -lcryptopp -lpthread";
86 }
87
88This example is slightly more complex. It sets some flags that all targets will
89use, then creates two explicit targets. The second target, joved, also
90requires that libjove.a is up to date, but it is not treated as an input. This
91is enough to determine order of building, all source files, targets, and even
92provides full dependancy tracking.