[Omake] gnu make to omake port, 2nd and final glitch
Aleksey Nogin
nogin at metaprl.org
Sun Jan 7 15:22:54 PST 2007
On 07.01.2007 14:38, Nick wrote:
> I get error
> "filename pattern is a path:
> ../../derived/yprog_eod/x86_64-unknown-linux-gnu/%.o"
In general, in OMake you can only use implicit rules for building files
in a directory that was made an explicit part of the project (via an
appropriate .SUBDIRS) and the implicit rule needs to go into the body of
that .SUBDIRS (or into the corresponding OMakefile, if .SUBDIRS has no
body).
This has to do with scoping and modularity - in OMake, every subproject
is allowed to (independently) define its own implicit rules and this
limitation makes it possible to figure out what rules are supposed to be
used for each subproject.
Note that in your case this is not very relevant - you already have the
full file list, so it should be trivial to change your function to
create explicit rules - just change
...
> left = $(nth $i, $(F2))
> right = $(nth $i, $(F3))
> $(left)%.o: $(right)/%.c
...
into something like
...
left = $(nth $i, $(F4))
right = $(nth $i, $(cfiles))
$(left): $(right)
...
Alternatively, use .SUBDIRS, e.g. something like
...
left = $(nth $i, $(F2))
right = $(dir $(nth $i, $(F3)))
.SUBDIRS: $(left)
%.o: $(right)/%.c
...
Note that in the latter case you are likely to get wrong results if you
do something like
CFLAGS = flags1
Cmyprog(prog1, files1)
CFLAGS = flags2
Cmyprog(prog2, files2)
where files1 and files2 have intersecting directories.
Aleksey
More information about the Omake
mailing list