【发布时间】:2014-02-23 00:19:19
【问题描述】:
我的项目结构如下:
Makefile
src/
main.ml
tests/
tests.ml
Makefile 是这样的:
tests:
ocamlbuild -Is src,tests tests.byte -build-dir $(BUILDDIR) $(TESTFLAGS) -lflags -I,/usr/lib/ocaml/oUnit -cflags -I,/usr/lib/ocaml/oUnit -libs oUnit
运行 make tests(在构建 main.byte 之后)返回此错误:
ocamlbuild -Is src,tests tests.byte -build-dir build -lflags -I,/usr/lib/ocaml/oUnit -cflags -I,/usr/lib/ocaml/oUnit -libs oUnit
+ /usr/bin/ocamlc -c -I /usr/lib/ocaml/oUnit -I tests -I src -o tests/tests.cmo tests/tests.ml
File "tests/tests.ml", line 3, characters 46-50:
Error: Unbound value main
Command exited with code 2.
Compilation unsuccessful after building 2 targets (0 cached) in 00:00:00.
make: *** [tests] Error 10
显示ocamlbuild 无法链接到main.byte。 Makefile 的 tests 规则应该是什么样的?
【问题讨论】:
标签: makefile ocaml ocamlbuild ounit