[Omake] fsubst in a static section

Christopher L Conway cconway at cs.nyu.edu
Tue Mar 4 15:37:45 PST 2008


I'm trying to use fsubst to output a configuration file in a static
block. I can see the fsubst output among the OMake messages and the
file Subst.out gets created, but the output is not piped into the
file. My best guess is this has something to do with the configuration
logic hijacking stdout. Is there a work-around?

$ cat OMakefile
static. =
   stdout = $(fopen Subst.out, w)
   fsubst(Subst.in)
   case $"\<\([[:alnum:]]+\)\." g
      value $(capitalize $1).
   close($(stdout))
$ cat Subst.in
abc. def. foobar.
$ omake --configure
make[0]: Entering directory `/media/sda6/src/tests/omake/omake.7'
*** omake: reading OMakefiles
Abc. Def. Foobar.
*** omake: finished reading OMakefiles (0.02 sec)
*** omake: done (0.02 sec, 0/0 scans, 0/0 rules, 0/33 digests)
$ cat Subst.out
$ ls -l Subst.out
-rwxrwx--- 1 chris chris 0 2008-03-04 18:32 Subst.out

An aside: the manual has a bug in the section on fsubst. It states the
last line above should be "close(stdout)", but this results in:
   File OMakefile: line 8, characters 3-16
   not a file descriptor:
      "stdout" : Sequence

Regards,
Chris


More information about the Omake mailing list