[Omake] Compiling files in different directories
Christopher L Conway
cconway at cs.nyu.edu
Wed May 30 06:19:35 PDT 2007
Do you have an OMakefile in the camlp4 directory? This is required to
make camlp4 part of the project, even though, in this simple case, you
don't need an explicit rule to compile logic.ml. See "Rule Scoping" in
the manual:
file:///home/chris/tools/omake-0.9.8.1/doc/html/omake-doc.html#htoc86
Here's a configuration that worked for me.
Regards,
Chris
OMakefile:
BYTE_ENABLED = true
NATIVE_ENABLED = true
.SUBDIRS: camlp4 resolv
.PHONY: clean
clean:
rm $(filter-proper-targets $(ls R, .))
camlp4/OMakefile:
# Note: this file can even be empty, so long as it exists.
println(camlp4)
resolv/OMakefile:
FILES = ../camlp4/logic resolv
OCAMLINCLUDES = ../camlp4
PROGRAM = test
OCamlProgram($(PROGRAM), $(FILES))
.DEFAULT: $(PROGRAM).run $(PROGRAM).opt
$ omake --verbose
*** omake: reading OMakefiles
*** omake: finished reading OMakefiles (0.0 sec)
- build camlp4 logic.cmi
+ ocamlc.opt -warn-error A -g -I . -c logic.ml
- build camlp4 logic.cmi
+ ocamlopt.opt -warn-error A -I . -c logic.ml
- exit camlp4 logic.cmi, code 0
- build resolv resolv.cmi
+ ocamlc.opt -warn-error A -g -I ../camlp4 -c resolv.ml
- build resolv resolv.cmi
+ ocamlopt.opt -warn-error A -I ../camlp4 -c resolv.ml
- exit resolv resolv.cmi, code 0
- build resolv test.run
+ ocamlc.opt -warn-error A -g -I ../camlp4 -custom -o test.run
../camlp4/logic.cmo resolv.cmo
- exit resolv test.run, code 0
- build resolv test.opt
+ ocamlopt.opt -warn-error A -I ../camlp4 -o test.opt
../camlp4/logic.cmx resolv.cmx
- exit resolv test.opt, code 0
*** omake: done (0.4 sec, 0/2 scans, 4/10 rules, 10/89 digests)
On 5/30/07, Hugo Ferreira <hmf at inescporto.pt> wrote:
> hello,
>
> I have the following directory structure for my project:
>
> src/camlp4
> src/resolv
>
> In resolve I have files "resolv.ml" and "test.ml" which
> has a "open Logic" statement. I have the "logic.ml" file in
> "src/camlp4". The following lines of the omake file:
>
> FILES = ../camlp4/logic resolv
> PROGRAM = test
> OCamlProgram($(PROGRAM), $(FILES))
> .DEFAULT: $(PROGRAM).run $(PROGRAM).opt
>
> causes the following error:
>
> File /usr/lib/omake/build/OCaml.om: line 1027, characters 8-53
> Do not know how to build
> "/home/hugof/workspace/ilp2/src/camlp4/logic.cmo" required for "test.run"
>
> I have tried including the directory and changing the order of the
> files but still get an error. I should think this is trivial but
> cannot get it right. How should I do this? I am using OMake 0.9.8.1.
>
> TIA,
> Hugo F.
>
>
>
>
> _______________________________________________
> Omake mailing list
> Omake at metaprl.org
> https://lists.metaprl.org/mailman/listinfo/omake
>
>
More information about the Omake
mailing list