1 # Copyright (c) 2011 WorkWare Systems http://www.workware.net.au/
6 # The 'tmake' module makes it easy to support the tmake build system.
8 # The following variables are set:
10 ## CONFIGURED - to indicate that the project is configured
18 # @make-tmake-settings outfile patterns ...
20 # Examines all defined variables which match the given patterns (defaults to '*')
21 # and writes a tmake-compatible .conf file defining those variables.
22 # For example, if 'ABC' is '"3 monkeys"' and 'ABC' matches a pattern, then the file will include:
24 ## define ABC {3 monkeys}
26 # If the file would be unchanged, it is not written.
30 ## make-tmake-settings [get-env BUILDDIR objdir]/settings.conf {[A-Z]*}
31 proc make-tmake-settings
{file args
} {
32 file mkdir
[file dirname
$file]
35 if {[llength $args] == 0} {
39 foreach n
[lsort [dict keys
[all-defines
]]] {
41 if {[string match
$p $n]} {
42 set value
[get-define
$n]
43 lappend lines
"define $n [list $value]"
48 set buf
[join $lines \n]
49 write-if-changed
$file $buf {
50 msg-result
"Created $file"