From fb28f6800864176be2ffca29e8e664b641f33170 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 21 Dec 2009 18:04:02 +0000 Subject: m3 is copied into trunk, we should be good to go, now. --- docs/build.1 | 5 +++ docs/build.7 | 84 +++++++++++++++++++++++++++++++++++++++++++ docs/buildm3notes.txt | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 188 insertions(+) create mode 100644 docs/build.1 create mode 100644 docs/build.7 create mode 100644 docs/buildm3notes.txt (limited to 'docs') diff --git a/docs/build.1 b/docs/build.1 new file mode 100644 index 0000000..118c744 --- /dev/null +++ b/docs/build.1 @@ -0,0 +1,5 @@ +.TH build 1 "October 30, 2009" "Xagasoft" "Geekgene" +Build is awesome, try it out +.P +This is a new paragraph +.SH SYNOPSIS diff --git a/docs/build.7 b/docs/build.7 new file mode 100644 index 0000000..5d6ab34 --- /dev/null +++ b/docs/build.7 @@ -0,0 +1,84 @@ +.TH build 1 "October 30, 2009" "Xagasoft" "Geekgene" +.SH NAME +.P +build.conf configuration files. +.SH SYNOPSIS +.P +These files describe how to build something, generally software from source +code, but it can really be anything. +.SH DESCRIPTION +.P +For now, I'm just going to list some things here, here are the functions +available to you for general use at the moment: +.TP +.B +dirs() +Takes any number of string parameters, matches the file system based on glob +patterns and returns all directories that match the given patterns. +.TP +.B +files() +Takes any number of string parameters, matches the file system based on glob +patterns and returns all files that match the given patterns. +.TP +.B +execute() +Takes one string parameter, and executes it as a command using your shell. +.TP +.B +exists() +Checks to see if the given file/directory/etc exists on the file system, if it +does, true is returned, otherwise, false. +.TP +.B +matches() +Checks the input of the function to see if it matches a given wildcard pattern, +the pattern may include any number of * (meaning match any number of any +character) or ? (meaning match one of any character) symbols. If the input is +a string, then true or false is returned. If the input is a list, a filtered +version of the list is returned, containing only the elements that matched the +pattern. +.TP +.B +replace() +Takes two string parameters and replaces all occurances of the first with the +second in the input string or list of strings. +.TP +.B +targets() +Returns a list of target outputs, this will return every output for any target +that it finds seperately, so targets with multiple outputs will be in the list +more than once. With no parametrs it returns a list of all explicitly defined +targets, with a string parameter it returns all targets that have the given +tag. +.TP +.B +toString() +Takes the input and converts it to a string, with no parameters it uses default +formatting, this means that for lists it puts a space between each element. +.TP +.B +unlink() +Unlinks (deletes) the given file or files from the filesystem. It can take any +number of string or string list parameters. +.TP +.B +getMakeDeps() +Returns a list of files ready for use in a requires statement from the stdout of the command provided in the only string parameter. The command should output the dependancies in makefile format. +.TP +.B +fileName() +Returns the file portion of the string provided as input. That is, it returns everything after the last '/' character. This may not always be a file, it could be a directory, or even just an arbitrary part of a string that may or may not have '/' in it. If the input ends with a slash this will return an empty string. +.TP +.B +dirName() +Returns the directory portion of the string provided as input. That is, it returns everything before the last '/' character. Read the caveat for fileName about what this really means. If the input ends with a slash this will return the entire string, except the trailing slash. +.P +Here, lets list functions we wish we had... +.SH ENVIRONMENT +.SH FILES +.SH CONFORMING TO +.SH NOTES +.SH BUGS +.SH EXAMPLE +.SH SEE ALSO diff --git a/docs/buildm3notes.txt b/docs/buildm3notes.txt new file mode 100644 index 0000000..72e68e4 --- /dev/null +++ b/docs/buildm3notes.txt @@ -0,0 +1,99 @@ +Rules +Targets + Profiles + Build + Clean + Install + Package + etc. + Dependancies + Force Ruleset / mode + Input + Produces / Output +Actions (functions) + Execute + Delete + Download + GetDependencies + ExecuteTest + RunTarget + +Mode Variables - switch modes for a variety of things (debug/release, platforms) + +Includes (including default includes) + +Bash style variable replacements / execute / etc. + +Functions? + files() returns list (globbing) + querySystemParam() + +if blocks can be anywhere. + +semi-typed variables, default to string + +variables in a target: INPUT, OUTPUT (by default instead of target and match) + +---- ast processing order ---- +1) import all environment variables +2) import all cached data +3) set all variables specified on the command line +4) root level "script" +4.1) execute root level items, for target, rule, and non-auto, non-global config + this means building the target, rule, and config tables. + for global config and auto-config, run them as we hit them. +5) execute specified target(s) with specified profile + +---- pseudo code ----- + +set CXXFLAGS += "param"; // ensure there are spaces so it works for a command +set CXXFLAGS << "param"; // append like you'd expect, no extra changes + +unset PREFIX; // may be handy to be able to unset things + +include "otherbuild.h"; // oh yeah includes + +notice "something good?"; // display a notice to the user, just info... +warning "yeah yeah yeah..."; // display a warning message, but don't exit +error "something or other"; // exit immediately with an error message + +target "libbu++.a" +{ + input files("src/*.cpp"); + set CXXFLAGS="-ggdb"; + condition file; + requires []; + + hidden; // Hides this from the user, but still callable +} + +target ["file a", files("src/*.cpp), files("src/*y")].replace("bob", "sam")... +{ + condition always; +} + +auto config "X" +{ +} + +config "EXTRA_DEBUG" +{ + display "Debugging/Extra debugging"; + type int; (or string, or bool, or list, or version) + default 0; + allow ["0-5","6"]; + +} + +rule "cpp" +{ + input glob("*.cpp"); // or just a string, pretend it's a glob + output "${INPUT}".replace(".cpp",".o"); + requires getDeps("g++ ${CXXFLAGS} -M ${OUTPUT} ${INPUT}", "make"); + profile "build" + { + fnc1() tag "c++"; + fnc2(); + } +} + -- cgit v1.2.3