diff options
author | Mike Buland <eichlan@xagasoft.com> | 2012-11-08 20:38:56 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2012-11-08 20:38:56 +0000 |
commit | c5d1304f04273b579e00f967ec564a8de3ea0e69 (patch) | |
tree | be6bacefb60a64aef0017f94cd4913d89c6032fe /README.md | |
parent | 21cf5c846c1d004da98b4c93715ca44036f7ecd5 (diff) | |
download | build-c5d1304f04273b579e00f967ec564a8de3ea0e69.tar.gz build-c5d1304f04273b579e00f967ec564a8de3ea0e69.tar.bz2 build-c5d1304f04273b579e00f967ec564a8de3ea0e69.tar.xz build-c5d1304f04273b579e00f967ec564a8de3ea0e69.zip |
Packaging updates, started on the manual, too.
Diffstat (limited to '')
-rw-r--r-- | README.md | 92 |
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 | |||
3 | Xagasoft Build is a comprehensive build tool for nearly any multi-step | ||
4 | automation process, but is intended primarily for compiling source code. | ||
5 | |||
6 | Features: | ||
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 | |||
18 | There are different requirements depending on how you got your source code and | ||
19 | what you intend to do with it. If you just want to use build, then I recommend | ||
20 | getting one of the release tarballs. They include most of the dependancies and | ||
21 | are the easiest to use. | ||
22 | |||
23 | ### Tarball Releases | ||
24 | |||
25 | To 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 | |||
33 | If you're getting the code from source control or want to do more there are | ||
34 | these additional requirements: | ||
35 | |||
36 | * flex | ||
37 | * bison | ||
38 | |||
39 | The flex and bison source code are pre-processed into C source code for the | ||
40 | tarballs, so you do not need these programs in order to compile. | ||
41 | |||
42 | Build also relies on libbu++, but the shell script 'build.sh' will check out | ||
43 | the files it needs from libbu++ SVN. These files are also included in the | ||
44 | tarball release. | ||
45 | |||
46 | Build also builds the easiest when using build. Once you have a working | ||
47 | version of build it's very easy to keep working on build. | ||
48 | |||
49 | # Example Build Scripts | ||
50 | |||
51 | Just 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 | |||
61 | Build has sensible defaults for many things, this creates an explicit target | ||
62 | named filescan that relies on the source code in the directory src. It adds | ||
63 | debugging flags, and it links libbu++. | ||
64 | |||
65 | The build system uses a variation on a standard boolean transitive closure | ||
66 | algorithm 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 | ||
68 | targets 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 | |||
88 | This example is slightly more complex. It sets some flags that all targets will | ||
89 | use, then creates two explicit targets. The second target, joved, also | ||
90 | requires that libjove.a is up to date, but it is not treated as an input. This | ||
91 | is enough to determine order of building, all source files, targets, and even | ||
92 | provides full dependancy tracking. | ||