Changes by: Jason Hickey (jyh at cs.caltech.edu)
Date: 2005-05-12 16:06:43 -0700 (Thu, 12 May 2005)
Revision: 988
Log message:
This is a significant change to .SCANNER rules, where .SCANNER rules
are treated much more like normal rules.
Externally, a .SCANNER rule has the usual rule form:
.SCANNER: target: dependencies...
...scanner commands...
In this commit, the scanner target is now decoupled from the
build target, allowing a scanner result to be used for multiple
build targets. For example, ocamldep produces dependencies
for .cmo and .cmx files simultaneously. They can share
the scanner rule by specifying an explicit :scanner: dependency.
.SCANNER: scan-ocaml-%.ml: %.ml
ocamldep $<
%.cmo: %.ml :scanner: scan-ocaml-%.ml
$(OCAMLC) ...
%.cmx %.o: %.ml :scanner: scan-ocaml-%.ml
$(OCAMLOPT) ...
The current convention is that scanner targets should be named
scan-<language>-<source-file>.
-- If a rule has multiple :scanner: dependencies, the actual
dependencies will be the union of the scanner results.
-- The .SCANNER targets use a different namespace than
normal targets, so it is valid to have overlapping rules.
.SCANNER: foo:
echo "foo: boo"
foo: :scanner: foo
...
-- For backwards compatibility, if a rule has no :scanner:
dependencies, then omake will try to find a scanner with
the same name as the target. So in the example above,
the :scanner: foo is actually unnecessary.