diff options
author | Mike Buland <eichlan@xagasoft.com> | 2006-07-30 09:07:20 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2006-07-30 09:07:20 +0000 |
commit | 113fc467a7170a8a564049c64d1036dd10e6abac (patch) | |
tree | e4719817a3e0175a9f7cbd4e07fc994ff41f8ef6 /congo | |
parent | 900976d2d74e0de57858b265c2ef0d17a29e921a (diff) | |
download | build-113fc467a7170a8a564049c64d1036dd10e6abac.tar.gz build-113fc467a7170a8a564049c64d1036dd10e6abac.tar.bz2 build-113fc467a7170a8a564049c64d1036dd10e6abac.tar.xz build-113fc467a7170a8a564049c64d1036dd10e6abac.zip |
It's starting to look pretty good, just trying to figure out how to get through
everything that needs to be made modular and general.
Diffstat (limited to 'congo')
-rw-r--r-- | congo | 77 |
1 files changed, 72 insertions, 5 deletions
@@ -1,16 +1,83 @@ | |||
1 | # | ||
2 | # Simple build.conf test file | ||
3 | # | ||
4 | # you can have as many actions as you'd like, the one that's run by default is | ||
5 | # called "default action", you need a default action. | ||
6 | # | ||
7 | # Actions are filled with a comma-seperated list of commands, like "check xxx" | ||
8 | # to check to see if a target needs to be rebuilt | ||
9 | # | ||
10 | default action: check congo, check congod | ||
1 | 11 | ||
2 | default action: create congo, congod | 12 | # |
13 | # This action will only build the server program | ||
14 | # | ||
15 | server action: check congod | ||
3 | 16 | ||
4 | create file congod from files in src/congod using rule exe | 17 | # |
5 | create file congo from files in src/congo using rule exe | 18 | # After that, it helps to define some targets, things that commands usually |
19 | # refer to and interact with. | ||
20 | # | ||
6 | 21 | ||
22 | # | ||
23 | # "create file" will do just what it says, create a file based on some | ||
24 | # information and a rule. | ||
25 | # | ||
26 | # "from files in" tells us that a list of directories follows, and the input | ||
27 | # list for the rule should be built from these files. | ||
28 | # | ||
29 | # "using rule" tells us which rule to use to actuall create the file | ||
30 | # | ||
31 | create file congod from files in src/congod, src/shared using rule exe | ||
32 | create file congo from files in src/congo, src/shared using rule exe | ||
33 | |||
34 | # | ||
35 | # After all of that, some targets or list items may have their own additional | ||
36 | # dependancies, depending on the rule that built them. You can define these | ||
37 | # extra dependancies using "xxx requires yyy" which will force the system to | ||
38 | # attempt to create yyy before xxx. | ||
39 | # | ||
7 | congod requires libcongo.a | 40 | congod requires libcongo.a |
8 | congo requires libcongo.a | 41 | congo requires libcongo.a |
9 | 42 | ||
43 | # | ||
44 | # There are a number of variables that the rules can use, including any in the | ||
45 | # environment. Sometimes you want to modify these, to do that you can use "set" | ||
46 | # and the name of the variable, along with what to do to it. | ||
47 | # | ||
48 | # You can use '=' to set the value, destroying what was there, or '+=' to add | ||
49 | # the new text to the variable, this will assume that the text you provide is | ||
50 | # made up of space-delimited tokens, and will ensure spaces surround them when | ||
51 | # they are added. | ||
52 | # | ||
10 | set CXXFLAGS += "-Ilibbu++/src" | 53 | set CXXFLAGS += "-Ilibbu++/src" |
11 | set LDFLAGS += "-Llibbu++ -lbu++" | 54 | set LDFLAGS += "-Llibbu++ -lbu++" |
12 | 55 | ||
56 | # | ||
57 | # Sometimes individual targets or list items require special settings, this is | ||
58 | # easy since build maintians a seperate set of variables for any items that need | ||
59 | # special support. | ||
60 | # | ||
61 | # Currently you can only set, for an item, later you may be able to do more. | ||
62 | # | ||
13 | for congo set LDFLAGS += "-lreadline" | 63 | for congo set LDFLAGS += "-lreadline" |
14 | 64 | ||
15 | rule exe matches all /(.*)\.o/ perform command "g++ {matches} {LDFLAGS} -o {target}" | 65 | # |
16 | rule cpp matches one /(.*)\.cpp/ produces {1}.o perform command "g++ {CXXFLAGS} -o {target} {match}" | 66 | # Finally, no file is complete without some rules. Rules determine how to |
67 | # fulfill target checking based on some input data. Generally this is going to | ||
68 | # be creating an executable from a list of source files. | ||
69 | # | ||
70 | # | ||
71 | # First specify the rule name, then you can filter the input list, if desired, | ||
72 | # in two ways. You can use items that match a regular expression, and execute | ||
73 | # the rule once for the whole list collectively, or once for each element that | ||
74 | # made it through the filter. | ||
75 | # | ||
76 | # Within the perform, there are several things that could go there, for now, | ||
77 | # just command, which takes a string, you can use {} for variable substitution. | ||
78 | # | ||
79 | rule exe matches all /(.*)\.o/ perform command ... | ||
80 | "g++ {matches} {LDFLAGS} -o {target}" | ||
81 | |||
82 | rule cpp matches one /(.*)\.cpp/ produces {1}.o perform command ... | ||
83 | "g++ {CXXFLAGS} -o {target} {match}" | ||