[Omake] Re: Changing variables for a target

David Kågedal davidk at lysator.liu.se
Fri Sep 15 01:58:45 PDT 2006


Jason Hickey <jyh at cs.caltech.edu> writes:

> David Kågedal wrote:
>> I'd like to use the standard implicit rule for compiling %.c to %.o,
>> but then for some targets, I'd like to set CFLAGS to a different
>> value.
> ...
>> In OMake, I figured I'd like to do something like this
>> section
>>     CFLAGS += -O2
>>     # instantiate the implicit rule
>>     b.o:
>> CProgram(prog, a b c)
>
> This should work...  Here is an example that I tried.
>
> % touch a.c b.c c.c
> <OMakefile>
> section
>     CFLAGS += -O6
>     b.o:
>
> CProgram(prog, a b c)
>
> .DEFAULT: prog$(EXE)
> </OMakefile>

Yes, your example does indeed work.  Mine probably did as well, and I
admit that I didn't test that.  My real problem is much more
complicated with a number of OMakefiles in different subdirectories.
But I only have a single implicit rule for compiling C files.  I will
investigate further, now that I know that I'm on the right track.

-- 
David Kågedal



More information about the Omake mailing list