From 113fc467a7170a8a564049c64d1036dd10e6abac Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sun, 30 Jul 2006 09:07:20 +0000 Subject: 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. --- congo | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 72 insertions(+), 5 deletions(-) (limited to 'congo') diff --git a/congo b/congo index ddf7e7b..3031f4e 100644 --- a/congo +++ b/congo @@ -1,16 +1,83 @@ +# +# Simple build.conf test file +# +# you can have as many actions as you'd like, the one that's run by default is +# called "default action", you need a default action. +# +# Actions are filled with a comma-seperated list of commands, like "check xxx" +# to check to see if a target needs to be rebuilt +# +default action: check congo, check congod -default action: create congo, congod +# +# This action will only build the server program +# +server action: check congod -create file congod from files in src/congod using rule exe -create file congo from files in src/congo using rule exe +# +# After that, it helps to define some targets, things that commands usually +# refer to and interact with. +# +# +# "create file" will do just what it says, create a file based on some +# information and a rule. +# +# "from files in" tells us that a list of directories follows, and the input +# list for the rule should be built from these files. +# +# "using rule" tells us which rule to use to actuall create the file +# +create file congod from files in src/congod, src/shared using rule exe +create file congo from files in src/congo, src/shared using rule exe + +# +# After all of that, some targets or list items may have their own additional +# dependancies, depending on the rule that built them. You can define these +# extra dependancies using "xxx requires yyy" which will force the system to +# attempt to create yyy before xxx. +# congod requires libcongo.a congo requires libcongo.a +# +# There are a number of variables that the rules can use, including any in the +# environment. Sometimes you want to modify these, to do that you can use "set" +# and the name of the variable, along with what to do to it. +# +# You can use '=' to set the value, destroying what was there, or '+=' to add +# the new text to the variable, this will assume that the text you provide is +# made up of space-delimited tokens, and will ensure spaces surround them when +# they are added. +# set CXXFLAGS += "-Ilibbu++/src" set LDFLAGS += "-Llibbu++ -lbu++" +# +# Sometimes individual targets or list items require special settings, this is +# easy since build maintians a seperate set of variables for any items that need +# special support. +# +# Currently you can only set, for an item, later you may be able to do more. +# for congo set LDFLAGS += "-lreadline" -rule exe matches all /(.*)\.o/ perform command "g++ {matches} {LDFLAGS} -o {target}" -rule cpp matches one /(.*)\.cpp/ produces {1}.o perform command "g++ {CXXFLAGS} -o {target} {match}" +# +# Finally, no file is complete without some rules. Rules determine how to +# fulfill target checking based on some input data. Generally this is going to +# be creating an executable from a list of source files. +# +# +# First specify the rule name, then you can filter the input list, if desired, +# in two ways. You can use items that match a regular expression, and execute +# the rule once for the whole list collectively, or once for each element that +# made it through the filter. +# +# Within the perform, there are several things that could go there, for now, +# just command, which takes a string, you can use {} for variable substitution. +# +rule exe matches all /(.*)\.o/ perform command ... + "g++ {matches} {LDFLAGS} -o {target}" + +rule cpp matches one /(.*)\.cpp/ produces {1}.o perform command ... + "g++ {CXXFLAGS} -o {target} {match}" -- cgit v1.2.3