Age | Commit message (Collapse) | Author | Files | Lines |
|
Now we can use directive names as variables and targets type, for
example:
print = foo # variable
print{foo}: # target
|
|
if
if!
elif
elif!
else
The expression should evaluate to true of false. The if! and elif!
versions are provided as shortcuts to writing if (!...).
See tests/if-else for examples.
|
|
For example:
define cli=file
Currently, the semantics is that of a real alias with only name differences
that are used for display. See tests/define/buildfile for more use cases.
|
|
For example:
cxx{*-options}: dist = true
1. Only single '*' wildcard is supported, matches 0 or more characters.
2. If target type is not specified, it defaults to any target.
3. Appending (+=) is not allowed.
4. The value is expanded immediately in the context of the scope.
5. The more specific pattern (i.e., with the shortest "stem") is preferred.
If the stem has the same length, then the last defined (but not redefined)
pattern is used. This will probably have to change to become an error.
See tests/variable/type-pattern for more examples.
|
|
See tests/names for more examples.
|
|
|
|
For now it acts as just the value mode that can be enabled anywhere
variable expansion is supported, for example:
(foo=bar):
And the primary use currently is to enable/test quoted and indirect
variable expansion:
"foo bar" = FOO BAR
print $"foo bar" # Invalid.
print $("foo bar") # Yeah, baby.
foo = FOO
FOO = foo
print $($foo)
Not that you should do something like this...
|
|
|
|
Now the src directory is entered into the scope map and points to
the same scope as out. This means that targets that are in src,
not out (e.g., source files) will "see" rules, variables, etc.
This becomes important when we try, for example, to install a
source file (say, a header) from src: we need the rule as well
as the install.* variables.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
For now both need to be manually specified in src bootstrap. At
this stage main() loads any outer root scopes while include loads
any inner.
|
|
|
|
|
|
|
|
This is the initial groundwork for the configuration support.
|
|
The idea is that a buildfile shall be included/loaded only once for any
given out_root.
|
|
|
|
We will need it for the buildspec and also if/when we support map
variable types.
|
|
|
|
The logic is as follows: if we have an explicit current directory
target, then that's the default target. Otherwise, we take the
first target and use it as a prerequisite to create an implicit
current directory target, effectively making it the default
target via an alias. If there are no targets in this buildfile,
then we don't do anything.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
For example:
cxx{driver ../{foo bar}}
cxx{driver} ../cxx{foo bar}
|
|
Also a new iteration on the overall architecture. Now, for the first time,
build can read the buildfile and build itself.
g++-4.9 -std=c++14 -g -I.. -o bd bd.cxx algorithm.cxx scope.cxx parser.cxx lexer.cxx target.cxx prerequisite.cxx rule.cxx native.cxx cxx/target.cxx cxx/rule.cxx process.cxx timestamp.cxx path.cxx
g++-4.9 -std=c++14 -g -I../../.. -o driver driver.cxx ../../../build/lexer.cxx
g++-4.9 -std=c++14 -g -I../../.. -o driver driver.cxx ../../../build/lexer.cxx ../../../build/parser.cxx ../../../build/scope.cxx ../../../build/target.cxx ../../../build/native.cxx ../../../build/prerequisite.cxx ../../../build/path.cxx ../../../build/timestamp.cxx
|
|
|
|
g++-4.9 -std=c++14 -g -I../../.. -o driver driver.cxx ../../../build/lexer.cxx ../../../build/parser.cxx && ./driver
|