[Omake] error when defining a rule inside of a function

Erick Tryzelaar erickt at dslextreme.com
Sat Jan 13 11:39:00 PST 2007


Erick Tryzelaar wrote:
> Aleksey Nogin wrote:
>> Hm, this works correctly for me. Which version of OMake are you using?
>> Have you may be redefined the "rule" function?
>>   
>
> I think thats what I was doing. I didn't know that defining a function 
> named "rule" would break rule defining :)

Hmm, this led me to a stack overflow, with this OMakefile:


EXECUTABLE. =
    make-rule(target, sources) =
        $(target): $(sources)
            echo $(comflags $(target), $(sources))
        return $(target)

C. =
    extends $(EXECUTABLE)
    comflags(target, sources) =
        return -o $(target) -c $(sources)

LINK. =
    extends $(EXECUTABLE)
    comflags(target, sources) =
        return -r -o $(target) $(sources)

%.o: %.c
    $(C.com $@, $+)

.DEFAULT: $(LINK.make-rule cmain.o, foo)


I rebuilt the svn version in bytecode, and here's the line that is 
throwing the exception:


Time : 1974259 - pc : 818852 - module Omake_build
2970        | exn when opt_poll options<|a|> && restartable_exn exn ->


And the stack trace:

#0  Pc : 818852  Omake_build char 103340
#1  Pc : 560772  Omake_exn_print char 4131
#2  Pc : 1072300  Omake_main char 12422


-e


More information about the Omake mailing list