[Omake] sections & implicit rules

Jonathan Roewen jonathan.roewen at gmail.com
Sun Mar 25 14:13:44 PDT 2007


> CProgram creates _explicit_ rules, using the _current_ values of CC,
> CFLAGS, etc.
>
> So you need something like
>
> section
>  CC = $(LD)
>  CFLAGS = -nostdlib -T kernel.lds -export-dynamic
>  LIBS[] = $(LIBRARIES)/libm $(LIBRARIES)/libc ...
>  LDFLAGS = libdummy.so
>  CProgram(kernel.elf, $(OBJS))
>  kernel.elf: kernel.lds libdummy.so
>
> Also note that if you did have an implicit rule for, say, %.elf, in your
> original code, the rule will get instantiated when the _first_
> "kernel.elf: ..." line (before the "section" block) is encountered.

Ohh, I see. I was trying to figure it out from the examples, but I see
the section parts were for intermediary targets.

> > section
> >  OCAMLFLAGS += -nopervasives
> >  pervasives.cmi:
> >
> > which is in: <root>/minilib/OMakefile & <root>/kernel/stdlib/OMakefile
>
> Do you have some other "...pervasives.cmi...: ..." explicit dependency
> before this "section" block in the file that does not work?

I don't think I do. I'll have to go back and check it's not in one of
my lists of files that have an explicit dependency on
pervasives.cmi... Otherwise, no I don't. The two OMakefiles were
almost identical: one using OCamlPackage, the other OCamlLibrary.

The whole OMakefile was something like:

FILES = foo bar baz

$(addsuffix .cmo, $(FILES)): pervasives.cmi
$(addsuffix .cmi, $(FILES)): pervasives.cmi
# I think can omit first line since .cmo depends on .cmi though...

OCamlLibrary(stdlib, pervasives $(FILES))

section
  OCAMLFLAGS += -nopervasives
  pervasives.cmo pervasives.cmi:

.DEFAULT: stdlib.cma

Ohh, could an explicit dependency in a parent OMakefile cause the problems?

In the parent OMakefile, I have:

stdlib/pervasives.cmi: VFS.cmi stdio.cmi

This occurs after the .SUBDIRS directive, so I thought it would be
okay... the only difference I can think of.

Jonathan


More information about the Omake mailing list